mirror of
https://github.com/espressif/esp-idf.git
synced 2025-08-02 04:04:31 +02:00
feat(ble/bluedroid): Add sync_cte_type in creat_periodic_adv_sync function
(cherry picked from commit eb647d10c6
)
Co-authored-by: zhiweijian <zhiweijian@espressif.com>
This commit is contained in:
@@ -994,6 +994,14 @@ typedef struct {
|
|||||||
esp_bd_addr_t addr; /*!< Address of the periodic advertising */
|
esp_bd_addr_t addr; /*!< Address of the periodic advertising */
|
||||||
uint16_t skip; /*!< Maximum number of periodic advertising events that can be skipped */
|
uint16_t skip; /*!< Maximum number of periodic advertising events that can be skipped */
|
||||||
uint16_t sync_timeout; /*!< Synchronization timeout */
|
uint16_t sync_timeout; /*!< Synchronization timeout */
|
||||||
|
#if (CONFIG_BT_BLE_FEAT_CTE_EN)
|
||||||
|
uint8_t sync_cte_type; /*!< Whether to only synchronize to periodic advertising with certain types of CTE (Constant Tone Extension)
|
||||||
|
bit 0: Do not sync to packets with an AoA CTE
|
||||||
|
bit 1: Do not sync to packets with an AoD CTE with 1 μs slots
|
||||||
|
bit 2: Do not sync to packets with an AoD CTE with 2 μs slots
|
||||||
|
bit 3: Do not sync to packets with a type 3 CTE (currently reserved for future use)
|
||||||
|
bit 4: Do not sync to packets without a CTE */
|
||||||
|
#endif // BT_BLE_FEAT_CTE_EN
|
||||||
} esp_ble_gap_periodic_adv_sync_params_t;
|
} esp_ble_gap_periodic_adv_sync_params_t;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@@ -1592,6 +1592,7 @@ typedef struct {
|
|||||||
BD_ADDR addr;
|
BD_ADDR addr;
|
||||||
UINT16 skip;
|
UINT16 skip;
|
||||||
UINT16 sync_timeout;
|
UINT16 sync_timeout;
|
||||||
|
UINT8 sync_cte_type;
|
||||||
} tBTA_DM_BLE_Periodic_Sync_Params;
|
} tBTA_DM_BLE_Periodic_Sync_Params;
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
|
@@ -2467,6 +2467,9 @@ void btc_gap_ble_call_handler(btc_msg_t *msg)
|
|||||||
params.addr_type = arg_5->periodic_adv_create_sync.params.addr_type;
|
params.addr_type = arg_5->periodic_adv_create_sync.params.addr_type;
|
||||||
params.skip = arg_5->periodic_adv_create_sync.params.skip;
|
params.skip = arg_5->periodic_adv_create_sync.params.skip;
|
||||||
params.sync_timeout = arg_5->periodic_adv_create_sync.params.sync_timeout;
|
params.sync_timeout = arg_5->periodic_adv_create_sync.params.sync_timeout;
|
||||||
|
#if (BLE_FEAT_CTE_EN == TRUE)
|
||||||
|
params.sync_cte_type = arg_5->periodic_adv_create_sync.params.sync_cte_type;
|
||||||
|
#endif // #if (BLE_FEAT_CTE_EN == TRUE)
|
||||||
#if (BLE_FEAT_CREATE_SYNC_ENH == TRUE)
|
#if (BLE_FEAT_CREATE_SYNC_ENH == TRUE)
|
||||||
params.reports_disabled = arg_5->periodic_adv_create_sync.params.reports_disabled;
|
params.reports_disabled = arg_5->periodic_adv_create_sync.params.reports_disabled;
|
||||||
params.filter_duplicates = arg_5->periodic_adv_create_sync.params.filter_duplicates;
|
params.filter_duplicates = arg_5->periodic_adv_create_sync.params.filter_duplicates;
|
||||||
|
@@ -860,7 +860,7 @@ tBTM_STATUS BTM_BlePeriodicAdvCreateSync(tBTM_BLE_Periodic_Sync_Params *params)
|
|||||||
#endif // (BLE_FEAT_CREATE_SYNC_ENH == TRUE)
|
#endif // (BLE_FEAT_CREATE_SYNC_ENH == TRUE)
|
||||||
|
|
||||||
if (!btsnd_hcic_ble_periodic_adv_create_sync(option, params->sid, params->addr_type,
|
if (!btsnd_hcic_ble_periodic_adv_create_sync(option, params->sid, params->addr_type,
|
||||||
params->addr, params->sync_timeout, 0)) {
|
params->addr, params->sync_timeout, params->sync_cte_type)) {
|
||||||
BTM_TRACE_ERROR("LE PA CreateSync cmd failed");
|
BTM_TRACE_ERROR("LE PA CreateSync cmd failed");
|
||||||
status = BTM_ILLEGAL_VALUE;
|
status = BTM_ILLEGAL_VALUE;
|
||||||
}
|
}
|
||||||
|
@@ -1642,12 +1642,12 @@ BOOLEAN btsnd_hcic_ble_create_ext_conn(tHCI_CreatExtConn *p_conn)
|
|||||||
#if (BLE_50_EXTEND_SYNC_EN == TRUE)
|
#if (BLE_50_EXTEND_SYNC_EN == TRUE)
|
||||||
BOOLEAN btsnd_hcic_ble_periodic_adv_create_sync(UINT8 option, UINT8 adv_sid,
|
BOOLEAN btsnd_hcic_ble_periodic_adv_create_sync(UINT8 option, UINT8 adv_sid,
|
||||||
UINT8 adv_addr_type, BD_ADDR adv_addr,
|
UINT8 adv_addr_type, BD_ADDR adv_addr,
|
||||||
UINT16 sync_timeout, UINT8 unused)
|
UINT16 sync_timeout, UINT8 sync_cte_type)
|
||||||
{
|
{
|
||||||
BT_HDR *p;
|
BT_HDR *p;
|
||||||
UINT8 *pp;
|
UINT8 *pp;
|
||||||
HCI_TRACE_EVENT("%s, option = %d, adv_sid = %d, adv_addr_type = %d, sync_timeout = %d, unused = %d",
|
HCI_TRACE_EVENT("%s, option = %d, adv_sid = %d, adv_addr_type = %d, sync_timeout = %d, sync_cte_type = %d",
|
||||||
__func__, option, adv_sid, adv_addr_type, sync_timeout, unused);
|
__func__, option, adv_sid, adv_addr_type, sync_timeout, sync_cte_type);
|
||||||
|
|
||||||
HCI_TRACE_EVENT("addr %02x %02x %02x %02x %02x %02x", adv_addr[0], adv_addr[1], adv_addr[2], adv_addr[3], adv_addr[4], adv_addr[5]);
|
HCI_TRACE_EVENT("addr %02x %02x %02x %02x %02x %02x", adv_addr[0], adv_addr[1], adv_addr[2], adv_addr[3], adv_addr[4], adv_addr[5]);
|
||||||
uint16_t skip = 0;
|
uint16_t skip = 0;
|
||||||
@@ -1661,7 +1661,7 @@ BOOLEAN btsnd_hcic_ble_periodic_adv_create_sync(UINT8 option, UINT8 adv_sid,
|
|||||||
BDADDR_TO_STREAM(pp, adv_addr);
|
BDADDR_TO_STREAM(pp, adv_addr);
|
||||||
UINT16_TO_STREAM(pp, skip);
|
UINT16_TO_STREAM(pp, skip);
|
||||||
UINT16_TO_STREAM(pp, sync_timeout);
|
UINT16_TO_STREAM(pp, sync_timeout);
|
||||||
UINT8_TO_STREAM(pp, unused);
|
UINT8_TO_STREAM(pp, sync_cte_type);
|
||||||
|
|
||||||
btu_hcif_send_cmd(LOCAL_BR_EDR_CONTROLLER_ID, p);
|
btu_hcif_send_cmd(LOCAL_BR_EDR_CONTROLLER_ID, p);
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
@@ -822,6 +822,7 @@ typedef struct {
|
|||||||
BD_ADDR addr;
|
BD_ADDR addr;
|
||||||
UINT16 skip;
|
UINT16 skip;
|
||||||
UINT16 sync_timeout;
|
UINT16 sync_timeout;
|
||||||
|
UINT8 sync_cte_type;
|
||||||
} tBTM_BLE_Periodic_Sync_Params;
|
} tBTM_BLE_Periodic_Sync_Params;
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
|
@@ -1030,7 +1030,7 @@ BOOLEAN btsnd_hcic_ble_create_ext_conn(tHCI_CreatExtConn *p_conn);
|
|||||||
|
|
||||||
BOOLEAN btsnd_hcic_ble_periodic_adv_create_sync(UINT8 filter_policy, UINT8 adv_sid,
|
BOOLEAN btsnd_hcic_ble_periodic_adv_create_sync(UINT8 filter_policy, UINT8 adv_sid,
|
||||||
UINT8 adv_addr_type, BD_ADDR adv_addr,
|
UINT8 adv_addr_type, BD_ADDR adv_addr,
|
||||||
UINT16 sync_timeout, UINT8 unused);
|
UINT16 sync_timeout, UINT8 sync_cte_type);
|
||||||
|
|
||||||
UINT8 btsnd_hcic_ble_periodic_adv_create_sync_cancel(void);
|
UINT8 btsnd_hcic_ble_periodic_adv_create_sync_cancel(void);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user