Mistake on this page?
Report an issue in GitHub or email us
lctr_int_cis_master.h
Go to the documentation of this file.
1 /*************************************************************************************************/
2 /*!
3  * \file
4  *
5  * \brief Internal link layer controller master connected isochronous stream interface file.
6  *
7  * Copyright (c) 2013-2018 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 LCTR_INT_CIS_MASTER_H
26 #define LCTR_INT_CIS_MASTER_H
27 
28 #include "lctr_int.h"
29 #include "lctr_int_conn.h"
30 #include "lctr_int_cis.h"
31 #include "lctr_api_cis_master.h"
32 #include "lmgr_api_cis_master.h"
33 #include "bb_ble_api.h"
34 #include "bb_ble_api_op.h"
35 #include "wsf_timer.h"
36 
37 #ifdef __cplusplus
38 extern "C" {
39 #endif
40 
41 /**************************************************************************************************
42  Macros
43 **************************************************************************************************/
44 
45 /**************************************************************************************************
46  Constants
47 **************************************************************************************************/
48 
49 /*! \brief CIS master establishment states. */
50 enum
51 {
52  LCTR_CIS_MST_EST_STATE_IDLE, /*!< Idle state. */
53  LCTR_CIS_MST_EST_STATE_CIS_RSP, /*!< Wait for LL_CIS_RSP state. */
54  LCTR_CIS_MST_EST_STATE_TOTAL /*!< Total CIS master establishment states. */
55 };
56 
57 /**************************************************************************************************
58  Data Types
59 **************************************************************************************************/
60 
61 /*! \brief Create CIS pending. */
62 typedef struct
63 {
64  uint8_t numCis; /*!< Number of CISs to create. */
65  uint16_t cisHandle[LL_MAX_CIS]; /*!< CIS handle array. */
66  uint16_t aclHandle[LL_MAX_CIS]; /*!< ACL handle array. */
67  uint8_t isCreateCisDone[LL_MAX_CIS]; /*!< TRUE if create CIS is done, either succeed or fail. */
69 
70 /**************************************************************************************************
71  Globals
72 **************************************************************************************************/
73 
74 /**************************************************************************************************
75  Function Declarations
76 **************************************************************************************************/
77 /* State machine for CIS LLCP */
78 bool_t lctrMstLlcpExecuteCisEstSm(lctrConnCtx_t *pCtx, uint8_t event);
79 
80 /* Builder */
81 void lctrMstCisBuildCigOp(lctrCigCtx_t *pCigCtx);
82 void lctrMstCisCigOpCommit(lctrCigCtx_t *pCigCtx, lctrConnCtx_t *pCtx, lctrCisCtx_t *pCisCtx);
83 void lctrMstCisBuildCisData(lctrCisCtx_t *pCisCtx);
84 
85 /* ISR: Packet handlers */
86 void lctrMstCisCigTxCompletion(BbOpDesc_t *pOp, uint8_t status);
87 void lctrMstCisCigRxCompletion(BbOpDesc_t *pOp, uint8_t *pRxBuf, uint8_t status);
88 
89 /* ISR: BOD handlers */
90 uint32_t lctrMstCisCheckContOp(BbOpDesc_t *pOp, bool_t *pNewCisCtx);
91 void lctrMstCisCigBeginOp(BbOpDesc_t *pOp);
92 void lctrMstCisCigContOp(BbOpDesc_t *pOp);
93 void lctrMstCisCigPostSubEvt(BbOpDesc_t *pOp, uint8_t status);
94 void lctrMstCisCigEndOp(BbOpDesc_t *pOp);
95 void lctrMstCisCigCleanupOp(BbOpDesc_t *pOp);
96 void lctrMstCisCigAbortOp(BbOpDesc_t *pOp);
97 
98 /* Action routines for CIS master LLCP state machine */
99 void lctrMstCisLlcpActHostCisReq(lctrConnCtx_t *pCtx, lctrCisCtx_t *pCisCtx);
100 void lctrMstCisLlcpActPeerRej(lctrConnCtx_t *pCtx, lctrCisCtx_t *pCisCtx);
101 void lctrMstCisLlcpActPeerCisRsp(lctrConnCtx_t *pCtx, lctrCisCtx_t *pCisCtx);
102 void lctrMstCisLlcpActRspTimeout(lctrConnCtx_t *pCtx, lctrCisCtx_t *pCisCtx);
103 void lctrMstCisLlcpActLocalReject(lctrConnCtx_t *pCtx, lctrCisCtx_t *pCisCtx);
104 
105 /* Reservation */
106 uint32_t lctrGetCigRefTime(uint8_t connHandle, uint32_t *pDurUsec);
107 
108 /* Utility function */
109 void lctrMstCreateCisDone(lctrCisCtx_t *pCisCtx);
110 
111 #ifdef __cplusplus
112 };
113 #endif
114 
115 #endif /* LCTR_INT_CIS_MASTER_H */
Internal link layer controller connected isochronous stream interface file.
Connection context.
BLE baseband interface file.
Link layer controller CIS master interface file.
Create CIS pending.
Connected isochronous stream context.
Definition: lctr_int_cis.h:147
#define LL_MAX_CIS
Definition: cfg_mac_ble.h:79
Link layer manager connected isochronous stream master interface file.
Internal link layer controller connection interface file.
Baseband operation descriptor (BOD).
Definition: bb_api.h:149
Connected isochronous group context.
Definition: lctr_int_cis.h:314
Timer service.
BLE baseband interface file.
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.