Mistake on this page?
Report an issue in GitHub or email us
lctr_pdu_adv.h
Go to the documentation of this file.
1 /*************************************************************************************************/
2 /*!
3  * \file
4  *
5  * \brief Link layer controller advertising channel packet interface file.
6  *
7  * Copyright (c) 2013-2017 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_H
26 #define LCTR_PDU_ADV_H
27 
28 #include "lmgr_api_adv_slave.h"
29 #include "lctr_api.h"
30 
31 #ifdef __cplusplus
32 extern "C" {
33 #endif
34 
35 /**************************************************************************************************
36  Macros
37 **************************************************************************************************/
38 
39 #define LCTR_ADV_HDR_PDU_TYPE_SHIFT 0 /*!< ADV header PDU type field shift. */
40 #define LCTR_ADV_HDR_CH_SEL_SHIFT 5 /*!< ADV header channel selection field shift. */
41 #define LCTR_ADV_HDR_TX_ADD_SHIFT 6 /*!< ADV header Tx Address type field shift. */
42 #define LCTR_ADV_HDR_RX_ADD_SHIFT 7 /*!< ADV header Rx Address type field shift. */
43 #define LCTR_ADV_HDR_LEN_SHIFT 8 /*!< ADV header length field shift. */
44 
45 /**************************************************************************************************
46  Data Types
47 **************************************************************************************************/
48 
49 /*! \brief Advertising channel PDU header. */
50 typedef struct
51 {
52  uint8_t pduType; /*!< PDU type. */
53  uint8_t chSel; /*!< Channel selection. */
54  bool_t txAddrRnd; /*!< Tx address type is random. */
55  bool_t rxAddrRnd; /*!< Rx address type is random. */
56  uint8_t len; /*!< Payload length. */
58 
59 /*! \brief Scan request PDU. */
60 typedef struct
61 {
62  uint64_t scanAddr; /*!< Scanner's address. */
63  uint64_t advAddr; /*!< Advertiser's address. */
65 
66 /**************************************************************************************************
67  Function Declarations
68 **************************************************************************************************/
69 
70 /* Pack */
71 uint8_t lctrPackAdvbPduHdr(uint8_t *pBuf, const lctrAdvbPduHdr_t *pHdr);
72 uint8_t lctrPackAdvPdu(uint8_t *pBuf, uint64_t advA, const lmgrAdvbUser_t *pAdvData);
73 uint8_t lctrPackConnDirectIndAdvPdu(uint8_t *pBuf, uint64_t advA, uint64_t initA);
74 uint8_t lctrPackScanReqPdu(uint8_t *pBuf, const lctrScanReq_t *pPdu);
75 uint8_t lctrPackScanRspPdu(uint8_t *pBuf, uint64_t advA, const lmgrAdvbUser_t *pRspData);
76 uint8_t lctrPackConnIndPduAddr(uint8_t *pBuf, const lctrConnInd_t *pPdu);
77 uint8_t lctrPackConnIndPdu(uint8_t *pBuf, const lctrConnInd_t *pPdu);
78 
79 /* Unpack */
80 uint8_t lctrUnpackAdvbPduHdr(lctrAdvbPduHdr_t *pHdr, const uint8_t *pBuf);
81 uint8_t lctrUnpackScanReqPdu(lctrScanReq_t *pPdu, const uint8_t *pBuf);
82 uint8_t lctrUnpackConnIndPdu(lctrConnInd_t *pPdu, const uint8_t *pBuf);
83 
84 /* Validate */
85 bool_t lctrValidateConnIndPdu(lctrConnInd_t *pPdu);
86 
87 #ifdef __cplusplus
88 };
89 #endif
90 
91 #endif /* LCTR_PDU_ADV_H */
Link layer manager advertising slave interface file.
uint64_t advAddr
Definition: lctr_pdu_adv.h:63
Connect request PDU.
Definition: lctr_api.h:131
uint64_t scanAddr
Definition: lctr_pdu_adv.h:62
Advertising broadcast user data.
Definition: lmgr_api.h:57
Link layer controller common interface file.
Advertising channel PDU header.
Definition: lctr_pdu_adv.h:50
Scan request PDU.
Definition: lctr_pdu_adv.h:60
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.