extmod/nimble: Do not set GAP device name after sync.

Instead, configure the default once at compile-time. This means the GAP
name will no longer be set to default after re-initializing Bluetooth.

Signed-off-by: Daniël van de Giessen <daniel@dvdgiessen.nl>
This commit is contained in:
Daniël van de Giessen
2023-09-12 14:38:30 +02:00
committed by Damien George
parent 0b2676db5c
commit d014c82826
3 changed files with 7 additions and 8 deletions

View File

@@ -53,10 +53,6 @@
#include "nimble/host/src/ble_hs_hci_priv.h"
#endif
#ifndef MICROPY_PY_BLUETOOTH_DEFAULT_GAP_NAME
#define MICROPY_PY_BLUETOOTH_DEFAULT_GAP_NAME "MPY NIMBLE"
#endif
#define DEBUG_printf(...) // printf("nimble: " __VA_ARGS__)
#define ERRNO_BLUETOOTH_NOT_ACTIVE MP_ENODEV
@@ -350,9 +346,6 @@ STATIC void sync_cb(void) {
assert(rc == 0);
}
DEBUG_printf("sync_cb: Setting device name\n");
ble_svc_gap_device_name_set(MICROPY_PY_BLUETOOTH_DEFAULT_GAP_NAME);
mp_bluetooth_nimble_ble_state = MP_BLUETOOTH_NIMBLE_BLE_STATE_ACTIVE;
}