mirror of
https://github.com/espressif/esp-idf.git
synced 2025-07-30 10:47:19 +02:00
Merge branch 'bugfix/add_ci_files' into 'master'
fix(nimble): Add CI files for base configurations Closes BLERP-1896 See merge request espressif/esp-idf!37954
This commit is contained in:
Submodule components/bt/host/nimble/nimble updated: 544e94303c...bcb5345e25
@ -709,7 +709,9 @@ static void blecent_power_control(uint16_t conn_handle)
|
|||||||
static int
|
static int
|
||||||
blecent_gap_event(struct ble_gap_event *event, void *arg)
|
blecent_gap_event(struct ble_gap_event *event, void *arg)
|
||||||
{
|
{
|
||||||
|
#if NIMBLE_BLE_CONNECT
|
||||||
struct ble_gap_conn_desc desc;
|
struct ble_gap_conn_desc desc;
|
||||||
|
#endif
|
||||||
struct ble_hs_adv_fields fields;
|
struct ble_hs_adv_fields fields;
|
||||||
#if MYNEWT_VAL(BLE_HCI_VS)
|
#if MYNEWT_VAL(BLE_HCI_VS)
|
||||||
#if MYNEWT_VAL(BLE_POWER_CONTROL)
|
#if MYNEWT_VAL(BLE_POWER_CONTROL)
|
||||||
@ -732,7 +734,7 @@ blecent_gap_event(struct ble_gap_event *event, void *arg)
|
|||||||
/* Try to connect to the advertiser if it looks interesting. */
|
/* Try to connect to the advertiser if it looks interesting. */
|
||||||
blecent_connect_if_interesting(&event->disc);
|
blecent_connect_if_interesting(&event->disc);
|
||||||
return 0;
|
return 0;
|
||||||
|
#if NIMBLE_BLE_CONNECT
|
||||||
case BLE_GAP_EVENT_CONNECT:
|
case BLE_GAP_EVENT_CONNECT:
|
||||||
/* A new connection was established or a connection attempt failed. */
|
/* A new connection was established or a connection attempt failed. */
|
||||||
if (event->connect.status == 0) {
|
if (event->connect.status == 0) {
|
||||||
@ -966,6 +968,8 @@ blecent_gap_event(struct ble_gap_event *event, void *arg)
|
|||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
|
#endif
|
||||||
default:
|
default:
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@ -1041,7 +1045,6 @@ static void stack_init_deinit(void)
|
|||||||
void
|
void
|
||||||
app_main(void)
|
app_main(void)
|
||||||
{
|
{
|
||||||
int rc;
|
|
||||||
/* Initialize NVS — it is used to store PHY calibration data */
|
/* Initialize NVS — it is used to store PHY calibration data */
|
||||||
esp_err_t ret = nvs_flash_init();
|
esp_err_t ret = nvs_flash_init();
|
||||||
if (ret == ESP_ERR_NVS_NO_FREE_PAGES || ret == ESP_ERR_NVS_NEW_VERSION_FOUND) {
|
if (ret == ESP_ERR_NVS_NO_FREE_PAGES || ret == ESP_ERR_NVS_NEW_VERSION_FOUND) {
|
||||||
@ -1061,6 +1064,8 @@ app_main(void)
|
|||||||
ble_hs_cfg.sync_cb = blecent_on_sync;
|
ble_hs_cfg.sync_cb = blecent_on_sync;
|
||||||
ble_hs_cfg.store_status_cb = ble_store_util_status_rr;
|
ble_hs_cfg.store_status_cb = ble_store_util_status_rr;
|
||||||
|
|
||||||
|
#if NIMBLE_BLE_CONNECT
|
||||||
|
int rc;
|
||||||
/* Initialize data structures to track connected peers. */
|
/* Initialize data structures to track connected peers. */
|
||||||
#if MYNEWT_VAL(BLE_INCL_SVC_DISCOVERY) || MYNEWT_VAL(BLE_GATT_CACHING_INCLUDE_SERVICES)
|
#if MYNEWT_VAL(BLE_INCL_SVC_DISCOVERY) || MYNEWT_VAL(BLE_GATT_CACHING_INCLUDE_SERVICES)
|
||||||
rc = peer_init(MYNEWT_VAL(BLE_MAX_CONNECTIONS), 64, 64, 64, 64);
|
rc = peer_init(MYNEWT_VAL(BLE_MAX_CONNECTIONS), 64, 64, 64, 64);
|
||||||
@ -1069,11 +1074,13 @@ app_main(void)
|
|||||||
rc = peer_init(MYNEWT_VAL(BLE_MAX_CONNECTIONS), 64, 64, 64);
|
rc = peer_init(MYNEWT_VAL(BLE_MAX_CONNECTIONS), 64, 64, 64);
|
||||||
assert(rc == 0);
|
assert(rc == 0);
|
||||||
#endif
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
#if CONFIG_BT_NIMBLE_GAP_SERVICE
|
#if CONFIG_BT_NIMBLE_GAP_SERVICE
|
||||||
|
int m;
|
||||||
/* Set the default device name. */
|
/* Set the default device name. */
|
||||||
rc = ble_svc_gap_device_name_set("nimble-blecent");
|
m = ble_svc_gap_device_name_set("nimble-blecent");
|
||||||
assert(rc == 0);
|
assert(m == 0);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* XXX Need to have template for store */
|
/* XXX Need to have template for store */
|
||||||
|
10
examples/bluetooth/nimble/blecent/sdkconfig.ci.central
Normal file
10
examples/bluetooth/nimble/blecent/sdkconfig.ci.central
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
CONFIG_BT_ENABLED=y
|
||||||
|
CONFIG_BTDM_CTRL_MODE_BLE_ONLY=y
|
||||||
|
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_BT_NIMBLE_ROLE_CENTRAL=y
|
||||||
|
CONFIG_BT_NIMBLE_ROLE_BROADCASTER=n
|
||||||
|
CONFIG_BT_NIMBLE_ROLE_OBSERVER=n
|
||||||
|
CONFIG_BT_NIMBLE_ROLE_PERIPHERAL=n
|
@ -0,0 +1,10 @@
|
|||||||
|
CONFIG_BT_ENABLED=y
|
||||||
|
CONFIG_BTDM_CTRL_MODE_BLE_ONLY=y
|
||||||
|
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_BT_NIMBLE_ROLE_CENTRAL=y
|
||||||
|
CONFIG_BT_NIMBLE_ROLE_BROADCASTER=n
|
||||||
|
CONFIG_BT_NIMBLE_ROLE_OBSERVER=y
|
||||||
|
CONFIG_BT_NIMBLE_ROLE_PERIPHERAL=y
|
10
examples/bluetooth/nimble/blecent/sdkconfig.ci.no_peripheral
Normal file
10
examples/bluetooth/nimble/blecent/sdkconfig.ci.no_peripheral
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
CONFIG_BT_ENABLED=y
|
||||||
|
CONFIG_BTDM_CTRL_MODE_BLE_ONLY=y
|
||||||
|
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_BT_NIMBLE_ROLE_CENTRAL=y
|
||||||
|
CONFIG_BT_NIMBLE_ROLE_BROADCASTER=y
|
||||||
|
CONFIG_BT_NIMBLE_ROLE_OBSERVER=y
|
||||||
|
CONFIG_BT_NIMBLE_ROLE_PERIPHERAL=n
|
11
examples/bluetooth/nimble/blecent/sdkconfig.ci.observer
Normal file
11
examples/bluetooth/nimble/blecent/sdkconfig.ci.observer
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
CONFIG_BT_ENABLED=y
|
||||||
|
CONFIG_BTDM_CTRL_MODE_BLE_ONLY=y
|
||||||
|
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_BT_NIMBLE_ROLE_CENTRAL=n
|
||||||
|
CONFIG_BT_NIMBLE_ROLE_BROADCASTER=n
|
||||||
|
CONFIG_BT_NIMBLE_ROLE_OBSERVER=y
|
||||||
|
CONFIG_BT_NIMBLE_ROLE_PERIPHERAL=n
|
||||||
|
CONFIG_BT_NIMBLE_SECURITY_ENABLE=n
|
@ -52,6 +52,7 @@ static uint16_t bearers;
|
|||||||
|
|
||||||
void ble_store_config_init(void);
|
void ble_store_config_init(void);
|
||||||
|
|
||||||
|
#if NIMBLE_BLE_CONNECT
|
||||||
/**
|
/**
|
||||||
* Logs information about a connection to the console.
|
* Logs information about a connection to the console.
|
||||||
*/
|
*/
|
||||||
@ -78,6 +79,7 @@ bleprph_print_conn_desc(struct ble_gap_conn_desc *desc)
|
|||||||
desc->sec_state.authenticated,
|
desc->sec_state.authenticated,
|
||||||
desc->sec_state.bonded);
|
desc->sec_state.bonded);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
#if CONFIG_EXAMPLE_EXTENDED_ADV
|
#if CONFIG_EXAMPLE_EXTENDED_ADV
|
||||||
/**
|
/**
|
||||||
@ -148,7 +150,9 @@ bleprph_advertise(void)
|
|||||||
{
|
{
|
||||||
struct ble_gap_adv_params adv_params;
|
struct ble_gap_adv_params adv_params;
|
||||||
struct ble_hs_adv_fields fields;
|
struct ble_hs_adv_fields fields;
|
||||||
|
#if CONFIG_BT_NIMBLE_GAP_SERVICE
|
||||||
const char *name;
|
const char *name;
|
||||||
|
#endif
|
||||||
int rc;
|
int rc;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -175,10 +179,12 @@ bleprph_advertise(void)
|
|||||||
fields.tx_pwr_lvl_is_present = 1;
|
fields.tx_pwr_lvl_is_present = 1;
|
||||||
fields.tx_pwr_lvl = BLE_HS_ADV_TX_PWR_LVL_AUTO;
|
fields.tx_pwr_lvl = BLE_HS_ADV_TX_PWR_LVL_AUTO;
|
||||||
|
|
||||||
|
#if CONFIG_BT_NIMBLE_GAP_SERVICE
|
||||||
name = ble_svc_gap_device_name();
|
name = ble_svc_gap_device_name();
|
||||||
fields.name = (uint8_t *)name;
|
fields.name = (uint8_t *)name;
|
||||||
fields.name_len = strlen(name);
|
fields.name_len = strlen(name);
|
||||||
fields.name_is_complete = 1;
|
fields.name_is_complete = 1;
|
||||||
|
#endif
|
||||||
|
|
||||||
fields.uuids16 = (ble_uuid16_t[]) {
|
fields.uuids16 = (ble_uuid16_t[]) {
|
||||||
BLE_UUID16_INIT(GATT_SVR_SVC_ALERT_UUID)
|
BLE_UUID16_INIT(GATT_SVR_SVC_ALERT_UUID)
|
||||||
@ -236,10 +242,14 @@ static void bleprph_power_control(uint16_t conn_handle)
|
|||||||
static int
|
static int
|
||||||
bleprph_gap_event(struct ble_gap_event *event, void *arg)
|
bleprph_gap_event(struct ble_gap_event *event, void *arg)
|
||||||
{
|
{
|
||||||
|
#if NIMBLE_BLE_CONNECT
|
||||||
struct ble_gap_conn_desc desc;
|
struct ble_gap_conn_desc desc;
|
||||||
int rc;
|
int rc;
|
||||||
|
#endif
|
||||||
|
|
||||||
switch (event->type) {
|
switch (event->type) {
|
||||||
|
|
||||||
|
#if NIMBLE_BLE_CONNECT
|
||||||
case BLE_GAP_EVENT_CONNECT:
|
case BLE_GAP_EVENT_CONNECT:
|
||||||
/* A new connection was established or a connection attempt failed. */
|
/* A new connection was established or a connection attempt failed. */
|
||||||
MODLOG_DFLT(INFO, "connection %s; status=%d ",
|
MODLOG_DFLT(INFO, "connection %s; status=%d ",
|
||||||
@ -463,9 +473,9 @@ bleprph_gap_event(struct ble_gap_event *event, void *arg)
|
|||||||
event->subrate_change.status,
|
event->subrate_change.status,
|
||||||
event->subrate_change.subrate_factor);
|
event->subrate_change.subrate_factor);
|
||||||
return 0;
|
return 0;
|
||||||
|
#endif
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -594,9 +604,11 @@ app_main(void)
|
|||||||
assert(rc == 0);
|
assert(rc == 0);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if CONFIG_BT_NIMBLE_GAP_SERVICE
|
||||||
/* Set the default device name. */
|
/* Set the default device name. */
|
||||||
rc = ble_svc_gap_device_name_set("nimble-bleprph");
|
rc = ble_svc_gap_device_name_set("nimble-bleprph");
|
||||||
assert(rc == 0);
|
assert(rc == 0);
|
||||||
|
#endif
|
||||||
|
|
||||||
/* XXX Need to have template for store */
|
/* XXX Need to have template for store */
|
||||||
ble_store_config_init();
|
ble_store_config_init();
|
||||||
|
11
examples/bluetooth/nimble/bleprph/sdkconfig.ci.broadcaster
Normal file
11
examples/bluetooth/nimble/bleprph/sdkconfig.ci.broadcaster
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
CONFIG_BT_ENABLED=y
|
||||||
|
CONFIG_BTDM_CTRL_MODE_BLE_ONLY=y
|
||||||
|
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_BT_NIMBLE_ROLE_CENTRAL=n
|
||||||
|
CONFIG_BT_NIMBLE_ROLE_BROADCASTER=y
|
||||||
|
CONFIG_BT_NIMBLE_ROLE_OBSERVER=n
|
||||||
|
CONFIG_BT_NIMBLE_ROLE_PERIPHERAL=n
|
||||||
|
CONFIG_BT_NIMBLE_SECURITY_ENABLE=n
|
10
examples/bluetooth/nimble/bleprph/sdkconfig.ci.no_central
Normal file
10
examples/bluetooth/nimble/bleprph/sdkconfig.ci.no_central
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
CONFIG_BT_ENABLED=y
|
||||||
|
CONFIG_BTDM_CTRL_MODE_BLE_ONLY=y
|
||||||
|
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_BT_NIMBLE_ROLE_CENTRAL=n
|
||||||
|
CONFIG_BT_NIMBLE_ROLE_BROADCASTER=y
|
||||||
|
CONFIG_BT_NIMBLE_ROLE_OBSERVER=y
|
||||||
|
CONFIG_BT_NIMBLE_ROLE_PERIPHERAL=y
|
10
examples/bluetooth/nimble/bleprph/sdkconfig.ci.no_observer
Normal file
10
examples/bluetooth/nimble/bleprph/sdkconfig.ci.no_observer
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
CONFIG_BT_ENABLED=y
|
||||||
|
CONFIG_BTDM_CTRL_MODE_BLE_ONLY=y
|
||||||
|
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_BT_NIMBLE_ROLE_CENTRAL=y
|
||||||
|
CONFIG_BT_NIMBLE_ROLE_BROADCASTER=y
|
||||||
|
CONFIG_BT_NIMBLE_ROLE_OBSERVER=n
|
||||||
|
CONFIG_BT_NIMBLE_ROLE_PERIPHERAL=y
|
10
examples/bluetooth/nimble/bleprph/sdkconfig.ci.peripheral
Normal file
10
examples/bluetooth/nimble/bleprph/sdkconfig.ci.peripheral
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
CONFIG_BT_ENABLED=y
|
||||||
|
CONFIG_BTDM_CTRL_MODE_BLE_ONLY=y
|
||||||
|
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_BT_NIMBLE_ROLE_CENTRAL=n
|
||||||
|
CONFIG_BT_NIMBLE_ROLE_BROADCASTER=n
|
||||||
|
CONFIG_BT_NIMBLE_ROLE_OBSERVER=n
|
||||||
|
CONFIG_BT_NIMBLE_ROLE_PERIPHERAL=y
|
@ -9,6 +9,7 @@
|
|||||||
#include "host/ble_hs.h"
|
#include "host/ble_hs.h"
|
||||||
#include "esp_central.h"
|
#include "esp_central.h"
|
||||||
|
|
||||||
|
#if NIMBLE_BLE_CONNECT
|
||||||
static void *peer_svc_mem;
|
static void *peer_svc_mem;
|
||||||
static struct os_mempool peer_svc_pool;
|
static struct os_mempool peer_svc_pool;
|
||||||
|
|
||||||
@ -1089,3 +1090,4 @@ err:
|
|||||||
peer_free_mem();
|
peer_free_mem();
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
Reference in New Issue
Block a user