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 #ifndef LL_SCAN_EXT_H_
19 #define LL_SCAN_EXT_H_
20 
21 #include "stack/ble/hci/hci_cmd.h"
22 
23 
24 
25 
26 
27 
28 /**
29  * @brief      for user to initialize extended scanning module
30  * 			   notice that only one module can be selected between legacy scanning module and extended scanning module
31  * @param	   none
32  * @return     none
33  */
34 void 		blc_ll_initExtendedScanning_module(void);
35 
36 
37 
38 
39 
40 
41 
42 /**
43  * @brief      This function is used to set the extended scan parameters to be used on the advertising physical channels
44  *			   attention: when scan_phys is SCAN_PHY_1M, 	scanType_1 & scanInter_1 & scanWindow_1 are invalid parameters,
45  *			   			  when scan_phys is SCAN_PHY_CODED, scanType_0 & scanInter_0 & scanWindow_0 are invalid parameters,
46  * @param[in]  ownAddrType - Own_Address_Type
47  * @param[in]  scan_fp - Scanning_Filter_Policy
48  * @param[in]  scan_phys - Scanning_PHYs, "SCAN_PHY_1M" or "SCAN_PHY_CODED"
49  *
50  * 			   Attention:
51  * 			   scanType_0/scanInter_0/scanWindow_0 are only for 1M    PHY.  If    1M PHY is not supported, these parameters are ignored.
52  * 			   scanType_1/scanInter_1/scanWindow_1 are only for Coded PHY.  If Coded PHY is not supported, these parameters are ignored.
53  *
54  * @param[in]  scanType_0 - Scan_Type for 1M PHY, Passive Scanning or Active Scanning.
55  * @param[in]  scanInter_0 - Scan_Interval for 1M PHY, Time interval from when the Controller started its last scan until it
56 							   begins the subsequent scan on the primary advertising physical channel.
57  * @param[in]  scanWindow_0 - Duration of the scan on the primary advertising physical channel for 1M PHY
58  *
59  * @param[in]  scanType_1 - Scan_Type for Coded PHY, Passive Scanning or Active Scanning.
60  * @param[in]  scanInter_1 - Scan_Interval for Coded PHY, Time interval from when the Controller started its last scan until it
61 							   begins the subsequent scan on the primary advertising physical channel.
62  * @param[in]  scanWindow_1 - Duration of the scan on the primary advertising physical channel  for Coded PHY
63  *
64  * @return     Status - 0x00: command succeeded; 0x01-0xFF: command failed
65  */
66 ble_sts_t 	blc_ll_setExtScanParam ( own_addr_type_t  ownAddrType,	scan_fp_type_t scan_fp,		 scan_phy_t	scan_phys,
67 									 	 scan_type_t   scanType_0,	scan_inter_t   scanInter_0,  scan_wind_t scanWindow_0,
68 										 scan_type_t   scanType_1,	scan_inter_t   scanInter_1,  scan_wind_t scanWindow_1);
69 
70 
71 
72 
73 
74 
75 
76 /**
77  * @brief	   This function is used to enable or disable scanning.
78  * @param[in]  extScan_en - 0x00: Scanning disabled; 0x01: Scanning enabled
79  * @param[in]  filter_duplicate - Filter_Duplicates
80  * @param[in]  duration - Scan duration
81  * @param[in]  period - Time interval from when the Controller started its last Scan_Duration until it begins the
82  * 			   			subsequent Scan_Duration.
83  * @return     Status - 0x00: command succeeded; 0x01-0xFF: command failed
84  */
85 ble_sts_t 	blc_ll_setExtScanEnable (scan_en_t  extScan_en,	dupe_fltr_en_t filter_duplicate, scan_durn_t duration,	scan_period_t period);
86 
87 
88 
89 
90 
91 #endif /* LL_SCAN_EXT_H_ */
92