Mistake on this page?
Report an issue in GitHub or email us
lctr_int_init_master_ae.h
Go to the documentation of this file.
1 /*************************************************************************************************/
2 /*!
3  * \file
4  *
5  * \brief Internal link layer controller 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_INT_INIT_MASTER_AE_H
26 #define LCTR_INT_INIT_MASTER_AE_H
27 
29 #include "lctr_int.h"
30 #include "lctr_int_adv_master_ae.h"
31 #include "lctr_int_conn.h"
32 #include "lctr_int_conn_master.h"
33 
34 #ifdef __cplusplus
35 extern "C" {
36 #endif
37 
38 /**************************************************************************************************
39  Macros
40 **************************************************************************************************/
41 /*! \brief Resolve the extended initiate handle from the context pointer. */
42 #define LCTR_GET_EXT_INIT_HANDLE(pCtx) (pCtx - lctrMstExtInitTbl)
43 
44 /**************************************************************************************************
45  Constants
46 **************************************************************************************************/
47 
48 /*! \brief Master initiate states. */
49 enum
50 {
51  LCTR_EXT_INIT_STATE_DISABLED, /*!< Initiate disabled state. */
52  LCTR_EXT_INIT_STATE_ENABLED, /*!< Initiate enabled state. */
53  LCTR_EXT_INIT_STATE_SHUTDOWN, /*!< Initiate shutdown in progress. */
54  LCTR_EXT_INIT_STATE_RESET, /*!< Initiate reset in progress. */
55  LCTR_EXT_INIT_STATE_TOTAL /*!< Total number of initiate states. */
56 };
57 
58 /**************************************************************************************************
59  Data Types
60 **************************************************************************************************/
61 /*! \brief Extended initiating control block. */
62 typedef struct
63 {
64  /* Initiate */
65  uint64_t peerAddr; /*!< Initiating peer address. */
66  uint8_t peerAddrType; /*!< Initiating peer address type. */
67  uint8_t estConnPhys; /*!< PHYs which established connections. */
68 
69  /* State. */
70  uint8_t enaPhys; /*!< Enabled PHYs. */
71 
73 
74 /**************************************************************************************************
75  Globals
76 **************************************************************************************************/
77 
78 extern lctrExtScanCtx_t lctrMstExtInitTbl[LCTR_SCAN_PHY_TOTAL];
79 extern lctrExtInitCtrlBlk_t lctrMstExtInit;
80 
81 /**************************************************************************************************
82  Function Declarations
83 **************************************************************************************************/
84 
85 /* State machine */
86 void lctrMstExtInitExecuteSm(lctrExtScanCtx_t *pExtInitCtx, uint8_t event);
87 
88 /* Builder */
89 uint8_t lctrMstExtInitiateBuildOp(lctrExtScanCtx_t *pExtInitCtx, LlConnSpec_t *pConnSpec, uint64_t peerAddr, uint8_t peerAddrType);
90 uint8_t lctrMstAuxInitiateBuildOp(lctrExtScanCtx_t *pExtInitCtx, LlConnSpec_t *pConnSpec, uint64_t peerAddr, uint8_t peerAddrType);
91 void lctrMstExtInitiateOpCommit(lctrExtScanCtx_t *pExtInitCtx);
92 
93 /* ISR: Initiate packet handlers */
94 bool_t lctrMstInitiateRxExtAdvPktHandler(BbOpDesc_t *pOp, const uint8_t *pAdvBuf);
95 void lctrMstInitiateRxExtAdvPktPostProcessHandler(BbOpDesc_t *pOp, const uint8_t *pAdvBuf);
96 bool_t lctrMstInitiateRxAuxAdvPktHandler(BbOpDesc_t *pOp, const uint8_t *pAdvBuf);
97 bool_t lctrMstInitiateRxAuxConnRspHandler(BbOpDesc_t *pOp, const uint8_t *pRspBuf);
98 bool_t lctrMstExtConnIndTxCompHandler(BbOpDesc_t *pOp, const uint8_t *pIndBuf);
99 
100 /* ISR: Initiate BOD callback */
101 void lctrMstExtInitiateEndOp(BbOpDesc_t *pOp);
102 void lctrMstAuxInitiateEndOp(BbOpDesc_t *pOp);
103 void lctrMstExtInitiateScanEndOp(BbOpDesc_t *pOp);
104 void lctrMstAuxInitiateScanEndOp(BbOpDesc_t *pOp);
105 
106 /* Action routines. */
107 void lctrExtInitActConnect(lctrExtScanCtx_t *pExtInitCtx);
108 void lctrExtInitActShutdown(lctrExtScanCtx_t *pExtInitCtx);
109 void lctrExtInitActScanTerm(lctrExtScanCtx_t *pExtInitCtx);
110 void lctrExtInitActDisallowInitiate(lctrExtScanCtx_t *pExtInitCtx);
111 void lctrExtInitActDisallowCancel(lctrExtScanCtx_t *pExtInitCtx);
112 
113 /* Helper routines. */
114 void lctrMstExtInitCleanupOp(lctrExtScanCtx_t *pExtInitCtx);
115 void lctrScanNotifyHostInitiateError(uint8_t reason, uint8_t peerAddrType, uint64_t peerAddr);
116 uint8_t lctrExtInitSetupInitiate(lctrExtScanCtx_t *pExtInitCtx, uint8_t peerAddrType, uint64_t peerAddr, uint8_t filtPolicy, uint8_t ownAddrType);
117 
118 /* Messaging */
119 void lctrSendExtInitMsg(lctrExtScanCtx_t *pExtScanCtx, uint8_t event);
120 
121 #ifdef __cplusplus
122 };
123 #endif
124 
125 #endif /* LCTR_INT_INIT_MASTER_AE_H */
Extended initiating control block.
Link layer controller extended initiating master interface file.
Internal link layer controller master connection interface file.
Extended scanning context.
Internal link layer controller extended scanning master interface file.
Internal link layer controller connection interface file.
Baseband operation descriptor (BOD).
Definition: bb_api.h:149
Connection specification (LlCreateConn(), LlConnUpdate() and LlExtCreateConn()).
Definition: ll_api.h:624
Internal link layer controller interface file.
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.