Skip to content

Commit

Permalink
Merge branch 'feature/LE_Conn_Subrating' into 'master'
Browse files Browse the repository at this point in the history
Nimble: Stack support for Connection subrating

See merge request espressif/esp-idf!20377
  • Loading branch information
rahult-github committed Oct 26, 2022
2 parents 554f3bd + 5a08ba1 commit a6251da
Show file tree
Hide file tree
Showing 4 changed files with 60 additions and 1 deletion.
13 changes: 13 additions & 0 deletions components/bt/host/nimble/Kconfig.in
Expand Up @@ -585,6 +585,19 @@ config BT_NIMBLE_MAX_PERIODIC_ADVERTISER_LIST
help
Set this option to set the upper limit for number of periodic advertiser list.

menuconfig BT_NIMBLE_53_FEATURE_SUPPORT
bool "Enable BLE 5.3 feature"
depends on BT_NIMBLE_ENABLED && SOC_ESP_NIMBLE_CONTROLLER
help
Enable BLE 5.3 feature

config BT_NIMBLE_SUBRATE
bool "Connection Subrate"
depends on BT_NIMBLE_53_FEATURE_SUPPORT
help
Enable support for Connection Subrate


choice BT_NIMBLE_COEX_PHY_CODED_TX_RX_TLIM
prompt "Coexistence: limit on MAX Tx/Rx time for coded-PHY connection"
default BT_NIMBLE_COEX_PHY_CODED_TX_RX_TLIM_DIS
Expand Down
13 changes: 13 additions & 0 deletions components/bt/host/nimble/port/include/esp_nimble_cfg.h
Expand Up @@ -160,6 +160,19 @@
#ifndef MYNEWT_VAL_BLE_WHITELIST
#define MYNEWT_VAL_BLE_WHITELIST (1)
#endif

#ifndef CONFIG_BT_NIMBLE_53_FEATURE_SUPPORT
#define BLE_53_FEATURE_SUPPORT (0)
#else
#define BLE_53_FEATURE_SUPPORT (CONFIG_BT_NIMBLE_53_FEATURE_SUPPORT)
#endif

#ifndef CONFIG_BT_NIMBLE_SUBRATE
#define MYNEWT_VAL_BLE_CONN_SUBRATING (0)
#else
#define MYNEWT_VAL_BLE_CONN_SUBRATING (CONFIG_BT_NIMBLE_SUBRATE)
#endif

/*** @apache-mynewt-nimble/nimble/controller */
/*** @apache-mynewt-nimble/nimble/controller */
#ifndef MYNEWT_VAL_BLE_CONTROLLER
Expand Down
33 changes: 33 additions & 0 deletions components/bt/porting/nimble/include/nimble/hci_common.h
Expand Up @@ -1068,6 +1068,25 @@ struct ble_hci_le_set_host_feat_cp {
uint8_t val;
} __attribute__((packed));

#define BLE_HCI_OCF_LE_SET_DEFAULT_SUBRATE (0x007D)
struct ble_hci_le_set_default_subrate_cp {
uint16_t subrate_min;
uint16_t subrate_max;
uint16_t max_latency;
uint16_t cont_num;
uint16_t supervision_tmo;
} __attribute__((packed));

#define BLE_HCI_OCF_LE_SUBRATE_REQ (0x007E)
struct ble_hci_le_subrate_req_cp {
uint16_t conn_handle;
uint16_t subrate_min;
uint16_t subrate_max;
uint16_t max_latency;
uint16_t cont_num;
uint16_t supervision_tmo;
} __attribute__((packed));

/* --- Vendor specific commands (OGF 0x00FF) */
#define BLE_HCI_OCF_VS_RD_STATIC_ADDR (0x0001)
struct ble_hci_vs_rd_static_addr_rp {
Expand Down Expand Up @@ -1797,6 +1816,18 @@ struct ble_hci_ev_le_subev_biginfo_adv_report {
uint8_t encryption;
} __attribute__((packed));

#define BLE_HCI_LE_SUBEV_SUBRATE_CHANGE (0x23)
struct ble_hci_ev_le_subev_subrate_change {
uint8_t subev_code;
uint8_t status;
uint16_t conn_handle;
uint16_t subrate_factor;
uint16_t periph_latency;
uint16_t cont_num;
uint16_t supervision_tmo;
} __attribute__((packed));


/* Data buffer overflow event */
#define BLE_HCI_EVENT_ACL_BUF_OVERFLOW (0x01)

Expand Down Expand Up @@ -1839,6 +1870,7 @@ struct ble_hci_ev_le_subev_biginfo_adv_report {
#define BLE_HCI_VER_BCS_5_0 (9)
#define BLE_HCI_VER_BCS_5_1 (10)
#define BLE_HCI_VER_BCS_5_2 (11)
#define BLE_HCI_VER_BCS_5_3 (12)

#define BLE_LMP_VER_BCS_1_0b (0)
#define BLE_LMP_VER_BCS_1_1 (1)
Expand All @@ -1852,6 +1884,7 @@ struct ble_hci_ev_le_subev_biginfo_adv_report {
#define BLE_LMP_VER_BCS_5_0 (9)
#define BLE_LMP_VER_BCS_5_1 (10)
#define BLE_LMP_VER_BCS_5_2 (11)
#define BLE_LMP_VER_BCS_5_3 (12)

/* selected HCI and LMP version */
#if MYNEWT_VAL(BLE_VERSION) == 50
Expand Down

0 comments on commit a6251da

Please sign in to comment.