mirror of
https://github.com/espressif/esp-idf.git
synced 2025-08-22 17:10:28 +00:00
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:
@@ -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);
|
||||
|
||||
/*******************************************************************************
|
||||
**
|
||||
|
@@ -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,
|
||||
|
@@ -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
|
||||
|
@@ -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 */
|
||||
|
Reference in New Issue
Block a user