Battery and Bluetooth Status APIs
Battery and Bluetooth Status APIs

Battery and Bluetooth Status APIs

Function prototype: uint8_t getBatteryLevel(void);

Description:
        
Get battery charge levels from firmware.
Parameters:
         None
Return value: uint8_t battery status
         0x01    battery_full (if battery percentage is >= 80)
         0x02    battery_med_high (if battery percentage is >= 60 and <80)
         0x03    battery_med_full (if battery percentage is >= 40 and <60)
         0x04    battery_med_low (if battery percentage is >= 20 and <40)
         0x05    battery_low (if battery percentage is <20)

Function prototype: uint8_t getBatteryChargingStatus(void);

Description:
        
Get battery charging status from firmware
Parameters:
         None
Return value: charge status of type uint8_t
         0x00 Not charging
          0x01 charging

Function prototype: uint16_t getBatteryPercentage(void);

Description:
        
Get battery level in terms of percentage from firmware.
Parameters:
         None
Return value: battery percentage of type uint16_t
         Range 0 to 100 in terms of percentage

Function prototype: int8_t getBTStatus(void);

Description:
        
Get Bluetooth connectivity status from firmware.
Parameters:
         None
Return: int8_t status
          0x00 disconnected
          0x01 connected