Component/bt: add BLE adv report flow control

This commit is contained in:
zhiweijian
2019-03-01 21:59:55 +08:00
parent ea0a1c3030
commit d5f15a45ca
20 changed files with 213 additions and 12 deletions

View File

@@ -169,6 +169,8 @@ typedef void (tBTM_VS_EVT_CB) (UINT8 len, UINT8 *p);
*/
typedef void (tBTM_CMPL_CB) (void *p1);
typedef void (tBTM_INQ_DIS_CB) (uint32_t num_dis);
/* VSC callback function for notifying an application that a synchronous
** BTM function is complete. The pointer contains the address of any returned data.
*/
@@ -677,7 +679,6 @@ typedef struct {
UINT8 num_resp; /* Number of results from the current inquiry */
} tBTM_INQUIRY_CMPL;
/* Structure returned with remote name request */
typedef struct {
UINT16 status;

View File

@@ -1272,7 +1272,7 @@ tBTM_STATUS BTM_BleObserve(BOOLEAN start, UINT32 duration,
*******************************************************************************/
//extern
tBTM_STATUS BTM_BleScan(BOOLEAN start, UINT32 duration,
tBTM_INQ_RESULTS_CB *p_results_cb, tBTM_CMPL_CB *p_cmpl_cb);
tBTM_INQ_RESULTS_CB *p_results_cb, tBTM_CMPL_CB *p_cmpl_cb, tBTM_INQ_DIS_CB *p_discard_cb);
/*******************************************************************************

View File

@@ -376,6 +376,8 @@
#define HCI_SUBCODE_BLE_EXTENDED_SCAN_PARAMS 0x06
#define HCI_SUBCODE_BLE_LONG_ADV 0x07
#define HCI_SUBCODE_BLE_DUPLICATE_EXCEPTIONAL_LIST 0x08
#define HCI_SUBCODE_BLE_SET_ADV_FLOW_CONTROL 0x09
#define HCI_SUBCODE_BLE_ADV_REPORT_FLOW_CONTROL 0x0A
#define HCI_SUBCODE_BLE_MAX 0x7F
//ESP BT subcode define
@@ -415,6 +417,8 @@
#define HCI_VENDOR_BLE_LONG_ADV_DATA HCI_ESP_VENDOR_OPCODE_BUILD(HCI_VENDOR_OGF, HCI_ESP_GROUP_BLE, HCI_SUBCODE_BLE_LONG_ADV)
/* BLE update duplicate scan exceptional list */
#define HCI_VENDOR_BLE_UPDATE_DUPLICATE_EXCEPTIONAL_LIST HCI_ESP_VENDOR_OPCODE_BUILD(HCI_VENDOR_OGF, HCI_ESP_GROUP_BLE, HCI_SUBCODE_BLE_DUPLICATE_EXCEPTIONAL_LIST)
#define HCI_VENDOR_BLE_SET_ADV_FLOW_CONTROL HCI_ESP_VENDOR_OPCODE_BUILD(HCI_VENDOR_OGF, HCI_ESP_GROUP_BLE, HCI_SUBCODE_BLE_SET_ADV_FLOW_CONTROL)
#define HCI_VENDOR_BLE_ADV_REPORT_FLOW_CONTROL HCI_ESP_VENDOR_OPCODE_BUILD(HCI_VENDOR_OGF, HCI_ESP_GROUP_BLE, HCI_SUBCODE_BLE_ADV_REPORT_FLOW_CONTROL)
//ESP BT HCI CMD
/* subcode for multi adv feature */
@@ -749,6 +753,8 @@
#define HCI_BLE_DATA_LENGTH_CHANGE_EVT 0x07
#define HCI_BLE_ENHANCED_CONN_COMPLETE_EVT 0x0a
#define HCI_BLE_DIRECT_ADV_EVT 0x0b
/* ESP vendor BLE Event sub code */
#define HCI_BLE_ADV_DISCARD_REPORT_EVT 0XF0
/* Definitions for LE Channel Map */
#define HCI_BLE_CHNL_MAP_SIZE 5

View File

@@ -555,6 +555,10 @@ BOOLEAN btsnd_hcic_write_voice_settings(UINT16 flags); /* Write Voice
#define HCI_HOST_FLOW_CTRL_SCO_ON 2
#define HCI_HOST_FLOW_CTRL_BOTH_ON 3
#define HCI_HOST_FLOW_CTRL_ADV_REPORT_OFF 0
#define HCI_HOST_FLOW_CTRL_ADV_REPORT_ON 1
BOOLEAN btsnd_hcic_write_auto_flush_tout(UINT16 handle,
UINT16 timeout); /* Write Retransmit Timout */
@@ -806,6 +810,8 @@ BOOLEAN btsnd_hcic_read_authenticated_payload_tout(UINT16 handle);
BOOLEAN btsnd_hcic_write_authenticated_payload_tout(UINT16 handle,
UINT16 timeout);
BOOLEAN btsnd_hcic_ble_update_adv_report_flow_control (UINT16 num);
#define HCIC_PARAM_SIZE_WRITE_AUTHENT_PAYLOAD_TOUT 4
#define HCI__WRITE_AUTHENT_PAYLOAD_TOUT_HANDLE_OFF 0