AIROC™ BTSDK v4.6 - Documentation | ||||
This file provides definitions and function prototypes for the Bluetooth LE Battery profile, service, application. More...
Typedefs | |
struct { | |
UINT8 adcInputConnectedToBattery | |
ADC input to be used for measurement. Note that this may not be a GPIO. | |
UINT32 measurementInterval | |
Period in millisecs between battery measurements. | |
UINT8 numberOfMeasurementsToAverage | |
Number of measurements averaged for a report, max 16. | |
UINT16 fullVoltage | |
The nominal full battery voltage. | |
UINT16 emptyVoltage | |
The voltage at which the batteries are considered drained in milli-volts. | |
UINT16 shutdownVoltage | |
System should shutdown if it detects battery voltage at or below this value Setting to 0 disables shutdown. More... | |
UINT8 maxLevel | |
Sets the range of the reported number of steps. More... | |
UINT8 reportID | |
ID of the battery report. | |
UINT8 reportLength | |
Length of the battery report. | |
UINT8 reportOnConnect | |
Flag indicating that a report should be sent when a connection is established. | |
} | BLEBAT_BATMON_CFG |
Config for the battery monitoring. | |
struct { | |
UINT16 hdl | |
UINT16 cl_hdl | |
UINT16 ds_hdl | |
UINT16 serv | |
UINT16 cha | |
UINT16 des | |
} | BLE_BAT_GATT_CFG |
struct { | |
UINT8 bdAddr [6] | |
UINT8 notify_mask | |
UINT8 broadcast_mask | |
} | BLEBAT_HOSTINFO |
Enumerations | |
enum | { MAX_MEAS_TO_AVERAGE = 16 } |
enum | bat_power_state { BLEBAT_POWERSTATE_PRESENT_UNKNOWN = 0x00, BLEBAT_POWERSTATE_PRESENT_NOTSUPPORTED = 0x01, BLEBAT_POWERSTATE_PRESENT_NOTPRESENT = 0x02, BLEBAT_POWERSTATE_PRESENT_PRESENT = 0x03, BLEBAT_POWERSTATE_DISCHARGING_UNKNOWN = (0x00 << 2), BLEBAT_POWERSTATE_DISCHARGING_NOTSUPPORTED = (0x01 << 2), BLEBAT_POWERSTATE_DISCHARGING_NOTDISCHARGING = (0x02 << 2), BLEBAT_POWERSTATE_DISCHARGING_DISCHARGING = (0x03 << 2), BLEBAT_POWERSTATE_CHARGING_UNKNOWN = (0x00 << 4), BLEBAT_POWERSTATE_CHARGING_NOTSUPPORTED = (0x01 << 4), BLEBAT_POWERSTATE_CHARGING_NOTCHARGING = (0x02 << 4), BLEBAT_POWERSTATE_CHARGING_CHARGING = (0x03 << 4), BLEBAT_POWERSTATE_LEVEL_UNKNOWN = (0x00 << 6), BLEBAT_POWERSTATE_LEVEL_NOTSUPPORTED = (0x01 << 6), BLEBAT_POWERSTATE_LEVEL_GOODLEVEL = (0x02 << 6), BLEBAT_POWERSTATE_LEVEL_CRITICALLYLOWLEVEL = (0x03 << 6) } |
enum | bat_service_required { BLEBAT_SERVICEREQUIRED_UNKNOWN = 0x00, BLEBAT_SERVICEREQUIRED_NOSERVICEREQUIRED = 0x01, BLEBAT_SERVICEREQUIRED_SERVICEREQUIRED = 0x02 } |
enum | bat_removable { BLEBAT_REMOVABLE_UNKNOWN = 0x00, BLEBAT_REMOVABLE_NOTREMOVABLE = 0x01, BLEBAT_REMOVABLE_REMOVABLE = 0x02 } |
Functions | |
void | blebat_Init (void) |
void | blebat_connUp (void) |
void | blebat_connDown (void) |
void | blebat_smpBondResult (LESMP_PARING_RESULT result) |
void | blebat_pollMonitor (void) |
This file provides definitions and function prototypes for the Bluetooth LE Battery profile, service, application.
Refer to Bluetooth SIG Battery Service 1.0 specification for details.
UINT8 maxLevel |
Sets the range of the reported number of steps.
Should not be set to 0. Set it to 100 to report battery in %, 0-100.
UINT16 shutdownVoltage |
System should shutdown if it detects battery voltage at or below this value Setting to 0 disables shutdown.
In millivolts.