Mistake on this page?
Report an issue in GitHub or email us
bb_ble_api_reslist.h
Go to the documentation of this file.
1 /*************************************************************************************************/
2 /*!
3  * \file
4  *
5  * \brief BLE baseband resolving list interface file.
6  *
7  * Copyright (c) 2016-2019 Arm Ltd. All Rights Reserved.
8  *
9  * Copyright (c) 2019-2020 Packetcraft, Inc.
10  *
11  * Licensed under the Apache License, Version 2.0 (the "License");
12  * you may not use this file except in compliance with the License.
13  * You may obtain a copy of the License at
14  *
15  * http://www.apache.org/licenses/LICENSE-2.0
16  *
17  * Unless required by applicable law or agreed to in writing, software
18  * distributed under the License is distributed on an "AS IS" BASIS,
19  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
20  * See the License for the specific language governing permissions and
21  * limitations under the License.
22  */
23 /*************************************************************************************************/
24 
25 #ifndef BB_BLE_API_RESLIST_H
26 #define BB_BLE_API_RESLIST_H
27 
28 #include "wsf_types.h"
29 
30 #ifdef __cplusplus
31 extern "C" {
32 #endif
33 
34 /*! \addtogroup BB_API_BLE_RL
35  * \{ */
36 
37 /**************************************************************************************************
38  Constants
39 **************************************************************************************************/
40 
41 /*! \brief Resolvable address status. */
42 enum
43 {
44  BB_BLE_RESLIST_STATUS_ID_ADDR_NOT_IN_LIST, /*!< Identity address is not in list. */
45  BB_BLE_RESLIST_STATUS_ZERO_IRK, /*!< IRK is zero for address. */
46  BB_BLE_RESLIST_STATUS_RES_ADDR_UNASSIGNED, /*!< Resolvable address is unassigned. */
47  BB_BLE_RESLIST_STATUS_RES_ADDR_ASSIGNED /*!< Resolvable address is assigned. */
48 };
49 
50 /*! \brief Privacy modes. */
51 enum
52 {
53  BB_BLE_RESLIST_PRIV_MODE_NETWORK = 0, /*!< Network privacy mode. */
54  BB_BLE_RESLIST_PRIV_MODE_DEVICE = 1, /*!< Device privacy mode. */
55 };
56 
57 /**************************************************************************************************
58  Data Types
59 **************************************************************************************************/
60 
61 /*! \brief Address resolution needed callback signature. */
62 typedef void (*bbBleResListAddrResNeeded_t)(uint64_t rpa, bool_t peer, uint8_t peerAddrType, uint64_t peerIdentityAddr);
63 
64 /**************************************************************************************************
65  Function Declarations
66 **************************************************************************************************/
67 
68 /*************************************************************************************************/
69 /*!
70  * \brief Set address resolution needed callback.
71  *
72  * \param cback Callback.
73  */
74 /*************************************************************************************************/
76 
77 /*************************************************************************************************/
78 /*!
79  * \brief Get resolving list size.
80  *
81  * \return Total number of resolving list entries.
82  *
83  * Get the resolving list capacity supported by the BB.
84  */
85 /*************************************************************************************************/
86 uint8_t BbBleResListGetSize(void);
87 
88 /*************************************************************************************************/
89 /*!
90  * \brief Clear resolving list.
91  *
92  * Clear all resolving list entries stored in the BB.
93  */
94 /*************************************************************************************************/
95 void BbBleResListClear(void);
96 
97 /*************************************************************************************************/
98 /*!
99  * \brief Add device to resolving list.
100  *
101  * \param peerAddrType Peer identity address type.
102  * \param peerIdentityAddr Peer identity address.
103  * \param pPeerIrk Peer IRK.
104  * \param pLocalIrk Local IRK.
105  *
106  * \return TRUE if successful, FALSE if list full.
107  *
108  * Add device to resolving list.
109  */
110 /*************************************************************************************************/
111 bool_t BbBleResListAdd(uint8_t peerAddrType, uint64_t peerIdentityAddr, const uint8_t *pPeerIrk,
112  const uint8_t *pLocalIrk);
113 
114 /*************************************************************************************************/
115 /*!
116  * \brief Remove device from resolving list.
117  *
118  * \param peerAddrType Peer identity address type.
119  * \param peerIdentityAddr Peer identity address.
120  *
121  * \return TRUE if successful, FALSE if address not in the list.
122  *
123  * Remove device from resolving list.
124  */
125 /*************************************************************************************************/
126 bool_t BbBleResListRemove(uint8_t peerAddrType, uint64_t peerIdentityAddr);
127 
128 /*************************************************************************************************/
129 /*!
130  * \brief Set privacy mode of a device.
131  *
132  * \param peerAddrType Peer identity address type.
133  * \param peerIdentityAddr Peer identity address.
134  * \param privMode Privacy mode.
135  *
136  * \return TRUE if successful, FALSE if address not in the list.
137  *
138  * Set privacy mode of a device.
139  */
140 /*************************************************************************************************/
141 bool_t BbBleResListSetPrivacyMode(uint8_t peerAddrType, uint64_t peerIdentityAddr, uint8_t privMode);
142 
143 /*************************************************************************************************/
144 /*!
145  * \brief Get privacy mode of a device.
146  *
147  * \param peerAddrType Peer identity address type.
148  * \param peerIdentityAddr Peer identity address.
149  * \param pPrivMode Storage for privacy mode.
150  *
151  * \return TRUE if successful, FALSE if address not in the list.
152  *
153  * Get privacy mode of a device.
154  */
155 /*************************************************************************************************/
156 bool_t BbBleResListGetPrivacyMode(uint8_t peerAddrType, uint64_t peerIdentityAddr, uint8_t *pPrivMode);
157 
158 /*************************************************************************************************/
159 /*!
160  * \brief Read peer resolvable address.
161  *
162  * \param peerAddrType Peer identity address type.
163  * \param peerIdentityAddr Peer identity address.
164  * \param pRpa Storage for peer resolvable private address
165  *
166  * \return TRUE if successful, FALSE if address not in list.
167  *
168  * Get the peer resolvable private address that is currently being used for the peer identity
169  * address.
170  */
171 /*************************************************************************************************/
172 bool_t BbBleResListReadPeer(uint8_t peerAddrType, uint64_t peerIdentityAddr, uint64_t *pRpa);
173 
174 /*************************************************************************************************/
175 /*!
176  * \brief Read local resolvable address.
177  *
178  * \param peerAddrType Peer identity address type.
179  * \param peerIdentityAddr Peer identity address.
180  * \param pRpa Storage for peer resolvable private address
181  *
182  * \return TRUE if successful, FALSE if address not in list.
183  *
184  * Get the local resolvable private address that is currently being used for the peer identity
185  * address.
186  */
187 /*************************************************************************************************/
188 bool_t BbBleResListReadLocal(uint8_t peerAddrType, uint64_t peerIdentityAddr, uint64_t *pRpa);
189 
190 /*************************************************************************************************/
191 /*!
192  * \brief Update local resolvable address.
193  *
194  * \param peerAddrType Peer identity address type.
195  * \param peerIdentityAddr Peer identity address.
196  * \param pRpa Storage for local resolvable private address
197  *
198  * \return TRUE if successful, FALSE if address not in list.
199  *
200  * Update the local resolvable private address that is currently being used for the peer identity
201  * address.
202  */
203 /*************************************************************************************************/
204 bool_t BbBleResListUpdateLocal(uint8_t peerAddrType, uint64_t peerIdentityAddr, uint64_t *pRpa);
205 
206 /*************************************************************************************************/
207 /*!
208  * \brief Generate peer resolvable address.
209  *
210  * \param peerAddrType Peer identity address type.
211  * \param peerIdentityAddr Peer identity address.
212  * \param pRpa Storage for peer resolvable private address.
213  *
214  * \return TRUE if successful, FALSE if address not in list or peer IRK is zero.
215  *
216  * Generate a peer resolvable address for a peer.
217  */
218 /*************************************************************************************************/
219 bool_t BbBleResListGeneratePeer(uint8_t peerAddrType, uint64_t peerIdentityAddr, uint64_t *pRpa);
220 
221 /*************************************************************************************************/
222 /*!
223  * \brief Check whether a peer address has been resolved.
224  *
225  * \param rpa Peer resolvable private address
226  * \param pPeerAddrType Storage for peer identity address type.
227  * \param pPeerIdentityAddr Storage for peer identity address.
228  *
229  * \return TRUE if successful, FALSE if address has not been resolved.
230  *
231  * Check whether a peer address has been resolved. Because of timing constraints, addresses should
232  * not be resolved in this function; instead, the resolution callback should be invoked to schedule
233  * the operation later.
234  */
235 /*************************************************************************************************/
236 bool_t BbBleResListCheckResolvePeer(uint64_t rpa, uint8_t *pPeerAddrType, uint64_t *pPeerIdentityAddr);
237 
238 /*************************************************************************************************/
239 /*!
240  * \brief Check whether a local address has been resolved.
241  *
242  * \param rpa Local resolvable private address
243  * \param peerAddrType Peer identity address type.
244  * \param peerIdentityAddr Peer identity address.
245  *
246  * \return TRUE if successful, FALSE if address has not been resolved.
247  *
248  * Check whether a local address has been resolved. Because of timing constraints, addresses should
249  * not be resolved in this function; instead, the resolution callback should be invoked to schedule
250  * the operation later.
251  */
252 /*************************************************************************************************/
253 bool_t BbBleResListCheckResolveLocal(uint64_t rpa, uint8_t peerAddrType, uint64_t peerIdentityAddr);
254 
255 /*************************************************************************************************/
256 /*!
257  * \brief Check whether a local address has been resolved.
258  *
259  * \param rpa Local resolvable private address
260  * \param peerAddrType Peer identity address type.
261  * \param peerIdentityAddr Peer identity address.
262  *
263  * \return TRUE if successful, FALSE if address has not been resolved.
264  *
265  */
266 /*************************************************************************************************/
267 bool_t BbBleResListIsLocalResolved(uint64_t rpa, uint8_t peerAddrType, uint64_t peerIdentityAddr);
268 
269 /*************************************************************************************************/
270 /*!
271  * \brief Resolve peer resolvable address.
272  *
273  * \param rpa Peer resolvable private address
274  * \param pPeerAddrType Storage for peer identity address type.
275  * \param pPeerIdentityAddr Storage for peer identity address.
276  *
277  * \return TRUE if successful, FALSE if address could not be resolved.
278  *
279  * Resolve a peer resolvable address.
280  */
281 /*************************************************************************************************/
282 bool_t BbBleResListResolvePeer(uint64_t rpa, uint8_t *pPeerAddrType, uint64_t *pPeerIdentityAddr);
283 
284 /*************************************************************************************************/
285 /*!
286  * \brief Resolve local resolvable address.
287  *
288  * \param rpa Local resolvable private address
289  * \param pPeerAddrType Storage for peer identity address type.
290  * \param pPeerIdentityAddr Storage for peer identity address.
291  *
292  * \return TRUE if successful, FALSE if address could not be resolved.
293  *
294  * Resolve a local resolvable address.
295  */
296 /*************************************************************************************************/
297 bool_t BbBleResListResolveLocal(uint64_t rpa, uint8_t *pPeerAddrType, uint64_t *pPeerIdentityAddr);
298 
299 /*************************************************************************************************/
300 /*!
301  * \brief Get status of peer address in resolving list.
302  *
303  * \param peerAddrRand TRUE if peer identity address is random.
304  * \param peerIdentityAddr Peer identity address.
305  *
306  * \return Peer address status.
307  *
308  * Get the peer resolvable private address status
309  */
310 /*************************************************************************************************/
311 uint8_t BbBleResListPeerStatus(bool_t peerAddrRand, uint64_t peerIdentityAddr);
312 
313 /*************************************************************************************************/
314 /*!
315  * \brief Get status of local address in resolving list.
316  *
317  * \param peerAddrRand TRUE if peer identity address is random.
318  * \param peerIdentityAddr Peer identity address.
319  *
320  * \return Local address status.
321  *
322  * Get the peer resolvable private address status
323  */
324 /*************************************************************************************************/
325 uint8_t BbBleResListLocalStatus(bool_t peerAddrRand, uint64_t peerIdentityAddr);
326 
327 /*************************************************************************************************/
328 /*!
329  * \brief Handle timeout of local resolvable addresses.
330  *
331  * A new local resolvable address will be generated for each entry in the resolving list.
332  */
333 /*************************************************************************************************/
334 void BbBleResListHandleTimeout(void);
335 
336 /*************************************************************************************************/
337 /*!
338  * \brief Check if either local RPA or peer RPA is updated.
339  *
340  * \param peerAddrType Peer identity address type.
341  * \param peerIdentityAddr Peer identity address.
342  *
343  * \return TRUE if either local RPA or peer RPA is updated.
344  *
345  */
346 /*************************************************************************************************/
347 bool_t BbBleResListIsRpaUpd(uint8_t peerAddrType, uint64_t peerIdentityAddr);
348 
349 /*************************************************************************************************/
350 /*!
351  * \brief Check if peer identity is in the resolving list.
352  *
353  * \param peerAddrType Peer identity address type.
354  * \param peerIdentityAddr Peer identity address.
355  *
356  * \return TRUE if peer addr is in the resolving list.
357  *
358  */
359 /*************************************************************************************************/
360 bool_t bbBleIsPeerInResList(uint8_t peerAddrType, uint64_t peerIdentityAddr);
361 
362 /*! \} */ /* BB_API_BLE_RL */
363 
364 #ifdef __cplusplus
365 };
366 #endif
367 
368 #endif /* BB_BLE_API_RESLIST_H */
uint8_t BbBleResListPeerStatus(bool_t peerAddrRand, uint64_t peerIdentityAddr)
Get status of peer address in resolving list.
bool_t BbBleResListSetPrivacyMode(uint8_t peerAddrType, uint64_t peerIdentityAddr, uint8_t privMode)
Set privacy mode of a device.
uint8_t BbBleResListLocalStatus(bool_t peerAddrRand, uint64_t peerIdentityAddr)
Get status of local address in resolving list.
bool_t bbBleIsPeerInResList(uint8_t peerAddrType, uint64_t peerIdentityAddr)
Check if peer identity is in the resolving list.
bool_t BbBleResListGetPrivacyMode(uint8_t peerAddrType, uint64_t peerIdentityAddr, uint8_t *pPrivMode)
Get privacy mode of a device.
bool_t BbBleResListIsLocalResolved(uint64_t rpa, uint8_t peerAddrType, uint64_t peerIdentityAddr)
Check whether a local address has been resolved.
bool_t BbBleResListReadLocal(uint8_t peerAddrType, uint64_t peerIdentityAddr, uint64_t *pRpa)
Read local resolvable address.
bool_t BbBleResListResolvePeer(uint64_t rpa, uint8_t *pPeerAddrType, uint64_t *pPeerIdentityAddr)
Resolve peer resolvable address.
bool_t BbBleResListAdd(uint8_t peerAddrType, uint64_t peerIdentityAddr, const uint8_t *pPeerIrk, const uint8_t *pLocalIrk)
Add device to resolving list.
bool_t BbBleResListCheckResolveLocal(uint64_t rpa, uint8_t peerAddrType, uint64_t peerIdentityAddr)
Check whether a local address has been resolved.
bool_t BbBleResListUpdateLocal(uint8_t peerAddrType, uint64_t peerIdentityAddr, uint64_t *pRpa)
Update local resolvable address.
Platform-independent data types.
bool_t BbBleResListResolveLocal(uint64_t rpa, uint8_t *pPeerAddrType, uint64_t *pPeerIdentityAddr)
Resolve local resolvable address.
bool_t BbBleResListCheckResolvePeer(uint64_t rpa, uint8_t *pPeerAddrType, uint64_t *pPeerIdentityAddr)
Check whether a peer address has been resolved.
bool_t BbBleResListRemove(uint8_t peerAddrType, uint64_t peerIdentityAddr)
Remove device from resolving list.
void(* bbBleResListAddrResNeeded_t)(uint64_t rpa, bool_t peer, uint8_t peerAddrType, uint64_t peerIdentityAddr)
Address resolution needed callback signature.
bool_t BbBleResListGeneratePeer(uint8_t peerAddrType, uint64_t peerIdentityAddr, uint64_t *pRpa)
Generate peer resolvable address.
void BbBleResListClear(void)
Clear resolving list.
bool_t BbBleResListIsRpaUpd(uint8_t peerAddrType, uint64_t peerIdentityAddr)
Check if either local RPA or peer RPA is updated.
uint8_t BbBleResListGetSize(void)
Get resolving list size.
void BbBleResListHandleTimeout(void)
Handle timeout of local resolvable addresses.
bool_t BbBleResListReadPeer(uint8_t peerAddrType, uint64_t peerIdentityAddr, uint64_t *pRpa)
Read peer resolvable address.
void BbBleResListSetAddrResNeededCback(bbBleResListAddrResNeeded_t cback)
Set address resolution needed callback.
Important Information for this Arm website

This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies. If you are not happy with the use of these cookies, please review our Cookie Policy to learn how they can be disabled. By disabling cookies, some features of the site will not work.