CDC Badge OS
Firmware for the CDC Badge v1.0 hardware security key
Loading...
Searching...
No Matches
System Info

Query firmware identity and feature gating. More...

Functions

bool host_feature_enabled (uint16_t feature_id)
 True when the firmware was built with the given feature id enabled.
int host_get_firmware_version (char *out, size_t out_size)
 Copy the firmware semver string into out.
int host_get_build_profile (char *out, size_t out_size)
 Copy the build profile name (e.g. "release", "debug") into out.
uint8_t host_cpu_load (void)
 Aggregate CPU load across all cores as 0..100 percent. Sampled on demand from FreeRTOS run-time stats and refreshed at most a few times per second; intermediate calls return the cached value. The first call after load returns 0 (no baseline yet).

Detailed Description

Query firmware identity and feature gating.

Function Documentation

◆ host_cpu_load()

uint8_t host_cpu_load ( void )

Aggregate CPU load across all cores as 0..100 percent. Sampled on demand from FreeRTOS run-time stats and refreshed at most a few times per second; intermediate calls return the cached value. The first call after load returns 0 (no baseline yet).

Definition at line 72 of file host_api_sysinfo.cpp.

References cdc::core::CpuStats::sample().

Referenced by cdc::plugin_manager::w_host_cpu_load().

◆ host_feature_enabled()

bool host_feature_enabled ( uint16_t feature_id)

True when the firmware was built with the given feature id enabled.

Definition at line 41 of file host_api_sysinfo.cpp.

References DEBUG_MODE.

Referenced by cdc::plugin_manager::w_host_feature_enabled().

◆ host_get_build_profile()

int host_get_build_profile ( char * out,
size_t out_size )

Copy the build profile name (e.g. "release", "debug") into out.

Definition at line 33 of file host_api_sysinfo.cpp.

References BUILD_PROFILE_BYTE, HOST_ERR_INVALID_ARG, and HOST_OK.

Referenced by cdc::plugin_manager::w_host_get_build_profile().

◆ host_get_firmware_version()

int host_get_firmware_version ( char * out,
size_t out_size )

Copy the firmware semver string into out.

Definition at line 26 of file host_api_sysinfo.cpp.

References APP_NAME, APP_VERSION, HOST_ERR_INVALID_ARG, and HOST_OK.

Referenced by cdc::plugin_manager::w_host_get_firmware_version().