ble_mesh: Init device name during proxy server init

Device name will be reset when deinit mesh stack. If not
initializing device name during the next mesh stack init,
it will fail to set the device name when using bluedroid.
pull/5408/head
lly 2020-05-18 15:21:47 +08:00 zatwierdzone przez bot
rodzic a0ce8c64b0
commit 4e60919a66
1 zmienionych plików z 2 dodań i 1 usunięć

Wyświetl plik

@ -109,7 +109,7 @@ static enum {
MESH_GATT_PROXY,
} gatt_svc = MESH_GATT_NONE;
static char device_name[DEVICE_NAME_SIZE + 1] = "ESP-BLE-MESH";
static char device_name[DEVICE_NAME_SIZE + 1];
int bt_mesh_set_device_name(const char *name)
{
@ -1416,6 +1416,7 @@ int bt_mesh_proxy_init(void)
bt_mesh_gatts_conn_cb_register(&conn_callbacks);
strncpy(device_name, "ESP-BLE-MESH", DEVICE_NAME_SIZE);
return bt_mesh_gatts_set_local_device_name(device_name);
}