diff --git a/components/bt/host/nimble/port/include/esp_nimble_cfg.h b/components/bt/host/nimble/port/include/esp_nimble_cfg.h index 8ff2c26c26..09fc9ea23b 100644 --- a/components/bt/host/nimble/port/include/esp_nimble_cfg.h +++ b/components/bt/host/nimble/port/include/esp_nimble_cfg.h @@ -642,13 +642,16 @@ #define MYNEWT_VAL_BLE_HS_FLOW_CTRL (0) #endif - -#ifndef MYNEWT_VAL_BLE_HS_FLOW_CTRL_ITVL -#define MYNEWT_VAL_BLE_HS_FLOW_CTRL_ITVL 2000 +#ifndef CONFIG_BT_NIMBLE_HS_FLOW_CTRL_ITVL +#define MYNEWT_VAL_BLE_HS_FLOW_CTRL_ITVL (2000) +#else +#define MYNEWT_VAL_BLE_HS_FLOW_CTRL_ITVL CONFIG_BT_NIMBLE_HS_FLOW_CTRL_ITVL #endif -#ifndef MYNEWT_VAL_BLE_HS_FLOW_CTRL_THRESH -#define MYNEWT_VAL_BLE_HS_FLOW_CTRL_THRESH 2 +#ifndef CONFIG_BT_NIMBLE_HS_FLOW_CTRL_THRESH +#define MYNEWT_VAL_BLE_HS_FLOW_CTRL_THRESH (2) +#else +#define MYNEWT_VAL_BLE_HS_FLOW_CTRL_THRESH CONFIG_BT_NIMBLE_HS_FLOW_CTRL_THRESH #endif #ifndef MYNEWT_VAL_BLE_HS_FLOW_CTRL_TX_ON_DISCONNECT @@ -675,8 +678,10 @@ #define MYNEWT_VAL_BLE_HS_SYSINIT_STAGE (200) #endif -#ifndef MYNEWT_VAL_BLE_L2CAP_COC_MAX_NUM -#define MYNEWT_VAL_BLE_L2CAP_COC_MAX_NUM 2 +#ifndef CONFIG_BT_NIMBLE_L2CAP_COC_MAX_NUM +#define MYNEWT_VAL_BLE_L2CAP_COC_MAX_NUM (2) +#else +#define MYNEWT_VAL_BLE_L2CAP_COC_MAX_NUM CONFIG_BT_NIMBLE_L2CAP_COC_MAX_NUM #endif #ifndef MYNEWT_VAL_BLE_L2CAP_COC_MPS @@ -1477,8 +1482,10 @@ #define MYNEWT_VAL_BLE_SVC_GAP_CENTRAL_ADDRESS_RESOLUTION (-1) #endif -#ifndef MYNEWT_VAL_BLE_SVC_GAP_DEVICE_NAME +#ifndef CONFIG_BT_NIMBLE_SVC_GAP_DEVICE_NAME #define MYNEWT_VAL_BLE_SVC_GAP_DEVICE_NAME "nimble" +#else +#define MYNEWT_VAL_BLE_SVC_GAP_DEVICE_NAME CONFIG_BT_NIMBLE_SVC_GAP_DEVICE_NAME #endif #ifndef MYNEWT_VAL_BLE_SVC_GAP_DEVICE_NAME_MAX_LENGTH diff --git a/examples/bluetooth/nimble/ble_l2cap_coc/coc_blecent/main/main.c b/examples/bluetooth/nimble/ble_l2cap_coc/coc_blecent/main/main.c index 1d6496d0c0..91fd3ae3c9 100644 --- a/examples/bluetooth/nimble/ble_l2cap_coc/coc_blecent/main/main.c +++ b/examples/bluetooth/nimble/ble_l2cap_coc/coc_blecent/main/main.c @@ -21,7 +21,7 @@ static uint8_t peer_addr[6]; void ble_store_config_init(void); -#if CONFIG_BT_NIMBLE_L2CAP_COC_MAX_NUM >= 1 +#if MYNEWT_VAL(BLE_L2CAP_COC_MAX_NUM) >= 1 #define COC_BUF_COUNT (3 * MYNEWT_VAL(BLE_L2CAP_COC_MAX_NUM)) #define L2CAP_COC_UUID 0x1812 @@ -137,12 +137,12 @@ blecent_l2cap_coc_mem_init(void) COC_BUF_COUNT); assert(rc == 0); } -#endif // #if CONFIG_BT_NIMBLE_L2CAP_COC_MAX_NUM >= 1 +#endif // #if MYNEWT_VAL(BLE_L2CAP_COC_MAX_NUM) >= 1 /** * Called when service discovery of the specified peer has completed. */ -#if !CONFIG_BT_NIMBLE_L2CAP_COC_MAX_NUM +#if MYNEWT_VAL(BLE_L2CAP_COC_MAX_NUM) < 1 static void blecent_on_disc_complete(const struct peer *peer, int status, void *arg) { @@ -405,7 +405,7 @@ blecent_gap_event(struct ble_gap_event *event, void *arg) print_conn_desc(&desc); MODLOG_DFLT(INFO, "\n"); -#if CONFIG_BT_NIMBLE_L2CAP_COC_MAX_NUM >= 1 +#if MYNEWT_VAL(BLE_L2CAP_COC_MAX_NUM) >= 1 conn_handle_coc = event->connect.conn_handle; disc_cb = blecent_l2cap_coc_on_disc_complete; #else @@ -514,7 +514,7 @@ app_main(void) ble_hs_cfg.sync_cb = blecent_on_sync; ble_hs_cfg.store_status_cb = ble_store_util_status_rr; -#if CONFIG_BT_NIMBLE_L2CAP_COC_MAX_NUM >= 1 +#if MYNEWT_VAL(BLE_L2CAP_COC_MAX_NUM) >= 1 blecent_l2cap_coc_mem_init(); #endif diff --git a/examples/bluetooth/nimble/ble_l2cap_coc/coc_blecent/sdkconfig.defaults b/examples/bluetooth/nimble/ble_l2cap_coc/coc_blecent/sdkconfig.defaults index 4e0bb79384..5d239dcbeb 100644 --- a/examples/bluetooth/nimble/ble_l2cap_coc/coc_blecent/sdkconfig.defaults +++ b/examples/bluetooth/nimble/ble_l2cap_coc/coc_blecent/sdkconfig.defaults @@ -10,4 +10,4 @@ CONFIG_BTDM_CTRL_MODE_BR_EDR_ONLY=n CONFIG_BTDM_CTRL_MODE_BTDM=n CONFIG_BT_BLUEDROID_ENABLED=n CONFIG_BT_NIMBLE_ENABLED=y -CONFIG_NIMBLE_L2CAP_COC_MAX_NUM=1 +CONFIG_BT_NIMBLE_L2CAP_COC_MAX_NUM=1 diff --git a/examples/bluetooth/nimble/ble_l2cap_coc/coc_bleprph/main/main.c b/examples/bluetooth/nimble/ble_l2cap_coc/coc_bleprph/main/main.c index 82682be6a7..47324976e3 100644 --- a/examples/bluetooth/nimble/ble_l2cap_coc/coc_bleprph/main/main.c +++ b/examples/bluetooth/nimble/ble_l2cap_coc/coc_bleprph/main/main.c @@ -30,7 +30,7 @@ static uint8_t own_addr_type; void ble_store_config_init(void); -#if CONFIG_BT_NIMBLE_L2CAP_COC_MAX_NUM >= 1 +#if MYNEWT_VAL(BLE_L2CAP_COC_MAX_NUM) >= 1 #define COC_BUF_COUNT (3 * MYNEWT_VAL(BLE_L2CAP_COC_MAX_NUM)) @@ -191,7 +191,7 @@ bleprph_advertise(void) } #endif -#if CONFIG_BT_NIMBLE_L2CAP_COC_MAX_NUM >= 1 +#if MYNEWT_VAL(BLE_L2CAP_COC_MAX_NUM) >= 1 static int bleprph_l2cap_coc_accept(uint16_t conn_handle, uint16_t peer_mtu, struct ble_l2cap_chan *chan) @@ -334,7 +334,7 @@ bleprph_gap_event(struct ble_gap_event *event, void *arg) rc = ble_gap_conn_find(event->connect.conn_handle, &desc); assert(rc == 0); bleprph_print_conn_desc(&desc); -#if CONFIG_BT_NIMBLE_L2CAP_COC_MAX_NUM >= 1 +#if MYNEWT_VAL(BLE_L2CAP_COC_MAX_NUM) >= 1 rc = ble_l2cap_create_server(psm, mtu, bleprph_l2cap_coc_event_cb, NULL); #endif } @@ -465,7 +465,7 @@ app_main(void) ble_hs_cfg.sm_their_key_dist = 1; #endif -#if CONFIG_BT_NIMBLE_L2CAP_COC_MAX_NUM >= 1 +#if MYNEWT_VAL(BLE_L2CAP_COC_MAX_NUM) >= 1 bleprph_l2cap_coc_mem_init(); #endif diff --git a/examples/bluetooth/nimble/ble_l2cap_coc/coc_bleprph/sdkconfig.defaults b/examples/bluetooth/nimble/ble_l2cap_coc/coc_bleprph/sdkconfig.defaults index 4e0bb79384..5d239dcbeb 100644 --- a/examples/bluetooth/nimble/ble_l2cap_coc/coc_bleprph/sdkconfig.defaults +++ b/examples/bluetooth/nimble/ble_l2cap_coc/coc_bleprph/sdkconfig.defaults @@ -10,4 +10,4 @@ CONFIG_BTDM_CTRL_MODE_BR_EDR_ONLY=n CONFIG_BTDM_CTRL_MODE_BTDM=n CONFIG_BT_BLUEDROID_ENABLED=n CONFIG_BT_NIMBLE_ENABLED=y -CONFIG_NIMBLE_L2CAP_COC_MAX_NUM=1 +CONFIG_BT_NIMBLE_L2CAP_COC_MAX_NUM=1