|
|
@ -128,8 +128,11 @@ static struct bt_conn_auth_cb zmk_ble_auth_cb_display = { |
|
|
|
static const struct bt_data zmk_ble_ad[] = { |
|
|
|
static const struct bt_data zmk_ble_ad[] = { |
|
|
|
BT_DATA_BYTES(BT_DATA_FLAGS, (BT_LE_AD_GENERAL | BT_LE_AD_NO_BREDR)), |
|
|
|
BT_DATA_BYTES(BT_DATA_FLAGS, (BT_LE_AD_GENERAL | BT_LE_AD_NO_BREDR)), |
|
|
|
BT_DATA_BYTES(BT_DATA_UUID16_SOME, |
|
|
|
BT_DATA_BYTES(BT_DATA_UUID16_SOME, |
|
|
|
|
|
|
|
#if !IS_ENABLED(CONFIG_ZMK_SPLIT_BLE) |
|
|
|
0x12, 0x18, /* HID Service */ |
|
|
|
0x12, 0x18, /* HID Service */ |
|
|
|
0x0f, 0x18), /* Battery Service */ |
|
|
|
#endif |
|
|
|
|
|
|
|
0x0f, 0x18 /* Battery Service */ |
|
|
|
|
|
|
|
), |
|
|
|
#if IS_ENABLED(CONFIG_ZMK_SPLIT_BLE) |
|
|
|
#if IS_ENABLED(CONFIG_ZMK_SPLIT_BLE) |
|
|
|
BT_DATA_BYTES(BT_DATA_UUID128_ALL, |
|
|
|
BT_DATA_BYTES(BT_DATA_UUID128_ALL, |
|
|
|
ZMK_SPLIT_BT_SERVICE_UUID) |
|
|
|
ZMK_SPLIT_BT_SERVICE_UUID) |
|
|
@ -155,10 +158,6 @@ static void zmk_ble_ready(int err) |
|
|
|
|
|
|
|
|
|
|
|
static int zmk_ble_init(struct device *_arg) |
|
|
|
static int zmk_ble_init(struct device *_arg) |
|
|
|
{ |
|
|
|
{ |
|
|
|
if (IS_ENABLED(CONFIG_SETTINGS)) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
settings_load(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
int err = bt_enable(NULL); |
|
|
|
int err = bt_enable(NULL); |
|
|
|
|
|
|
|
|
|
|
|
if (err) |
|
|
|
if (err) |
|
|
@ -167,6 +166,11 @@ static int zmk_ble_init(struct device *_arg) |
|
|
|
return err; |
|
|
|
return err; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (IS_ENABLED(CONFIG_BT_SETTINGS)) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
settings_load(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
bt_conn_cb_register(&conn_callbacks); |
|
|
|
bt_conn_cb_register(&conn_callbacks); |
|
|
|
bt_conn_auth_cb_register(&zmk_ble_auth_cb_display); |
|
|
|
bt_conn_auth_cb_register(&zmk_ble_auth_cb_display); |
|
|
|
|
|
|
|
|
|
|
|