Commit d014c828 authored by Daniël van de Giessen's avatar Daniël van de Giessen Committed by Damien George

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: default avatarDaniël van de Giessen <daniel@dvdgiessen.nl>
parent 0b2676db
......@@ -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;
}
......
......@@ -134,7 +134,11 @@ int nimble_sprintf(char *str, const char *fmt, ...);
#define MYNEWT_VAL_BLE_SVC_GAP_APPEARANCE (0)
#define MYNEWT_VAL_BLE_SVC_GAP_APPEARANCE_WRITE_PERM (-1)
#define MYNEWT_VAL_BLE_SVC_GAP_CENTRAL_ADDRESS_RESOLUTION (-1)
#define MYNEWT_VAL_BLE_SVC_GAP_DEVICE_NAME ("pybd")
#ifdef MICROPY_PY_BLUETOOTH_DEFAULT_GAP_NAME
#define MYNEWT_VAL_BLE_SVC_GAP_DEVICE_NAME (MICROPY_PY_BLUETOOTH_DEFAULT_GAP_NAME)
#else
#define MYNEWT_VAL_BLE_SVC_GAP_DEVICE_NAME ("MPY NIMBLE")
#endif
#define MYNEWT_VAL_BLE_SVC_GAP_DEVICE_NAME_MAX_LENGTH (31)
#define MYNEWT_VAL_BLE_SVC_GAP_DEVICE_NAME_WRITE_PERM (-1)
#define MYNEWT_VAL_BLE_SVC_GAP_PPCP_MAX_CONN_INTERVAL (0)
......
......@@ -3,6 +3,8 @@ CONFIG_BT_ENABLED=y
CONFIG_BT_NIMBLE_ENABLED=y
CONFIG_BT_CONTROLLER_ENABLED=y
CONFIG_BT_NIMBLE_SVC_GAP_DEVICE_NAME="MPY ESP32"
CONFIG_BT_NIMBLE_MAX_CONNECTIONS=4
# Put NimBLE on core 1, and for synchronisation
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment