Skip to content

Commit

Permalink
feat(ble): Add information to profile changed event
Browse files Browse the repository at this point in the history
  • Loading branch information
ReFil committed Jun 18, 2024
1 parent 7c09eb2 commit afe998a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 2 additions & 0 deletions app/include/zmk/events/ble_active_profile_changed.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
5 changes: 4 additions & 1 deletion app/src/ble.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit afe998a

Please sign in to comment.