Mistake on this page?
Report an issue in GitHub or email us
lctr_api_adv_master_ae.h
Go to the documentation of this file.
1 /*************************************************************************************************/
2 /*!
3  * \file
4  *
5  * \brief Link layer controller extended scanning master interface file.
6  *
7  * Copyright (c) 2013-2019 Arm Ltd. All Rights Reserved.
8  *
9  * Copyright (c) 2019 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 LCTR_API_ADV_MASTER_AE_H
26 #define LCTR_API_ADV_MASTER_AE_H
27 
28 #include "lctr_api.h"
29 #include "lmgr_api_adv_master.h"
30 #include "wsf_assert.h"
31 
32 #ifdef __cplusplus
33 extern "C" {
34 #endif
35 
36 /**************************************************************************************************
37  Constants
38 **************************************************************************************************/
39 
40 /*! \brief Master scan and initiate task messages for \a LCTR_DISP_SCAN dispatcher. */
41 enum
42 {
43  /* Broadcast events */
44  LCTR_EXT_SCAN_MSG_RESET = LCTR_MSG_RESET, /*!< Reset API message. */
45  /* Scan events */
46  LCTR_EXT_SCAN_MSG_DISCOVER_ENABLE, /*!< Scan enable API event. */
47  LCTR_EXT_SCAN_MSG_DISCOVER_DISABLE, /*!< Scan disable API event. */
48  LCTR_EXT_SCAN_MSG_TERMINATE, /*!< Scan BOD terminated event. */
49  LCTR_EXT_SCAN_MSG_TOTAL /*!< Total number of scan events. */
50 };
51 
52 /*! \brief Scanner create sync task messages for \a LCTR_DISP_PER_CREATE_SYNC dispatcher. */
53 enum
54 {
55  /* Broadcast events */
56  LCTR_CREATE_SYNC_MSG_RESET = LCTR_MSG_RESET, /*!< Reset API message. */
57  LCTR_CREATE_SYNC_MSG_CREATE, /*!< Create sync create API event. */
58  LCTR_CREATE_SYNC_MSG_CANCEL, /*!< Create sync cancel sync API event. */
59  LCTR_CREATE_SYNC_MSG_FAILED, /*!< Create sync failed event. */
60  LCTR_CREATE_SYNC_MSG_DONE, /*!< Create sync done event. */
61  LCTR_CREATE_SYNC_MSG_TERMINATE, /*!< Create sync scanning BOD terminate event. */
62  LCTR_CREATE_SYNC_MSG_TOTAL /*!< Total number of Create sync events. */
63 };
64 
65 /*! \brief Scanner transfer sync task messages for \a LCTR_DISP_TRANFER_SYNC dispatcher. */
66 enum
67 {
68  /* Broadcast events */
69  LCTR_TRANSFER_SYNC_MSG_RESET = LCTR_MSG_RESET, /*!< Reset API message. */
70  LCTR_TRANSFER_SYNC_MSG_START = LCTR_CREATE_SYNC_MSG_CREATE, /*!< Transfer sync start event. */
71  LCTR_TRANSFER_SYNC_MSG_CANCEL = LCTR_CREATE_SYNC_MSG_CANCEL, /*!< Transfer sync cancel sync API event. */
72  LCTR_TRANSFER_SYNC_MSG_FAILED = LCTR_CREATE_SYNC_MSG_FAILED, /*!< Transfer sync failed event. */
73  LCTR_TRANSFER_SYNC_MSG_DONE = LCTR_CREATE_SYNC_MSG_DONE, /*!< Transfer sync done event. */
74  LCTR_TRANSFER_SYNC_MSG_TERMINATE = LCTR_CREATE_SYNC_MSG_TERMINATE, /*!< Transfer sync scanning BOD terminate event. */
75  LCTR_TRANSFER_SYNC_MSG_TOTAL = LCTR_CREATE_SYNC_MSG_TOTAL /*!< Total number of Transfer sync events. */
76 };
77 
78 /*! \brief Scanner periodic synchronous task messages for \a LCTR_DISP_PER_SCAN dispatcher. */
79 enum
80 {
81  /* Broadcast events */
82  LCTR_PER_SCAN_MSG_RESET = LCTR_MSG_RESET, /*!< Reset API message. */
83  /* Advertising events */
84  LCTR_PER_SCAN_MSG_SYNC_ESTD, /*!< Periodic scanning synchronous established event. */
85  LCTR_PER_SCAN_MSG_TERMINATE, /*!< Periodic scanning terminate API event. */
86  LCTR_PER_SCAN_MSG_TERMINATE_DONE, /*!< Periodic scanning terminate done event. */
87  LCTR_PER_SCAN_SUP_TIMEOUT, /*!< Periodic synchronous supervision timeout event. */
88  LCTR_PER_SCAN_MSG_TOTAL /*!< Total number of periodic scanning events. */
89 
90 };
91 
92 /*! \brief Scan PHYs. */
93 enum
94 {
95  LCTR_SCAN_PHY_1M, /*!< LE 1M PHY scanner. */
96  LCTR_INIT_PHY_2M, /*!< LE 2M PHY initiator (not valid for scanning). */
97  LCTR_SCAN_PHY_CODED, /*!< LE Coded PHY scanner. */
98  LCTR_SCAN_PHY_TOTAL, /*!< Total number of scanning PHYs. */
99  LCTR_SCAN_PHY_ALL = 0xFF /*!< All PHY scanners. */
100 };
101 
102 /**************************************************************************************************
103  Data Types
104 **************************************************************************************************/
105 
106 /*! \brief Extended scan enable message. */
107 typedef struct
108 {
109  lctrMsgHdr_t hdr; /*!< Message header. */
110  uint8_t filtDup; /*!< Filter out duplicate advertisers. */
111  uint32_t durMs; /*!< Duration in milliseconds. */
112  uint32_t perMs; /*!< Period in milliseconds. */
114 
115 /*! \brief Extended initiate message. */
116 typedef struct
117 {
118  lctrMsgHdr_t hdr; /*!< Message header. */
119  uint8_t filterPolicy; /*!< Scan filter policy. */
120  uint8_t ownAddrType; /*!< Address type used by this device. */
121  uint8_t peerAddrType; /*!< Address type used for peer device. */
122  uint64_t peerAddr; /*!< Address of peer device. */
123  uint8_t initPhys; /*!< Initiating PHYs. */
125 
126 /*! \brief Extended scan message data. */
127 typedef union
128 {
129  lctrMsgHdr_t hdr; /*!< Message header. */
130  lctrExtScanEnableMsg_t enable; /*!< Extended scan enable message data. */
131  lctrExtInitiateMsg_t init; /*!< Extended initiate message data. */
133 
134 /*! \brief Periodic create sync message. */
135 typedef struct
136 {
137  lctrMsgHdr_t hdr; /*!< Message header. */
138  uint8_t filterPolicy; /*!< Filter Policy. */
139  uint8_t repDisabled; /*!< Reporting disabled. */
140  uint8_t advSID; /*!< Advertising SID. */
141  uint8_t advAddrType; /*!< Advertiser Address Type. */
142  uint64_t advAddr; /*!< Advertiser Address. */
143  uint16_t skip; /*!< Skip. */
144  uint16_t syncTimeOut; /*!< Synchronization Timeout. */
146 
147 /*! \brief Periodic transfer sync message. */
148 typedef struct
149 {
150  lctrMsgHdr_t hdr; /*!< Message header. */
151  uint16_t id; /*!< ID. */
152  uint8_t bSyncInfo[LL_SYNC_INFO_LEN]; /*!< SyncInfo bytes. */
153  uint16_t connHandle; /*!< Connection handle. */
154  uint16_t ceRef; /*!< Reference connection event counter. */
155  uint16_t ceRcvd; /*!< Connection event counter when LL_PERIODIC_SYNC_IND was received. */
156  uint16_t lastPECounter; /*!< Last PA event counter. */
157  uint8_t advSID; /*!< Advertising SID. */
158  uint8_t advAddrType; /*!< Advertiser Address Type. */
159  uint8_t scaB; /*!< Sleep clock accuracy of the device sending LL_PERIODIC_SYNC_IND. */
160  uint8_t rxPhy; /*!< PHY used for periodic advertising scan. */
161  uint64_t advAddr; /*!< Advertiser Address. */
162  uint16_t syncConnEvtCounter; /*!< Connection event counter when the contents of the PDU is determined. */
164 
165 /*! \brief Periodic Advertising message data. */
166 typedef union
167 {
168  lctrMsgHdr_t hdr; /*!< Message header. */
169  lctrPerCreateSyncMsg_t createSync; /*!< Periodic create sync message data. */
170  lctrPerTransferSyncMsg_t transferSync; /*!< Periodic transfer sync message data. */
172 
173 /**************************************************************************************************
174  Globals
175 **************************************************************************************************/
176 
177 /*! \brief Periodic scan message data. */
179 
180 /**************************************************************************************************
181  Function Declarations
182 **************************************************************************************************/
183 
184 /* Initialization */
185 void LctrMstExtScanInit(void);
186 void LctrMstExtScanDefaults(void);
187 void LctrMstPerCreateSyncInit(void);
188 void LctrMstPerTransferSyncInit(void);
189 void LctrMstPerScanInit(void);
190 
191 /* Status */
192 bool_t LctrMstExtScanValidateParam(void);
193 
194 /* Control */
195 void LctrMstExtScanSetScanPhy(uint8_t scanPhy);
196 void LctrMstExtScanClearScanPhy(uint8_t scanPhy);
197 void LctrMstExtScanSetParam(uint8_t scanPhy, uint8_t ownAddrType, uint8_t scanFiltPolicy, const LlExtScanParam_t *pParam);
198 bool_t LctrMstExtScanIsEnabled(uint8_t scanPhy);
199 bool_t LctrMstPerIsSyncPending(void);
200 bool_t LctrMstPerIsSyncDisabled(void);
201 bool_t LctrMstPerIsSync(uint8_t advSID, uint8_t advAddrType, uint64_t advAddr);
202 uint8_t lctrMstPerGetNumPerScanCtx(void);
203 uint64_t LctrGetPerScanChanMap(uint16_t handle);
204 bool_t lctrMstPerIsSyncHandleValid(uint16_t syncHandle);
205 void LctrPastInit(void);
206 uint8_t LctrPeriodicAdvSyncTransfer(uint16_t connHandle, uint16_t serviceData, uint16_t syncHandle);
207 void LctrMstPerSetRcvEnable(uint16_t syncHandle, bool_t enable);
208 
209 #ifdef __cplusplus
210 };
211 #endif
212 
213 #endif /* LCTR_API_ADV_MASTER_AE_H */
Extended scan enable message.
Extended initiate message.
Periodic Advertising message data.
Link layer manager advertising master interface file.
LctrPerScanMsg_t * pLctrMstPerScanMsg
Periodic scan message data.
Periodic create sync message.
lctrExtScanEnableMsg_t enable
lctrPerTransferSyncMsg_t transferSync
lctrPerCreateSyncMsg_t createSync
Link layer controller common interface file.
Assert macro.
Common message structure passed to event handler.
Definition: lctr_api.h:109
lctrExtInitiateMsg_t init
Extended scan message data.
Extended scan parameters.
Definition: ll_api.h:462
Periodic transfer sync message.
#define LL_SYNC_INFO_LEN
Definition: ll_defs.h:180
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.