Generic Battery models

The Generic Battery models allow remote monitoring of the battery status of a mesh device.

The Generic Battery models also feature their own common types, listed below. For types common to all models, see Bluetooth Mesh models.

Common types

This section lists the types common to the Generic Battery mesh models.

Header file: include/bluetooth/mesh/gen_battery.h
group bt_mesh_battery

API for the Generic Battery models.

Defines

BT_MESH_BATTERY_LVL_UNKNOWN

Unknown battery level.

BT_MESH_BATTERY_TIME_MAX

Longest acceptable charge and discharge time in minutes

BT_MESH_BATTERY_TIME_UNKNOWN

Unknown discharge time

Enums

enum bt_mesh_battery_presence

Battery presence state.

Values:

enumerator BT_MESH_BATTERY_PRESENCE_NOT_PRESENT

The battery is not present.

enumerator BT_MESH_BATTERY_PRESENCE_PRESENT_REMOVABLE

The battery is present and is removable.

enumerator BT_MESH_BATTERY_PRESENCE_PRESENT_NOT_REMOVABLE

The battery is present and is non-removable.

enumerator BT_MESH_BATTERY_PRESENCE_UNKNOWN

The battery presence is unknown.

enum bt_mesh_battery_indicator

Indicator for the charge level of the battery.

Values:

enumerator BT_MESH_BATTERY_INDICATOR_CRITICALLY_LOW

The battery charge is Critically Low Level.

enumerator BT_MESH_BATTERY_INDICATOR_LOW

The battery charge is Low Level.

enumerator BT_MESH_BATTERY_INDICATOR_GOOD

The battery charge is Good Level.

enumerator BT_MESH_BATTERY_INDICATOR_UNKNOWN

The battery charge is unknown.

enum bt_mesh_battery_charging

Battery charging state.

Values:

enumerator BT_MESH_BATTERY_CHARGING_NOT_CHARGEABLE

The battery is not chargeable.

enumerator BT_MESH_BATTERY_CHARGING_CHARGEABLE_NOT_CHARGING

The battery is chargeable and is not charging.

enumerator BT_MESH_BATTERY_CHARGING_CHARGEABLE_CHARGING

The battery is chargeable and is charging.

enumerator BT_MESH_BATTERY_CHARGING_UNKNOWN

The battery charging state is unknown.

enum bt_mesh_battery_service

Battery service state.

Values:

enumerator BT_MESH_BATTERY_SERVICE_INVALID

Reserved for future use.

enumerator BT_MESH_BATTERY_SERVICE_NOT_REQUIRED

The battery does not require service.

enumerator BT_MESH_BATTERY_SERVICE_REQUIRED

The battery requires service.

enumerator BT_MESH_BATTERY_SERVICE_UNKNOWN

The battery serviceability is unknown.

struct bt_mesh_battery_status
#include <gen_battery.h>

Public Members

uint8_t battery_lvl

Current battery level in percent, or BT_MESH_BATTERY_LVL_UNKNOWN.

uint32_t discharge_minutes

Minutes until discharged, or BT_MESH_BATTERY_TIME_UNKNOWN.

uint32_t charge_minutes

Minutes until discharged, or BT_MESH_BATTERY_TIME_UNKNOWN.

enum bt_mesh_battery_presence presence

Presence state.

enum bt_mesh_battery_indicator indicator

Charge level indicator.

enum bt_mesh_battery_charging charging

Charging state.

enum bt_mesh_battery_service service

Service state.