fix(ble/bluedroid): fixed bluedroid host DTM API

This commit is contained in:
zhiweijian 2023-10-07 12:17:56 +08:00
parent fc5bd26340
commit eefcec929e
2 changed files with 19 additions and 19 deletions

View File

@ -875,7 +875,7 @@ esp_err_t esp_ble_dtm_rx_start(const esp_ble_dtm_rx_t *rx_params)
msg.pid = BTC_PID_GAP_BLE;
msg.act = BTC_GAP_BLE_DTM_RX_START;
memcpy(&arg.dtm_rx_start, rx_params, sizeof(esp_ble_dtm_rx_t));
memcpy(&arg.dtm_rx_start, rx_params, sizeof(esp_ble_dtm_rx_t));
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_gap_args_t), NULL, NULL) == BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
}
@ -885,7 +885,7 @@ esp_err_t esp_ble_dtm_rx_start(const esp_ble_dtm_rx_t *rx_params)
esp_err_t esp_ble_dtm_enh_tx_start(const esp_ble_dtm_enh_tx_t *tx_params)
{
btc_msg_t msg = {0};
btc_ble_gap_args_t arg;
btc_ble_5_gap_args_t arg;
if (!tx_params) {
return ESP_ERR_INVALID_ARG;
@ -897,15 +897,15 @@ esp_err_t esp_ble_dtm_enh_tx_start(const esp_ble_dtm_enh_tx_t *tx_params)
msg.pid = BTC_PID_GAP_BLE;
msg.act = BTC_GAP_BLE_DTM_ENH_TX_START;
memcpy(&arg.dtm_tx_start, tx_params, sizeof(esp_ble_dtm_enh_tx_t));
memcpy(&arg.dtm_enh_tx_start, tx_params, sizeof(esp_ble_dtm_enh_tx_t));
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_gap_args_t), NULL, NULL) == BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_5_gap_args_t), NULL, NULL) == BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
}
esp_err_t esp_ble_dtm_enh_rx_start(const esp_ble_dtm_enh_rx_t *rx_params)
{
btc_msg_t msg = {0};
btc_ble_gap_args_t arg;
btc_ble_5_gap_args_t arg;
if (!rx_params) {
return ESP_ERR_INVALID_ARG;
@ -917,9 +917,9 @@ esp_err_t esp_ble_dtm_enh_rx_start(const esp_ble_dtm_enh_rx_t *rx_params)
msg.pid = BTC_PID_GAP_BLE;
msg.act = BTC_GAP_BLE_DTM_ENH_RX_START;
memcpy(&arg.dtm_rx_start, rx_params, sizeof(esp_ble_dtm_enh_rx_t));
memcpy(&arg.dtm_enh_rx_start, rx_params, sizeof(esp_ble_dtm_enh_rx_t));
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_gap_args_t), NULL, NULL) == BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_5_gap_args_t), NULL, NULL) == BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
}
#endif // #if (BLE_50_FEATURE_SUPPORT == TRUE)

View File

@ -125,6 +125,18 @@ typedef uint8_t esp_ble_auth_req_t; /*!< combination of the above bit
typedef uint8_t esp_ble_io_cap_t; /*!< combination of the io capability */
#define BLE_DTM_PKT_PAYLOAD_0x00 0x00 /*!< PRBS9 sequence 11111111100000111101... (in transmission order) as described in [Vol 6] Part F, Section 4.1.5 */
#define BLE_DTM_PKT_PAYLOAD_0x01 0x01 /*!< Repeated 11110000 (in transmission order) sequence as described in [Vol 6] Part F, Section 4.1.5 */
#define BLE_DTM_PKT_PAYLOAD_0x02 0x02 /*!< Repeated 10101010 (in transmission order) sequence as described in [Vol 6] Part F, Section 4.1.5 */
#define BLE_DTM_PKT_PAYLOAD_0x03 0x03 /*!< PRBS15 sequence as described in [Vol 6] Part F, Section 4.1.5 */
#define BLE_DTM_PKT_PAYLOAD_0x04 0x04 /*!< Repeated 11111111 (in transmission order) sequence */
#define BLE_DTM_PKT_PAYLOAD_0x05 0x05 /*!< Repeated 00000000 (in transmission order) sequence */
#define BLE_DTM_PKT_PAYLOAD_0x06 0x06 /*!< Repeated 00001111 (in transmission order) sequence */
#define BLE_DTM_PKT_PAYLOAD_0x07 0x07 /*!< Repeated 01010101 (in transmission order) sequence */
#define BLE_DTM_PKT_PAYLOAD_MAX 0x08 /*!< 0x08 ~ 0xFF, Reserved for future use */
typedef uint8_t esp_ble_dtm_pkt_payload_t;
/// GAP BLE callback event type
typedef enum {
//BLE_42_FEATURE_SUPPORT
@ -352,18 +364,6 @@ typedef enum {
DTM_TEST_STOP_EVT,
} esp_ble_dtm_update_evt_t;
typedef enum {
BLE_DTM_PKT_PAYLOAD_0x00, /*!< PRBS9 sequence 11111111100000111101... (in transmission order) as described in [Vol 6] Part F, Section 4.1.5 */
BLE_DTM_PKT_PAYLOAD_0x01, /*!< Repeated 11110000 (in transmission order) sequence as described in [Vol 6] Part F, Section 4.1.5 */
BLE_DTM_PKT_PAYLOAD_0x02, /*!< Repeated 10101010 (in transmission order) sequence as described in [Vol 6] Part F, Section 4.1.5 */
BLE_DTM_PKT_PAYLOAD_0x03, /*!< PRBS15 sequence as described in [Vol 6] Part F, Section 4.1.5 */
BLE_DTM_PKT_PAYLOAD_0x04, /*!< Repeated 11111111 (in transmission order) sequence */
BLE_DTM_PKT_PAYLOAD_0x05, /*!< Repeated 00000000 (in transmission order) sequence */
BLE_DTM_PKT_PAYLOAD_0x06, /*!< Repeated 00001111 (in transmission order) sequence */
BLE_DTM_PKT_PAYLOAD_0x07, /*!< Repeated 01010101 (in transmission order) sequence */
BLE_DTM_PKT_PAYLOAD_MAX, /*!< 0x08 ~ 0xFF, Reserved for future use */
} esp_ble_dtm_pkt_payload_t;
#if (BLE_42_FEATURE_SUPPORT == TRUE)
/**
* @brief DTM TX parameters