feat(bt/gap): Add new apis for bluetooth to set and get page timeout

1: add two new apis for classic bluetooth,
esp_bt_gap_set_page_timeout(page_to) and esp_bt_gap_get_page_timeout(),
which can get and set the value of page timeout.
This commit is contained in:
gongyantao
2023-08-14 21:21:24 +08:00
parent 3632aa5bd5
commit ff353beec9
17 changed files with 446 additions and 10 deletions

View File

@@ -810,6 +810,23 @@ typedef struct {
UINT8 hci_status;
} tBTM_SET_AFH_CHANNELS_RESULTS;
/* Structure returned with set page timeout event (in tBTM_CMPL_CB callback function)
** in response to BTM_WritePageTimeout call.
*/
typedef struct {
tBTM_STATUS status;
UINT8 hci_status;
} tBTM_SET_PAGE_TIMEOUT_RESULTS;
/* Structure returned with get page timeout event (in tBTM_CMPL_CB callback function)
** in response to BTM_ReadPageTimeout call.
*/
typedef struct {
tBTM_STATUS status;
UINT8 hci_status;
UINT16 page_to;
} tBTM_GET_PAGE_TIMEOUT_RESULTS;
/* Structure returned with set BLE channels event (in tBTM_CMPL_CB callback function)
** in response to BTM_BleSetChannels call.
*/
@@ -2192,7 +2209,21 @@ UINT8 BTM_SetTraceLevel (UINT8 new_level);
**
*******************************************************************************/
//extern
tBTM_STATUS BTM_WritePageTimeout(UINT16 timeout);
tBTM_STATUS BTM_WritePageTimeout(UINT16 timeout, tBTM_CMPL_CB *p_cb);
/*******************************************************************************
**
** Function BTM_ReadPageTimeout
**
** Description Send HCI Read Page Timeout.
**
** Returns
** BTM_SUCCESS Command sent.
** BTM_NO_RESOURCES If out of resources to send the command.
**
*******************************************************************************/
//extern
tBTM_STATUS BTM_ReadPageTimeout(tBTM_CMPL_CB *p_cb);
/*******************************************************************************
**

View File

@@ -166,6 +166,9 @@ typedef void (*tBTU_EVENT_CALLBACK)(BT_HDR *p_hdr);
/* BTU internal timer for QOS */
#define BTU_TTYPE_BTM_QOS 110
/* BTU internal timer for set page timeout*/
#define BTU_TTYPE_BTM_SET_PAGE_TO 111
/* BTU Task Signal */
typedef enum {
SIG_BTU_START_UP = 0,

View File

@@ -1285,6 +1285,7 @@ typedef UINT8 tHCI_STATUS;
/* Page timeout is used in LC only and LC is counting down slots not using OS */
#define HCI_DEFAULT_PAGE_TOUT 0x2000 /* 5.12 sec (in slots) */
#define HCI_MIN_PAGE_TOUT 0x0016 /* 13.75 ms (in slots) */
/* Scan enable flags */
#define HCI_NO_SCAN_ENABLED 0x00

View File

@@ -586,7 +586,7 @@ BOOLEAN btsnd_hcic_ble_set_channels (BLE_CHANNELS channels);
BOOLEAN btsnd_hcic_write_pin_type(UINT8 type); /* Write PIN Type */
BOOLEAN btsnd_hcic_write_auto_accept(UINT8 flag); /* Write Auto Accept */
BOOLEAN btsnd_hcic_read_name (void); /* Read Local Name */
BOOLEAN btsnd_hcic_write_page_tout(UINT16 timeout); /* Write Page Timout */
BOOLEAN btsnd_hcic_write_page_tout(UINT16 timeout); /* Write Page Timeout */
BOOLEAN btsnd_hcic_write_scan_enable(UINT8 flag); /* Write Scan Enable */
BOOLEAN btsnd_hcic_write_pagescan_cfg(UINT16 interval,
UINT16 window); /* Write Page Scan Activity */