forked from wpilibsuite/allwpilib
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[build] Generate NI Style UsageReporting header (wpilibsuite#7331)
based on wplibsuite/ni-libraries src/include/FRC_NetworkCommunication/UsageReporting.h
- Loading branch information
1 parent
ded7c87
commit 0798ac5
Showing
3 changed files
with
294 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
|
||
#ifndef __UsageReporting_h__ | ||
#define __UsageReporting_h__ | ||
|
||
#ifdef _WIN32 | ||
#include <stdint.h> | ||
#define EXPORT_FUNC __declspec(dllexport) __cdecl | ||
#elif defined(__vxworks) | ||
#include <vxWorks.h> | ||
#define EXPORT_FUNC | ||
#else | ||
#include <stdint.h> | ||
#include <stdlib.h> | ||
#define EXPORT_FUNC | ||
#endif | ||
|
||
#define kUsageReporting_version 1 | ||
|
||
namespace nUsageReporting | ||
{ | ||
typedef enum | ||
{ | ||
${usage_reporting_types_cpp} | ||
|
||
// kResourceType_MaximumID = 255, | ||
} tResourceType; | ||
|
||
typedef enum | ||
{ | ||
${usage_reporting_instances_cpp} | ||
} tInstances; | ||
|
||
/** | ||
* Report the usage of a resource of interest. | ||
* | ||
* @param resource one of the values in the tResourceType above (max value 51). | ||
* @param instanceNumber an index that identifies the resource instance. | ||
* @param context an optional additional context number for some cases (such as module number). Set to 0 to omit. | ||
* @param feature a string to be included describing features in use on a specific resource. Setting the same resource more than once allows you to change the feature string. | ||
*/ | ||
uint32_t EXPORT_FUNC report(tResourceType resource, uint8_t instanceNumber, uint8_t context = 0, const char* feature = NULL); | ||
} // namespace nUsageReporting | ||
|
||
#ifdef __cplusplus | ||
extern "C" | ||
{ | ||
#endif | ||
|
||
uint32_t EXPORT_FUNC FRC_NetworkCommunication_nUsageReporting_report(uint8_t resource, uint8_t instanceNumber, uint8_t context, const char* feature); | ||
|
||
#ifdef __cplusplus | ||
} | ||
#endif | ||
|
||
#endif // __UsageReporting_h__ |
223 changes: 223 additions & 0 deletions
223
hal/src/generated/main/native/include/hal/UsageReporting.h
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.