Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(ble): Add information to profile changed event #2275

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading