Skip to content

Commit eb647d1

Browse files
feat(ble/bluedroid): Add sync_cte_type in creat_periodic_adv_sync function
1 parent cf6135c commit eb647d1

File tree

7 files changed

+19
-6
lines changed

7 files changed

+19
-6
lines changed

components/bt/host/bluedroid/api/include/api/esp_gap_ble_api.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -995,6 +995,14 @@ typedef struct {
995995
esp_bd_addr_t addr; /*!< Address of the periodic advertising */
996996
uint16_t skip; /*!< Maximum number of periodic advertising events that can be skipped */
997997
uint16_t sync_timeout; /*!< Synchronization timeout */
998+
#if (CONFIG_BT_BLE_FEAT_CTE_EN)
999+
uint8_t sync_cte_type; /*!< Whether to only synchronize to periodic advertising with certain types of CTE (Constant Tone Extension)
1000+
bit 0: Do not sync to packets with an AoA CTE
1001+
bit 1: Do not sync to packets with an AoD CTE with 1 μs slots
1002+
bit 2: Do not sync to packets with an AoD CTE with 2 μs slots
1003+
bit 3: Do not sync to packets with a type 3 CTE (currently reserved for future use)
1004+
bit 4: Do not sync to packets without a CTE */
1005+
#endif // BT_BLE_FEAT_CTE_EN
9981006
} esp_ble_gap_periodic_adv_sync_params_t;
9991007

10001008
/**

components/bt/host/bluedroid/bta/include/bta/bta_api.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1598,6 +1598,7 @@ typedef struct {
15981598
BD_ADDR addr;
15991599
UINT16 skip;
16001600
UINT16 sync_timeout;
1601+
UINT8 sync_cte_type;
16011602
} tBTA_DM_BLE_Periodic_Sync_Params;
16021603

16031604
typedef struct {

components/bt/host/bluedroid/btc/profile/std/gap/btc_gap_ble.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2493,6 +2493,9 @@ void btc_gap_ble_call_handler(btc_msg_t *msg)
24932493
params.addr_type = arg_5->periodic_adv_create_sync.params.addr_type;
24942494
params.skip = arg_5->periodic_adv_create_sync.params.skip;
24952495
params.sync_timeout = arg_5->periodic_adv_create_sync.params.sync_timeout;
2496+
#if (BLE_FEAT_CTE_EN == TRUE)
2497+
params.sync_cte_type = arg_5->periodic_adv_create_sync.params.sync_cte_type;
2498+
#endif // #if (BLE_FEAT_CTE_EN == TRUE)
24962499
#if (BLE_FEAT_CREATE_SYNC_ENH == TRUE)
24972500
params.reports_disabled = arg_5->periodic_adv_create_sync.params.reports_disabled;
24982501
params.filter_duplicates = arg_5->periodic_adv_create_sync.params.filter_duplicates;

components/bt/host/bluedroid/stack/btm/btm_ble_5_gap.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -860,7 +860,7 @@ tBTM_STATUS BTM_BlePeriodicAdvCreateSync(tBTM_BLE_Periodic_Sync_Params *params)
860860
#endif // (BLE_FEAT_CREATE_SYNC_ENH == TRUE)
861861

862862
if (!btsnd_hcic_ble_periodic_adv_create_sync(option, params->sid, params->addr_type,
863-
params->addr, params->sync_timeout, 0)) {
863+
params->addr, params->sync_timeout, params->sync_cte_type)) {
864864
BTM_TRACE_ERROR("LE PA CreateSync cmd failed");
865865
status = BTM_ILLEGAL_VALUE;
866866
}

components/bt/host/bluedroid/stack/hcic/hciblecmds.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1642,12 +1642,12 @@ BOOLEAN btsnd_hcic_ble_create_ext_conn(tHCI_CreatExtConn *p_conn)
16421642
#if (BLE_50_EXTEND_SYNC_EN == TRUE)
16431643
BOOLEAN btsnd_hcic_ble_periodic_adv_create_sync(UINT8 option, UINT8 adv_sid,
16441644
UINT8 adv_addr_type, BD_ADDR adv_addr,
1645-
UINT16 sync_timeout, UINT8 unused)
1645+
UINT16 sync_timeout, UINT8 sync_cte_type)
16461646
{
16471647
BT_HDR *p;
16481648
UINT8 *pp;
1649-
HCI_TRACE_EVENT("%s, option = %d, adv_sid = %d, adv_addr_type = %d, sync_timeout = %d, unused = %d",
1650-
__func__, option, adv_sid, adv_addr_type, sync_timeout, unused);
1649+
HCI_TRACE_EVENT("%s, option = %d, adv_sid = %d, adv_addr_type = %d, sync_timeout = %d, sync_cte_type = %d",
1650+
__func__, option, adv_sid, adv_addr_type, sync_timeout, sync_cte_type);
16511651

16521652
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]);
16531653
uint16_t skip = 0;
@@ -1661,7 +1661,7 @@ BOOLEAN btsnd_hcic_ble_periodic_adv_create_sync(UINT8 option, UINT8 adv_sid,
16611661
BDADDR_TO_STREAM(pp, adv_addr);
16621662
UINT16_TO_STREAM(pp, skip);
16631663
UINT16_TO_STREAM(pp, sync_timeout);
1664-
UINT8_TO_STREAM(pp, unused);
1664+
UINT8_TO_STREAM(pp, sync_cte_type);
16651665

16661666
btu_hcif_send_cmd(LOCAL_BR_EDR_CONTROLLER_ID, p);
16671667
return TRUE;

components/bt/host/bluedroid/stack/include/stack/btm_ble_api.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -822,6 +822,7 @@ typedef struct {
822822
BD_ADDR addr;
823823
UINT16 skip;
824824
UINT16 sync_timeout;
825+
UINT8 sync_cte_type;
825826
} tBTM_BLE_Periodic_Sync_Params;
826827

827828
typedef struct {

components/bt/host/bluedroid/stack/include/stack/hcimsgs.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1034,7 +1034,7 @@ BOOLEAN btsnd_hcic_ble_create_ext_conn(tHCI_CreatExtConn *p_conn);
10341034

10351035
BOOLEAN btsnd_hcic_ble_periodic_adv_create_sync(UINT8 filter_policy, UINT8 adv_sid,
10361036
UINT8 adv_addr_type, BD_ADDR adv_addr,
1037-
UINT16 sync_timeout, UINT8 unused);
1037+
UINT16 sync_timeout, UINT8 sync_cte_type);
10381038

10391039
UINT8 btsnd_hcic_ble_periodic_adv_create_sync_cancel(void);
10401040

0 commit comments

Comments
 (0)