• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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_RESOLVLIST_H_
19 #define LL_RESOLVLIST_H_
20 
21 #include <stack/ble/ble_common.h>
22 
23 /**
24  * @brief      This function is used to initialize resolving list && RPA concerned parameters
25  * @param[in]  none
26  * @return     Status - 0x00: command succeeded; 0x01-0xFF: command failed
27  */
28 void blc_ll_resolvListInit(void);
29 
30 /**
31  * @brief      This function is used to reset resolving list
32  * @param[in]  none
33  * @return     Status - 0x00: command succeeded; 0x01-0xFF: command failed
34  */
35 ble_sts_t ll_resolvingList_reset(void);
36 
37 /**
38  * @brief      This function is used to add a device to resolving list
39  * @param[in]  peerIdAddrType - device mac address type
40  * @param[in]  peerIdAddr - device mac address
41  * @param[in]  peer_irk - peer IRK pointer
42  * @param[in]  local_irk - local IRK pointer
43  * @return     Status - 0x00: command succeeded; 0x01-0xFF: command failed
44  */
45 ble_sts_t ll_resolvingList_add(u8 peerIdAddrType, u8 *peerIdAddr, u8 *peer_irk, u8 *local_irk);
46 
47 /**
48  * @brief      This function is used to delete a device from resolving list
49  * @param[in]  peerIdAddrType - device mac address type
50  * @param[in]  peerIdAddr - device mac address
51  * @return     Status - 0x00: command succeeded; 0x01-0xFF: command failed
52  */
53 ble_sts_t ll_resolvingList_delete(u8 peerIdAddrType, u8 *peerIdAddr);
54 
55 /**
56  * @brief      This function is used to enable resolvinglist resolution
57  * @param[in]  resolutionEn - 1: enable; 0:disable
58  * @return     Status - 0x00: command succeeded; 0x01-0xFF: command failed
59  */
60 ble_sts_t ll_resolvingList_setAddrResolutionEnable(u8 resolutionEn);
61 
62 /**
63  * @brief      This function is used to get resolving list size
64  * @param[out] pointer to size
65  * @return     Status - 0x00: command succeeded; 0x01-0xFF: command failed
66  */
67 ble_sts_t ll_resolvingList_getSize(u8 *Size);
68 
69 /**
70  * @brief	This function is used to get the current peer Resolvable Private
71  * 			Address being used for the corresponding peer Public and Random (static) Identity Address.
72  * @param[in]	peerIdAddrType - Peer Identity Address Type
73  * @param[in]	peerIdAddr - Peer Identity Address
74  * @param[out]  peerResolvableAddr - Peer Resolvable Address
75  * @return	Status - 0x00: command succeeded; 0x01-0xFF: command failed
76  */
77 ble_sts_t ll_resolvingList_getPeerResolvableAddr(u8 peerIdAddrType, u8 *peerIdAddr, u8 *peerResolvableAddr);
78 
79 /**
80  * @brief	This function is used to get the current local Resolvable Private
81  * 			Address being used for the corresponding peer Identity Address.
82  * @param[in]	peerIdAddrType - Peer Identity Address Type
83  * @param[in]	peerIdAddr - Peer Identity Address
84  * @param[out]  LocalResolvableAddr - Local Resolvable Address
85  * @return	Status - 0x00: command succeeded; 0x01-0xFF: command failed
86  */
87 ble_sts_t ll_resolvingList_getLocalResolvableAddr(u8 peerIdAddrType, u8 *peerIdAddr, u8 *LocalResolvableAddr);
88 
89 /**
90  * @brief	This function is used to enable resolution of Resolvable Private Addresses in the Controller.
91  * @param[in]	resolutionEn - Address Resolution Enable/Disable
92  * @return	Status - 0x00: command succeeded; 0x01-0xFF: command failed
93  */
94 ble_sts_t ll_resolvingList_setAddrResolutionEnable(u8 resolutionEn);
95 
96 /*
97  * @brief 	This function is used to set the length of time the controller uses a
98  * 			Resolvable Private Address before a new resolvable	private address is
99  * 			generated and starts being used. This timeout applies to all addresses
100  * 			generated by the controller
101 *  @param[in]	timeout_s - RPA_Timeout: RPA_Timeout measured in seconds Range: 0x0001 to 0x0E10,
102                                          Time range: 1 s to 1 hour
103  * @return	Status - 0x00: command succeeded; 0x01-0xFF: command failed
104  * */
105 ble_sts_t ll_resolvingList_setResolvablePrivateAddrTimer(u16 timeout_s);
106 
107 /*
108  * @brief 	This function is used to allow the Host to specify the privacy mode to
109  * 			be used for a given entry on the resolving list.
110  * @param[in]	peerIdAddrType - Peer Identity Address Type
111  * @param[in]	peerIdAddr - Peer Identity Address
112  * @param[in]	privMode - Privacy_Mode: Network/Device Privacy Mode
113  * @return	Status - 0x00: command succeeded; 0x01-0xFF: command failed
114  * */
115 ble_sts_t ll_resolvingList_setPrivcyMode(u8 peerIdAddrType, u8 *peerIdAddr, u8 privMode);
116 
117 #endif /* LL_RESOLVLIST_H_ */
118