diff --git a/extmod/nimble/modbluetooth_nimble.c b/extmod/nimble/modbluetooth_nimble.c index 2e1faa9b10..c053ac56cf 100644 --- a/extmod/nimble/modbluetooth_nimble.c +++ b/extmod/nimble/modbluetooth_nimble.c @@ -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; } diff --git a/extmod/nimble/syscfg/syscfg.h b/extmod/nimble/syscfg/syscfg.h index a051a8fefd..f26f8db9ec 100644 --- a/extmod/nimble/syscfg/syscfg.h +++ b/extmod/nimble/syscfg/syscfg.h @@ -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) diff --git a/ports/esp32/boards/sdkconfig.ble b/ports/esp32/boards/sdkconfig.ble index 91ac3240eb..7fa08fe286 100644 --- a/ports/esp32/boards/sdkconfig.ble +++ b/ports/esp32/boards/sdkconfig.ble @@ -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