report battery levels with bluetooth
This commit is contained in:
@ -11,6 +11,7 @@
|
||||
#include <zephyr/bluetooth/conn.h>
|
||||
#include <zephyr/bluetooth/gatt.h>
|
||||
#include <zephyr/bluetooth/hci.h>
|
||||
#include <zephyr/bluetooth/services/bas.h>
|
||||
|
||||
extern int mtu_exchange(struct bt_conn *conn);
|
||||
extern int write_cmd(struct bt_conn *conn);
|
||||
@ -19,6 +20,9 @@ extern uint32_t last_write_rate;
|
||||
|
||||
static const struct bt_data ad[] = {
|
||||
BT_DATA_BYTES(BT_DATA_FLAGS, (BT_LE_AD_GENERAL | BT_LE_AD_NO_BREDR)),
|
||||
BT_DATA_BYTES(BT_DATA_UUID16_ALL,
|
||||
BT_UUID_16_ENCODE(BT_UUID_BAS_VAL), // battery service
|
||||
),
|
||||
BT_DATA(BT_DATA_NAME_COMPLETE, CONFIG_BT_DEVICE_NAME, sizeof(CONFIG_BT_DEVICE_NAME) - 1), // -1 to strip \0
|
||||
};
|
||||
|
||||
|
Reference in New Issue
Block a user