Myriota Flex SDK 2.5.0
Loading...
Searching...
No Matches
Power Diagnostics

Diagnostics for the power subsystem. More...

Typedefs

typedef void(* FLEX_OnExternalPowerHandler) (const bool *const IsOnExternalPower)
 

Functions

int FLEX_GetBatteryVoltage (int32_t *const VoltageMilliVolts)
 
int FLEX_IsOnExternalPower (bool *const IsOnExternalPower)
 
void FLEX_OnExternalPowerHandlerSet (const FLEX_OnExternalPowerHandler Handler)
 

Detailed Description

Diagnostics for the power subsystem.

Typedef Documentation

◆ FLEX_OnExternalPowerHandler

typedef void(* FLEX_OnExternalPowerHandler) (const bool *const IsOnExternalPower)

On External Power Handler Function Pointer Declaration.

Parameters
[in]IsOnExternalPowerif the FlexSense is using external power or not.

Function Documentation

◆ FLEX_GetBatteryVoltage()

int FLEX_GetBatteryVoltage ( int32_t *const VoltageMilliVolts)

Reads the FlexSense's battery voltage in mV.

Note
When the FlexSense is operating on external power, the battery Voltage reports zero.
Parameters
[out]VoltageMilliVoltsthe current battery voltage in mV.
Returns
FLEX_SUCCESS (0) if succeeded and < 0 if failed.
Return values
-FLEX_ERROR_ENOTRECOVERABLEBLE module comms in an unrecoverable state.
-FLEX_ERROR_EPROTOBLE module comms protocol error most likely a version miss match.
-FLEX_ERROR_ECOMMFailed to communicate with the BLE module.

◆ FLEX_IsOnExternalPower()

int FLEX_IsOnExternalPower ( bool *const IsOnExternalPower)
Parameters
[out]IsOnExternalPowercurrent state of the external power.
Returns
FLEX_SUCCESS (0) if succeeded and < 0 if failed.
Return values
-FLEX_ERROR_ENOTRECOVERABLEBLE module comms in an unrecoverable state.
-FLEX_ERROR_EPROTOBLE module comms protocol error most likely a version miss match.
-FLEX_ERROR_ECOMMFailed to communicate with the BLE module.

◆ FLEX_OnExternalPowerHandlerSet()

void FLEX_OnExternalPowerHandlerSet ( const FLEX_OnExternalPowerHandler Handler)

Adds an event handler for when the external power state changes.

Note
There can only be one handler subscribed to the event at a time, so passing in a new handler will remove the current one.
Parameters
[in]Handlerthe event handler to be called on external power state change.