forked from kofal.net/zmk
Working BT settings.
This commit is contained in:
@@ -128,8 +128,11 @@ static struct bt_conn_auth_cb zmk_ble_auth_cb_display = {
|
||||
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_UUID16_SOME,
|
||||
#if !IS_ENABLED(CONFIG_ZMK_SPLIT_BLE)
|
||||
0x12, 0x18, /* HID Service */
|
||||
0x0f, 0x18), /* Battery Service */
|
||||
#endif
|
||||
0x0f, 0x18 /* Battery Service */
|
||||
),
|
||||
#if IS_ENABLED(CONFIG_ZMK_SPLIT_BLE)
|
||||
BT_DATA_BYTES(BT_DATA_UUID128_ALL,
|
||||
ZMK_SPLIT_BT_SERVICE_UUID)
|
||||
@@ -155,10 +158,6 @@ static void zmk_ble_ready(int err)
|
||||
|
||||
static int zmk_ble_init(struct device *_arg)
|
||||
{
|
||||
if (IS_ENABLED(CONFIG_SETTINGS))
|
||||
{
|
||||
settings_load();
|
||||
}
|
||||
int err = bt_enable(NULL);
|
||||
|
||||
if (err)
|
||||
@@ -167,6 +166,11 @@ static int zmk_ble_init(struct device *_arg)
|
||||
return err;
|
||||
}
|
||||
|
||||
if (IS_ENABLED(CONFIG_BT_SETTINGS))
|
||||
{
|
||||
settings_load();
|
||||
}
|
||||
|
||||
bt_conn_cb_register(&conn_callbacks);
|
||||
bt_conn_auth_cb_register(&zmk_ble_auth_cb_display);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user