Battery Service

Last Updated on : 2024-06-04 09:43:19download

This topic describes the commands for the battery service.

Query battery level (0x71 25)

The MCU sends the following data.

Field Bytes Description
Header 2 0x55aa
Version 1 0x03
Command 1 0x71
Data length 2 0x0001
Data 1 Subcommand: 0x25
Checksum 1 Start from the header, add up all the bytes, and then divide the sum by 256 to get the remainder.

The module returns the following data.

Field Bytes Description
Header 2 0x55aa
Version 1 0x00
Command 1 0x71
Data length 2 0x0002
Data 2
  • Subcommand: 0x25
  • Battery level: 0 to 100
Checksum 1 Start from the header, add up all the bytes, and then divide the sum by 256 to get the remainder.

Query battery charging status (0x71 26)

The MCU sends the following data.

Field Bytes Description
Header 2 0x55aa
Version 1 0x03
Command 1 0x71
Data length 2 0x0001
Data 1 Subcommand: 0x26
Checksum 1 Start from the header, add up all the bytes, and then divide the sum by 256 to get the remainder.

The module returns the following data.

Field Bytes Description
Header 2 0x55aa
Version 1 0x00
Command 1 0x71
Data length 2 0x0002
Data 2
  • Subcommand: 0x26
  • Charging state:
    • 0: Initial state. When the device starts up, no charging state is detected.
    • 1: Start charging.
    • 2: Charging is finished.
    • 3: Battery is low.
    • 4: Battery is extremely low.
    • 5: Battery is unplugged.
    • 6: Charger is unplugged.
    • 7: Charging fault occurs.
Checksum 1 Start from the header, add up all the bytes, and then divide the sum by 256 to get the remainder.