From 6ed14e9634a0d468d0b7dda3b73ef800521008f6 Mon Sep 17 00:00:00 2001 From: ReFil <31960031+ReFil@users.noreply.github.com> Date: Mon, 20 Nov 2023 13:03:56 +0000 Subject: [PATCH] feat(split): raise status changed events on central --- app/src/split/bluetooth/central.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/app/src/split/bluetooth/central.c b/app/src/split/bluetooth/central.c index ee21a12f..61ec4e8d 100644 --- a/app/src/split/bluetooth/central.c +++ b/app/src/split/bluetooth/central.c @@ -29,6 +29,7 @@ LOG_MODULE_DECLARE(zmk, CONFIG_ZMK_LOG_LEVEL); #include #include #include +#include static int start_scanning(void); @@ -712,6 +713,8 @@ static void split_central_connected(struct bt_conn *conn, uint8_t conn_err) { confirm_peripheral_slot_conn(conn); split_central_process_connection(conn); + raise_zmk_split_peripheral_status_changed( + (struct zmk_split_peripheral_status_changed){.connected = true}); } static void split_central_disconnected(struct bt_conn *conn, uint8_t reason) { @@ -728,6 +731,8 @@ static void split_central_disconnected(struct bt_conn *conn, uint8_t reason) { k_msgq_put(&peripheral_batt_lvl_msgq, &ev, K_NO_WAIT); k_work_submit(&peripheral_batt_lvl_work); #endif // IS_ENABLED(CONFIG_ZMK_SPLIT_BLE_CENTRAL_BATTERY_LEVEL_FETCHING) + raise_zmk_split_peripheral_status_changed( + (struct zmk_split_peripheral_status_changed){.connected = false}); err = release_peripheral_slot_for_conn(conn);