diff --git a/nimble/host/include/host/ble_esp_gap.h b/nimble/host/include/host/ble_esp_gap.h index 2ac380ba5..47bcb3e0e 100644 --- a/nimble/host/include/host/ble_esp_gap.h +++ b/nimble/host/include/host/ble_esp_gap.h @@ -187,6 +187,14 @@ int ble_gap_duplicate_exception_list(uint8_t subcode, uint8_t type, uint8_t *val * @return 0 on success; nonzero on failure. */ int ble_gap_clear_legacy_adv(void); + +/** + * This API is used to let controller know which CSA to use. Not applicable for ESP32 + * + * @return 0 on success; nonzero of failure. + */ +int ble_gap_set_chan_select(uint8_t select); + #endif #ifdef __cplusplus diff --git a/nimble/host/src/ble_gap.c b/nimble/host/src/ble_gap.c index 28606f51f..1b2090d4c 100644 --- a/nimble/host/src/ble_gap.c +++ b/nimble/host/src/ble_gap.c @@ -7499,6 +7499,12 @@ int ble_gap_clear_legacy_adv(void) return ble_hs_hci_send_vs_cmd(BLE_HCI_OCF_VS_LEGACY_ADV_CLEAR, NULL, 0, NULL, 0); } + +int ble_gap_set_chan_select(uint8_t select) +{ + return ble_hs_hci_send_vs_cmd(BLE_HCI_OCF_VS_SET_CHAN_SELECT, + &select, 1, NULL, 0); +} #endif int diff --git a/nimble/include/nimble/hci_common.h b/nimble/include/nimble/hci_common.h index a64b48046..5a76a6830 100644 --- a/nimble/include/nimble/hci_common.h +++ b/nimble/include/nimble/hci_common.h @@ -1224,6 +1224,7 @@ struct ble_hci_vs_duplicate_exception_list_cp { } __attribute__((packed)); #define BLE_HCI_OCF_VS_LEGACY_ADV_CLEAR (MYNEWT_VAL(BLE_HCI_VS_OCF_OFFSET) + (0x010C)) +#define BLE_HCI_OCF_VS_SET_CHAN_SELECT (MYNEWT_VAL(BLE_HCI_VS_OCF_OFFSET) + (0x0112)) /* Command Specific Definitions */ /* --- Set controller to host flow control (OGF 0x03, OCF 0x0031) --- */