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:
Zhi Wei Jian
2025-04-21 17:03:27 +08:00
parent 31d8a68a0b
commit 77f5da2cb4
7 changed files with 19 additions and 6 deletions

View File

@@ -995,6 +995,14 @@ typedef struct {
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 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;
/**

View File

@@ -1598,6 +1598,7 @@ typedef struct {
BD_ADDR addr;
UINT16 skip;
UINT16 sync_timeout;
UINT8 sync_cte_type;
} tBTA_DM_BLE_Periodic_Sync_Params;
typedef struct {

View File

@@ -2486,6 +2486,9 @@ void btc_gap_ble_call_handler(btc_msg_t *msg)
params.addr_type = arg_5->periodic_adv_create_sync.params.addr_type;
params.skip = arg_5->periodic_adv_create_sync.params.skip;
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)
params.reports_disabled = arg_5->periodic_adv_create_sync.params.reports_disabled;
params.filter_duplicates = arg_5->periodic_adv_create_sync.params.filter_duplicates;

View File

@@ -860,7 +860,7 @@ tBTM_STATUS BTM_BlePeriodicAdvCreateSync(tBTM_BLE_Periodic_Sync_Params *params)
#endif // (BLE_FEAT_CREATE_SYNC_ENH == TRUE)
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");
status = BTM_ILLEGAL_VALUE;
}

View File

@@ -1642,12 +1642,12 @@ BOOLEAN btsnd_hcic_ble_create_ext_conn(tHCI_CreatExtConn *p_conn)
#if (BLE_50_EXTEND_SYNC_EN == TRUE)
BOOLEAN btsnd_hcic_ble_periodic_adv_create_sync(UINT8 option, UINT8 adv_sid,
UINT8 adv_addr_type, BD_ADDR adv_addr,
UINT16 sync_timeout, UINT8 unused)
UINT16 sync_timeout, UINT8 sync_cte_type)
{
BT_HDR *p;
UINT8 *pp;
HCI_TRACE_EVENT("%s, option = %d, adv_sid = %d, adv_addr_type = %d, sync_timeout = %d, unused = %d",
__func__, option, adv_sid, adv_addr_type, sync_timeout, unused);
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, 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]);
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);
UINT16_TO_STREAM(pp, skip);
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);
return TRUE;

View File

@@ -822,6 +822,7 @@ typedef struct {
BD_ADDR addr;
UINT16 skip;
UINT16 sync_timeout;
UINT8 sync_cte_type;
} tBTM_BLE_Periodic_Sync_Params;
typedef struct {

View File

@@ -1034,7 +1034,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,
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);