mirror of
https://github.com/espressif/esp-nimble.git
synced 2026-06-05 21:04:49 +00:00
fix(nimble): Preserve device name across ble_svc_gap_init re-call
This commit is contained in:
@@ -528,10 +528,8 @@ ble_svc_gap_appearance_init(void)
|
||||
if (!ble_hs_gap_svc_ctx) {
|
||||
return BLE_HS_ENOMEM;
|
||||
}
|
||||
ble_svc_gap_appearance = MYNEWT_VAL(BLE_SVC_GAP_APPEARANCE);
|
||||
}
|
||||
|
||||
ble_svc_gap_appearance = MYNEWT_VAL(BLE_SVC_GAP_APPEARANCE);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -542,6 +540,11 @@ ble_svc_gap_init_name(void)
|
||||
return BLE_HS_EINVAL;
|
||||
}
|
||||
|
||||
if (ble_hs_gap_svc_ctx->svc_gap_name != NULL) {
|
||||
/* Device name is already initialized (either default or set at runtime) */
|
||||
return 0;
|
||||
}
|
||||
|
||||
const char *default_name = MYNEWT_VAL(BLE_SVC_GAP_DEVICE_NAME);
|
||||
size_t len = strlen(default_name);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user