Mistake on this page?
Report an issue in GitHub or email us
lctr_pdu_adv_ae.h
Go to the documentation of this file.
1 /*************************************************************************************************/
2 /*!
3  * \file
4  *
5  * \brief Link layer controller extended advertising channel packet interface file.
6  *
7  * Copyright (c) 2013-2018 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_PDU_ADV_AE_H
26 #define LCTR_PDU_ADV_AE_H
27 
28 #include "lctr_pdu_adv.h"
29 #include "lctr_int_adv_slave_ae.h"
30 
31 #ifdef __cplusplus
32 extern "C" {
33 #endif
34 
35 /**************************************************************************************************
36  Constants
37 **************************************************************************************************/
38 
39 /*! \brief Advertising mode. */
40 enum
41 {
42  LCTR_ADV_MODE_CONN_BIT = (1 << 0), /*!< Connectable bit. */
43  LCTR_ADV_MODE_SCAN_BIT = (1 << 1) /*!< Scannable bit. */
44 };
45 
46 /*! \brief Clock accuracy. */
47 enum
48 {
49  LCTR_CLK_ACC_51_500_PPM = 0, /*!< Clock accuracy is between 51 and 500 PPM. */
50  LCTR_CLK_ACC_0_50_PPM = 1 /*!< Clock accuracy is between 0 and 51 PPM. */
51 };
52 
53 /*! \brief Channel offset units. */
54 enum
55 {
56  LCTR_OFFS_UNITS_30_USEC = 0, /*!< Unit is 30 microseconds. */
57  LCTR_OFFS_UNITS_300_USEC = 1 /*!< Unit is 300 microseconds. */
58 };
59 
60 #define LCTR_AUX_PTR_LEN 3 /*!< Size of AuxPtr field. */
61 #define LCTR_TX_POWER_LEN 1 /*!< Size of TxPower field. */
62 
63 /**************************************************************************************************
64  Data Types
65 **************************************************************************************************/
66 
67 /*! \brief Extended advertising channel PDU header. */
68 typedef struct
69 {
70  uint8_t extHdrLen; /*!< Extended header length. */
71  uint8_t advMode; /*!< Advertising mode. */
72  uint8_t extHdrFlags; /*!< Extended header flags. */
73  uint64_t advAddr; /*!< Advertiser's address. */
74  uint64_t tgtAddr; /*!< Target address. */
75  uint16_t did; /*!< Advertising data ID in ADI. */
76  uint8_t sid; /*!< Advertising set ID in ADI. */
77  int8_t txPwr; /*!< Tx Power. */
78  uint8_t acadLen; /*!< ACAD length. */
79  const uint8_t *pAcad; /*!< Buffer pointer to ACAD. */
80  const uint8_t *pAuxPtr; /*!< Buffer pointer to AuxPtr field. */
81  const uint8_t *pSyncInfo; /*!< Buffer pointer to SyncInfo field. */
83 
84 /*! \brief Auxiliary Pointer. */
85 typedef struct
86 {
87  uint8_t auxChIdx; /*!< Auxiliary channel index. */
88  uint8_t ca; /*!< Advertiser's clock accuracy. */
89  uint8_t offsetUnits; /*!< Offset units. */
90  uint16_t auxOffset; /*!< Auxiliary offset. */
91  uint8_t auxPhy; /*!< Auxiliary PHY. */
92 } lctrAuxPtr_t;
93 
94 /*! \brief Sync info. */
95 typedef struct
96 {
97  uint16_t syncOffset; /*!< Sync packet offset. */
98  uint8_t offsetUnits; /*!< Offset units. */
99  uint8_t offsetAdjust; /*!< Offset adjust. */
100  uint16_t syncInter; /*!< Sync interval. */
101  uint64_t chanMap; /*!< Secondary channel map. */
102  uint8_t sca; /*!< Sleep clock accuracy. */
103  uint32_t accAddr; /*!< Access address. */
104  uint32_t crcInit; /*!< CRC initialization value. */
105  uint16_t eventCounter; /*!< Event counter. */
107 
108 /*! \brief Pack ACAD call signature. */
109 typedef uint8_t (*lctrPackAcad_t)(lctrAdvSet_t *, uint8_t *);
110 
111 /**************************************************************************************************
112  Function Declarations
113 **************************************************************************************************/
114 
115 /* Pack */
116 uint8_t lctrPackAdvExtIndPdu(lctrAdvSet_t *pAdvSet, uint8_t *pPduBuf, bool_t isPeriodic);
117 uint8_t lctrPackAuxAdvIndPdu(lctrAdvSet_t *pAdvSet, uint8_t *pPduBuf, lctrAdvDataBuf_t *pAdvData, bool_t isPeriodic);
118 uint8_t lctrPackAuxScanRspPdu(lctrAdvSet_t *pAdvSet, uint8_t *pPduBuf, bool_t isPeriodic);
119 uint8_t lctrPackAuxChainIndPdu(lctrAdvSet_t *pAdvSet, uint8_t *pPduBuf, lctrAdvDataBuf_t *pAdvData, bool_t isPeriodic);
120 uint8_t lctrPackAuxConnRspPdu(lctrAdvSet_t *pAdvSet, uint8_t *pPduBuf, bool_t isPeriodic);
121 void lctrPackAuxPtr(lctrAdvSet_t const *pAdvSet, uint32_t offsUsec, uint8_t chIdx, uint8_t *pAuxPtr);
122 uint8_t lctrPackLegacyAdvPdu(lctrAdvSet_t *pAdvSet, uint8_t *pPduBuf);
123 uint8_t lctrPackLegacyScanRspPdu(lctrAdvSet_t *pAdvSet, uint8_t *pPduBuf);
124 uint8_t lctrPackSyncIndPdu(lctrAdvSet_t *pAdvSet, uint8_t *pPduBuf, lctrAdvDataBuf_t *pAdvData, bool_t isPeriodic);
125 uint8_t lctrPackAcadChanMapUpd(lctrAdvSet_t *pAdvSet, uint8_t *pBuf);
126 uint8_t lctrPackAcadBigInfo(lctrAdvSet_t *pAdvSet, uint8_t *pBuf);
127 
128 /* Unpack */
129 uint8_t lctrUnpackExtAdvHeader(lctrExtAdvHdr_t *pPdu, uint8_t *pNewFlags, const uint8_t *pBuf);
130 void lctrUnpackAuxPtr(lctrAuxPtr_t *pAuxPtr, const uint8_t *pBuf);
131 void lctrUnpackSyncInfo(lctrSyncInfo_t *pSyncInfo, const uint8_t *pBuf);
132 void lctrUnpackAcadChanMapUpd(LctrAcadChanMapUpd_t *pChanMapUpd, const uint8_t *pBuf);
133 void lctrUnpackAcadBigInfo(LctrAcadBigInfo_t *pBigInfo, const uint8_t *pBuf, uint8_t len);
134 
135 #ifdef __cplusplus
136 };
137 #endif
138 
139 #endif /* LCTR_PDU_ADV_AE_H */
uint16_t syncOffset
const uint8_t * pAuxPtr
const uint8_t * pSyncInfo
uint16_t auxOffset
Internal link layer controller slave extended advertising interface file.
uint8_t offsetUnits
ACAD data field for channel map update.
Link layer controller advertising channel packet interface file.
uint8_t offsetAdjust
uint16_t eventCounter
uint8_t auxChIdx
Extended advertising channel PDU header.
const uint8_t * pAcad
Sync info.
Advertising data buffer descriptor.
uint8_t(* lctrPackAcad_t)(lctrAdvSet_t *, uint8_t *)
Pack ACAD call signature.
ACAD data field for channel map update.
Advertising set.
Auxiliary Pointer.
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.