From afe998a09751c19f892a4d80bfd9513841740b90 Mon Sep 17 00:00:00 2001 From: ReFil <31960031+ReFil@users.noreply.github.com> Date: Wed, 17 Apr 2024 08:53:34 +0100 Subject: [PATCH] feat(ble): Add information to profile changed event --- app/include/zmk/events/ble_active_profile_changed.h | 2 ++ app/src/ble.c | 5 ++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/app/include/zmk/events/ble_active_profile_changed.h b/app/include/zmk/events/ble_active_profile_changed.h index 620e19b4..d5e8787c 100644 --- a/app/include/zmk/events/ble_active_profile_changed.h +++ b/app/include/zmk/events/ble_active_profile_changed.h @@ -15,6 +15,8 @@ struct zmk_ble_active_profile_changed { uint8_t index; struct zmk_ble_profile *profile; + bool open; + bool connected; }; ZMK_EVENT_DECLARE(zmk_ble_active_profile_changed); diff --git a/app/src/ble.c b/app/src/ble.c index 7e1ae7d4..ebaa5a10 100644 --- a/app/src/ble.c +++ b/app/src/ble.c @@ -84,7 +84,10 @@ static bt_addr_le_t peripheral_addrs[ZMK_SPLIT_BLE_PERIPHERAL_COUNT]; static void raise_profile_changed_event(void) { raise_zmk_ble_active_profile_changed((struct zmk_ble_active_profile_changed){ - .index = active_profile, .profile = &profiles[active_profile]}); + .index = active_profile, + .profile = &profiles[active_profile], + .open = zmk_ble_active_profile_is_open(), + .connected = zmk_ble_active_profile_is_connected()}); } static void raise_profile_changed_event_callback(struct k_work *work) {