Skip to content

Commit

Permalink
fix(ble): Fix race condition causing lockup
Browse files Browse the repository at this point in the history
  • Loading branch information
ReFil committed Nov 16, 2023
1 parent 0e7bcc3 commit 8acbcd7
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions app/src/split/bluetooth/central.c
Original file line number Diff line number Diff line change
Expand Up @@ -722,6 +722,11 @@ void split_central_split_led_callback(struct k_work *work) {
continue;
}

if (!peripherals[0].update_led_handle) {
LOG_ERR("handle not discovered");
continue;
}

int err = bt_gatt_write_without_response(peripherals[0].conn,
peripherals[0].update_led_handle, &payload,
sizeof(struct zmk_split_update_led_data), true);
Expand Down Expand Up @@ -783,6 +788,11 @@ void split_central_split_bl_callback(struct k_work *work) {
continue;
}

if (!peripherals[0].update_bl_handle) {
LOG_ERR("handle not discovered");
continue;
}

int err =
bt_gatt_write_without_response(peripherals[0].conn, peripherals[0].update_bl_handle,
&payload, sizeof(struct zmk_split_update_bl_data), true);
Expand Down

0 comments on commit 8acbcd7

Please sign in to comment.