Mistake on this page?
Report an issue in GitHub or email us
lctr_api_adv_slave_ae.h
Go to the documentation of this file.
1 /*************************************************************************************************/
2 /*!
3  * \file
4  *
5  * \brief Link layer controller extended advertising slave interface file.
6  *
7  * Copyright (c) 2013-2019 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_API_ADV_SLAVE_AE_H
26 #define LCTR_API_ADV_SLAVE_AE_H
27 
28 #include "lctr_api.h"
29 #include "lmgr_api_adv_slave_ae.h"
30 #include "cfg_mac_ble.h"
31 
32 #ifdef __cplusplus
33 extern "C" {
34 #endif
35 
36 /**************************************************************************************************
37  Constants
38 **************************************************************************************************/
39 
40 /*! \brief Slave extended advertising task messages for \a LCTR_DISP_EXT_ADV dispatcher. */
41 enum
42 {
43  /* Broadcast events */
44  LCTR_EXT_ADV_MSG_RESET = LCTR_MSG_RESET, /*!< Reset API message. */
45  /* Advertising events */
46  LCTR_EXT_ADV_MSG_START, /*!< Extended advertising start API event. */
47  LCTR_EXT_ADV_MSG_STOP, /*!< Extended advertising stop API event. */
48  LCTR_EXT_ADV_MSG_INT_START, /*!< Extended advertising start internal event. */
49  LCTR_EXT_ADV_MSG_TERMINATE, /*!< Extended advertising BOD terminated event. */
50  LCTR_EXT_ADV_MSG_TMR_DUR_EXP, /*!< Extended advertising duration timer expired event. */
51  LCTR_EXT_ADV_MSG_TOTAL /*!< Total number of extended advertising events. */
52 };
53 
54 /*! \brief Slave periodic advertising task messages for \a LCTR_DISP_PER_ADV dispatcher. */
55 enum
56 {
57  /* Broadcast events */
58  LCTR_PER_ADV_MSG_RESET = LCTR_MSG_RESET, /*!< Reset API message. */
59  /* Advertising events */
60  LCTR_PER_ADV_MSG_START, /*!< Periodic advertising start API event. */
61  LCTR_PER_ADV_MSG_STOP, /*!< Periodic advertising stop API event. */
62  LCTR_PER_ADV_MSG_TERMINATE, /*!< Periodic advertising BOD terminated event. */
63  LCTR_PER_ADV_MSG_TOTAL /*!< Total number of periodic advertising events. */
64 };
65 
66 /*! \brief ACAD dispatcher messages */
67 enum
68 {
69  LCTR_ACAD_MSG_CHAN_UPDATE, /* Start a channel map update */
70  LCTR_ACAD_MSG_CHAN_UPDATE_FINISH, /* Finish a channel map update */
71  LCTR_ACAD_MSG_BIG_CREATED, /* BIG is created*/
72  LCTR_ACAD_MSG_BIG_TERMINATED, /* BIG is terminated */
73  LCTR_ACAD_MSG_TOTAL
74 };
75 
76 /*! \brief Link layer controller message data. */
77 typedef union
78 {
79  lctrMsgHdr_t hdr; /*!< Message header. */
80  lctrChanMapUpdate_t chanMapUpd; /*!< ACAD channel map update. */
81  lctrBigCreated_t bigCreated; /*!< ACAD BIG created. */
83 
84 /**************************************************************************************************
85  Data Types
86 **************************************************************************************************/
87 
88 /*! \brief Extended Advertising enable message. */
89 typedef struct
90 {
91  lctrMsgHdr_t hdr; /*!< Message header. */
92  uint32_t durMs; /*!< Duration in milliseconds. */
93  uint8_t maxEvents; /*!< Maximum number of extended advertising events. */
95 
96 /*! \brief Periodic Advertising enable message. */
97 typedef struct
98 {
99  lctrMsgHdr_t hdr; /*!< Message header. */
101 
102 /*! \brief Extended Advertising message data. */
103 typedef union
104 {
105  lctrMsgHdr_t hdr; /*!< Message header. */
106  LctrExtAdvEnableMsg_t enable; /*!< Enable message data. */
108 
109 /*! \brief Periodic Advertising message data. */
110 typedef union
111 {
112  lctrMsgHdr_t hdr; /*!< Message header. */
113  LctrPerAdvEnableMsg_t perEnable; /*!< Periodic enable message data. */
114  lctrChanMapUpdate_t chanUpdate; /*!< Channel map update data. */
116 
117 /**************************************************************************************************
118  Function Declarations
119 **************************************************************************************************/
120 
121 /* Initialization */
122 void LctrSlvExtAdvInit(void);
123 void LctrSlvExtAdvDefaults(void);
124 void LctrSlvPeriodicAdvInit(void);
125 
126 /* Status */
127 uint8_t LctrIsExtAdvEnableParamValid(uint8_t enable, LlExtAdvEnableParam_t *pEnaParam);
128 uint8_t LctrIsExtAdvEnableReady(uint8_t handle);
129 bool_t LctrIsAdvHandleValid(uint8_t handle);
130 uint8_t LctrGetExtAdvTxPowerLevel(uint16_t handle, int8_t *pLevel);
131 bool_t LctrIsPerAdvEnabled(uint8_t handle);
132 
133 /* Control */
134 uint8_t LctrGetAdvHandles(uint8_t pHandles[LL_MAX_ADV_SETS]);
135 uint8_t LctrSetExtAdvSetRandAddr(uint8_t handle, const uint8_t *pAddr);
136 uint8_t LctrGetExtAdvSetRandAddr(uint8_t handle, uint8_t *pAddr);
137 uint8_t LctrSetExtAdvParam(uint8_t handle, LlExtAdvParam_t *pExtAdvParam);
138 uint8_t LctrSetExtAdvData(uint8_t handle, uint8_t op, uint8_t fragPref, uint8_t len, const uint8_t *pData);
139 uint64_t LctrGetPerAdvChanMap(uint8_t handle);
140 uint8_t LctrSetExtScanRespData(uint8_t handle, uint8_t op, uint8_t fragPref, uint8_t len, const uint8_t *pData);
141 uint8_t LctrRemoveAdvSet(uint8_t handle);
142 uint8_t LctrClearAdvSets(void);
143 uint8_t LctrSetAuxOffsetDelay(uint8_t handle, uint32_t delayUsec);
144 uint8_t LctrSetExtAdvDataFragLen(uint8_t handle, uint8_t fragLen);
145 uint8_t LctrSetExtAdvTxPhyOptions(uint8_t handle, uint8_t priPhyOpts, uint8_t secPhyOpts);
146 uint8_t LctrSetPeriodicAdvParam(uint8_t handle, LlPerAdvParam_t *pPerAdvParam);
147 uint8_t LctrPeriodicAdvSetInfoTransfer(uint16_t connHandle, uint16_t serviceData, uint8_t advHandle);
148 uint8_t LctrSetPeriodicAdvSyncTransParams(uint16_t connHandle, uint8_t mode, uint16_t skip, uint16_t syncTimeout, uint8_t cteType);
149 void LctrSetPeriodicAdvEnable(uint8_t handle, bool_t enable);
150 uint8_t LctrSetPeriodicAdvData(uint8_t handle, uint8_t op, uint8_t len, const uint8_t *pData);
151 
152 #ifdef __cplusplus
153 };
154 #endif
155 
156 #endif /* LCTR_API_ADV_SLAVE_AE_H */
LctrExtAdvEnableMsg_t enable
Periodic Advertising enable message.
#define LL_MAX_ADV_SETS
Definition: cfg_mac_ble.h:55
Link layer controller message data.
Channel map update message.
Definition: lctr_api.h:117
Periodic Advertising message data.
BLE MAC system configuration.
Link layer controller common interface file.
lctrChanMapUpdate_t chanMapUpd
Extended Advertising message data.
BIG created message.
Definition: lctr_api.h:124
Periodic advertising parameters.
Definition: ll_api.h:391
Extended Advertising enable message.
lctrBigCreated_t bigCreated
lctrChanMapUpdate_t chanUpdate
Extended advertising enable parameters.
Definition: ll_api.h:383
Common message structure passed to event handler.
Definition: lctr_api.h:109
Extended advertising parameters.
Definition: ll_api.h:364
LctrPerAdvEnableMsg_t perEnable
Link layer manager advertising extension 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.