fix(split): Update events and init function
This commit is contained in:
parent
f4176656ab
commit
c0a3d490b0
3 changed files with 3 additions and 7 deletions
|
@ -97,7 +97,7 @@ static inline int set_layer_state(uint8_t layer, bool state) {
|
||||||
// Don't send state changes unless there was an actual change
|
// Don't send state changes unless there was an actual change
|
||||||
if (old_state != _zmk_keymap_layer_state) {
|
if (old_state != _zmk_keymap_layer_state) {
|
||||||
LOG_DBG("layer_changed: layer %d state %d", layer, state);
|
LOG_DBG("layer_changed: layer %d state %d", layer, state);
|
||||||
ZMK_EVENT_RAISE(create_layer_state_changed(layer, state));
|
raise_layer_state_changed(layer, state);
|
||||||
#if ZMK_BLE_IS_CENTRAL
|
#if ZMK_BLE_IS_CENTRAL
|
||||||
int err = zmk_split_central_send_data(DATA_TAG_KEYMAP_STATE, sizeof(uint32_t),
|
int err = zmk_split_central_send_data(DATA_TAG_KEYMAP_STATE, sizeof(uint32_t),
|
||||||
(uint8_t *)&_zmk_keymap_layer_state);
|
(uint8_t *)&_zmk_keymap_layer_state);
|
||||||
|
|
|
@ -455,10 +455,6 @@ static uint8_t split_central_chrc_discovery_func(struct bt_conn *conn,
|
||||||
slot->batt_lvl_read_params.single.offset = 0;
|
slot->batt_lvl_read_params.single.offset = 0;
|
||||||
bt_gatt_read(conn, &slot->batt_lvl_read_params);
|
bt_gatt_read(conn, &slot->batt_lvl_read_params);
|
||||||
#endif /* IS_ENABLED(CONFIG_ZMK_SPLIT_BLE_CENTRAL_BATTERY_LEVEL_FETCHING) */
|
#endif /* IS_ENABLED(CONFIG_ZMK_SPLIT_BLE_CENTRAL_BATTERY_LEVEL_FETCHING) */
|
||||||
}
|
|
||||||
|
|
||||||
bool subscribed = slot->run_behavior_handle && slot->subscribe_params.value_handle;
|
|
||||||
|
|
||||||
} else if (bt_uuid_cmp(chrc_uuid, BT_UUID_DECLARE_128(ZMK_SPLIT_BT_CHAR_DATA_XFER_UUID)) == 0) {
|
} else if (bt_uuid_cmp(chrc_uuid, BT_UUID_DECLARE_128(ZMK_SPLIT_BT_CHAR_DATA_XFER_UUID)) == 0) {
|
||||||
LOG_DBG("Found data transfer handle");
|
LOG_DBG("Found data transfer handle");
|
||||||
slot->discover_params.uuid = NULL;
|
slot->discover_params.uuid = NULL;
|
||||||
|
@ -918,7 +914,7 @@ int zmk_split_central_send_data(enum data_tag tag, uint8_t size, uint8_t *data)
|
||||||
return split_bt_data_xfer_payload(payload);
|
return split_bt_data_xfer_payload(payload);
|
||||||
}
|
}
|
||||||
|
|
||||||
int zmk_split_bt_central_init(const struct device *_arg) {
|
int zmk_split_bt_central_init(void) {
|
||||||
k_work_queue_start(&split_central_split_run_q, split_central_split_run_q_stack,
|
k_work_queue_start(&split_central_split_run_q, split_central_split_run_q_stack,
|
||||||
K_THREAD_STACK_SIZEOF(split_central_split_run_q_stack),
|
K_THREAD_STACK_SIZEOF(split_central_split_run_q_stack),
|
||||||
CONFIG_ZMK_BLE_THREAD_PRIORITY, NULL);
|
CONFIG_ZMK_BLE_THREAD_PRIORITY, NULL);
|
||||||
|
|
|
@ -103,7 +103,7 @@ static void split_svc_data_xfer_callback(struct k_work *work) {
|
||||||
LOG_DBG("Size correct, raising event");
|
LOG_DBG("Size correct, raising event");
|
||||||
struct zmk_split_data_xfer_event event;
|
struct zmk_split_data_xfer_event event;
|
||||||
memcpy(&event.data_xfer, &data_xfer_payload, sizeof(struct zmk_split_data_xfer_data));
|
memcpy(&event.data_xfer, &data_xfer_payload, sizeof(struct zmk_split_data_xfer_data));
|
||||||
ZMK_EVENT_RAISE(new_zmk_split_data_xfer_event(event));
|
raise_zmk_split_data_xfer_event(event);
|
||||||
}
|
}
|
||||||
|
|
||||||
static K_WORK_DEFINE(split_svc_data_xfer_work, split_svc_data_xfer_callback);
|
static K_WORK_DEFINE(split_svc_data_xfer_work, split_svc_data_xfer_callback);
|
||||||
|
|
Loading…
Add table
Reference in a new issue