1 /****************************************************************************** 2 * Copyright (c) 2022 Telink Semiconductor (Shanghai) Co., Ltd. ("TELINK") 3 * All rights reserved. 4 * 5 * Licensed under the Apache License, Version 2.0 (the "License"); 6 * you may not use this file except in compliance with the License. 7 * You may obtain a copy of the License at 8 * 9 * http://www.apache.org/licenses/LICENSE-2.0 10 * 11 * Unless required by applicable law or agreed to in writing, software 12 * distributed under the License is distributed on an "AS IS" BASIS, 13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 * See the License for the specific language governing permissions and 15 * limitations under the License. 16 * 17 *****************************************************************************/ 18 19 #ifndef STACK_BLE_CONTROLLER_LL_PRDADV_PDA_SYNC_H_ 20 #define STACK_BLE_CONTROLLER_LL_PRDADV_PDA_SYNC_H_ 21 22 /** 23 * @brief for user to initialize periodic advertising synchronization module 24 * @param none 25 * @return none 26 */ 27 void blc_ll_initPeriodicAdvertisingSynchronization_module(void); 28 29 /** 30 * @brief this function is used to synchronize with a periodic advertising train from an advertiser and begin 31 receiving periodic advertising packets. 32 * @param[in] options - used to determine whether the Periodic Advertiser List is used and whether 33 HCI_Periodic_Advertising_Report events 34 * for this periodic advertising train are initially enabled or disabled. 35 * @param[in] adv_sid - Advertising SID subfield in the ADI field used to identify the Periodic Advertising 36 * @param[in] adv_adrType - Advertiser Address Type 37 * @param[in] *adv_addr - Advertiser Address 38 * @param[in] skip - The maximum number of periodic advertising events that can be skipped after a successful receive 39 * @param[in] sync_timeout - Synchronization timeout for the periodic advertising train 40 * @param[in] sync_cte_type - 41 * @return Status - 0x00: command succeeded; 0x01-0xFF: command failed 42 */ 43 ble_sts_t blc_ll_periodicAdvertisingCreateSync(option_msk_t options, u8 adv_sid, u8 adv_adrType, u8 *adv_addr, 44 u16 skip, sync_tm_t sync_timeout, u8 sync_cte_type); 45 46 /** 47 * @brief This function is used to cancel the periodic advertising create sync command while it is pending. 48 * @param none 49 * @return Status - 0x00: command succeeded; 0x01-0xFF: command failed 50 */ 51 ble_sts_t blc_ll_periodicAdvertisingCreateSyncCancel(void); 52 53 /** 54 * @brief This function is used to stop reception of the periodic advertising train identified 55 * by the Sync_Handle parameter. 56 * @param[in] sync_handle - Sync_Handle identifying the periodic advertising train 57 * @return Status - 0x00: command succeeded; 0x01-0xFF: command failed 58 */ 59 ble_sts_t blc_ll_periodicAdvertisingTerminateSync(u16 sync_handle); 60 61 /** 62 * @brief This function is used to add an entry, consisting of a single device address and SID, 63 * to the Periodic Advertiser list stored in the Controller. 64 * @param[in] adv_adrType - Advertiser_Address_Type 65 * @param[in] *adv_addr - Advertiser_Address 66 * @param[in] adv_sid - Advertising_SID 67 * @return Status - 0x00: command succeeded; 0x01-0xFF: command failed 68 */ 69 ble_sts_t blc_ll_addDeivceToPeriodicAdvertiserList(u8 adv_adrType, u8 *adv_addr, u8 adv_sid); 70 71 /** 72 * @brief This function is used to remove one entry from the list of Periodic Advertisers 73 * stored in the Controller. 74 * @param[in] adv_adrType - Advertiser_Address_Type 75 * @param[in] *adv_addr - Advertiser_Address 76 * @param[in] adv_sid - Advertising_SID 77 * @return Status - 0x00: command succeeded; 0x01-0xFF: command failed 78 */ 79 ble_sts_t blc_ll_removeDeivceFromPeriodicAdvertiserList(u8 adv_adrType, u8 *adv_addr, u8 adv_sid); 80 81 /** 82 * @brief This function is used to remove all entries from the list of Periodic Advertisers. 83 * @param none 84 * @return Status - 0x00: command succeeded; 0x01-0xFF: command failed 85 */ 86 ble_sts_t blc_ll_clearPeriodicAdvertiserList(void); 87 88 /** 89 * @brief This function is used to read the total number of Periodic Advertiser list entries. 90 * @param[in] none 91 * @param[out] *perdAdvListSize - point to Periodic_Advertiser_List_Size 92 * @return Status - 0x00: command succeeded; 0x01-0xFF: command failed 93 */ 94 ble_sts_t blc_ll_readPeriodicAdvertiserListSize(u8 *perdAdvListSize); 95 96 ble_sts_t blc_hci_le_periodic_advertising_create_sync(hci_le_periodicAdvCreateSync_cmdParam_t *cmdPara); 97 98 #endif /* STACK_BLE_CONTROLLER_LL_PRDADV_PDA_SYNC_H_ */ 99