TI BLE5-Stack API Documentation  2.02.03.00
rtls_ctrl_api.h
Go to the documentation of this file.
1 /******************************************************************************
2 
3  @file rtls_ctrl_api.h
4 
5  @brief This file contains the RTLS Control API's
6 
7  Group: WCS, BTS
8  $Target Device: DEVICES $
9 
10  ******************************************************************************
11  $License: BSD3 2018 $
12  ******************************************************************************
13  $Release Name: PACKAGE NAME $
14  $Release Date: PACKAGE RELEASE DATE $
15  *****************************************************************************/
16 
26 #ifndef RTLS_CTRL_API_H_
27 #define RTLS_CTRL_API_H_
28 
29 #ifdef __cplusplus
30 extern "C"
31 {
32 #endif
33 
34 /*********************************************************************
35  * INCLUDES
36  */
37 #include <stdint.h>
38 
39 /*********************************************************************
40 * EXTERNAL FUNCTIONS
41 */
42 
43 extern void AssertHandler(uint8 assertCause, uint8 assertSubcause);
44 
45 /*********************************************************************
46  * CONSTANTS
47  */
48 
49 // Error codes passed through Assert Handler
50 #define RTLS_CTRL_ASSERT_CAUSE_OUT_OF_MEMORY 0x01
51 #define RTLS_CTRL_ASSERT_CAUSE_INVALID_PARAM 0x02
52 #define RTLS_CTRL_ASSERT_CAUSE_NULL_POINTER_EXCEPT 0x03
53 
54 // RTLS Control version
55 #define RTLS_CTRL_REV 0x2
56 
57 // RTLS Application Command Opcodes
58 #define RTLS_REQ_ENABLE_SYNC 0x01
59 #define RTLS_REQ_CONN 0x02
60 #define RTLS_REQ_SCAN 0x03
61 #define RTLS_REQ_SEND_DATA 0x04
62 #define RTLS_REQ_TERMINATE_LINK 0x05
63 #define RTLS_REQ_SET_AOA_PARAMS 0x06
64 #define RTLS_REQ_AOA_ENABLE 0x07
65 #define RTLS_REQ_UPDATE_CONN_INTERVAL 0x08
66 #define RTLS_REQ_GET_ACTIVE_CONN_INFO 0x09
67 #define RTLS_REQ_SET_CREATE_SYNC_PARAMS 0x0A
68 #define RTLS_REQ_CREATE_SYNC_CANCEL 0x0B
69 #define RTLS_REQ_TERMINATE_SYNC 0x0C
70 #define RTLS_REQ_PERIODIC_RECEIVE_ENABLE 0x0D
71 #define RTLS_REQ_ADD_DEVICE_ADV_LIST 0x0E
72 #define RTLS_REQ_REMOVE_DEVICE_ADV_LIST 0x0F
73 #define RTLS_REQ_READ_ADV_LIST_SIZE 0x10
74 #define RTLS_REQ_CLEAR_ADV_LIST 0x11
75 #define RTLS_REQ_CL_AOA_ENABLE 0x12
76 
77 #define RTLS_REQ_BLE_LOG_STRINGS_MAX 0x9
78 extern char *rtlsReq_BleLogStrings[];
79 
80 // Chip Identifier Address
81 #define CHIP_ID_ADDR ((uint8_t *)(0x50001000 + 0x2E8))
82 #define CHIP_ID_SIZE 6
83 
84 #define RTLS_FALSE 0
85 #define RTLS_TRUE 1
86 
87 // Connection Handle defines
88 #define RTLS_CONNHANDLE_ALL 0xFFFD // All connection handles
89 #define RTLS_CONNHANDLE_INVALID 0xFFFF // Invalid connection handle, used for no connection handle
90 
91 /*********************************************************************
92  * MACROS
93  */
94 
95 /*********************************************************************
96  * TYPEDEFS
97  */
98 
100 typedef void (*pfnRtlsAppCb)(uint8_t *cmd);
101 
103 typedef enum
104 {
105  RTLS_SUCCESS,
106  RTLS_FAIL,
107  RTLS_LINK_ESTAB_FAIL,
108  RTLS_LINK_TERMINATED,
109  RTLS_OUT_OF_MEMORY,
110  RTLS_CONFIG_NOT_SUPPORTED,
111  RTLS_ILLEGAL_CMD
112 } rtlsStatus_e;
113 
115 typedef enum
116 {
117  RTLS_CAP_NOT_INITIALIZED = 0x00000000,
118  RTLS_CAP_CM = 0x00000001,
119  RTLS_CAP_AOA_TX = 0x00000002,
120  RTLS_CAP_AOA_RX = 0x00000004,
121  RTLS_CAP_RESERVED1 = 0x00000008,
122  RTLS_CAP_CL_AOA = 0x00000010,
123  RTLS_CAP_RESERVED3 = 0x00000020,
124  RTLS_CAP_RTLS_RESPONDER = 0x00000040,
125  RTLS_CAP_RTLS_COORDINATOR = 0x00000080,
126  RTLS_CAP_RTLS_PASSIVE = 0x00000100,
127  RTLS_CAP_RTLS_CONNECTION_MONITOR = 0x00000200
129 
131 typedef struct
132 {
134  uint8_t identifier[CHIP_ID_SIZE];
135  uint16_t revNum;
136  uint8_t devId;
137  uint8_t maxNumConns;
140 
142 typedef struct
143 {
144  uint8_t reqOp;
145  uint8_t *pData;
146 } rtlsCtrlReq_t;
147 
149 typedef struct
150 {
151  uint16_t connHandle;
152  uint8_t cmdOp;
153  uint16_t payloadLen;
154  uint8_t pPayload[];
155 } rtlsPacket_t;
156 
158 typedef struct
159 {
160  uint16_t connHandle;
161  uint8_t enable;
163 
165 typedef struct
166 {
167  uint16_t connHandle;
168  uint16_t connInterval;
170 
172 typedef struct
173 {
174  uint16_t connHandle;
176 
178 typedef struct
179 {
180  uint16_t connHandle;
182 
183 /*********************************************************************
184  * API FUNCTIONS
185  */
186 
194 void RTLSCtrl_open(rtlsConfiguration_t *rtlsConfig);
195 
206 void RTLSCtrl_scanResultEvt(rtlsStatus_e status, uint8_t *scanResult, uint8_t size);
207 
216 void RTLSCtrl_connResultEvt(uint16_t connHandle, uint8_t status);
217 
226 void RTLSCtrl_connInfoEvt(uint8_t *connInfo, uint16_t connInfoLen);
227 
235 void RTLSCtrl_rtlsPacketEvt(uint8_t *pPkt);
236 
250 void RTLSCtrl_syncNotifyEvt(uint16_t connHandle, rtlsStatus_e status, uint32_t timeToNextEvent, int8_t rssi, uint8_t channel);
251 
261 void RTLSCtrl_dataSentEvt(uint16_t connHandle, uint8_t status);
262 
271 void RTLSCtrl_sendDebugEvt(uint8_t *debug_string, uint32_t debug_value);
272 
280 void RTLSCtrl_sendPeriodicListSize(uint8_t *pEvt);
281 
297 void RTLSCtrl_processSyncEstEvt(uint8_t opcode,
298  uint8_t status,
299  uint16_t syncHandle,
300  uint8_t advSid,
301  uint8_t advAddrType,
302  uint8_t advAddress[6],
303  uint8_t advPhy,
304  uint16_t periodicAdvInt,
305  uint8_t advClockAccuracy);
306 
315 void RTLSCtrl_processSyncLostEvt(uint8_t opcode,
316  uint16_t syncHandle);
317 
318 #ifdef RTLS_CTE
319 
335 void RTLSCtrl_aoaResultEvt(uint16_t handle, int8_t rssi, uint8_t channel, uint16_t numIqSamples, uint8_t sampleRate, uint8_t sampleSize, uint8_t sampleCtrl, uint8_t slotDuration, uint8_t numAnt, int8_t *pIQ);
336 
346 void RTLSCtrl_processClAoaEnableEvt(uint16_t opcode,
347  uint8_t status,
348  uint16_t syncHandle);
349 #endif /* RTLS_CTE*/
350 
359 
374 void RTLSCTRL_processPeriodicAdvReport( uint8_t opcode,
375  uint16_t syncHandle,
376  int8_t txPower,
377  int8_t rssi,
378  uint8_t cteType,
379  uint8_t dataStatus,
380  uint8_t dataLen,
381  uint8_t *pData);
382 
383 /*********************************************************************
384 *********************************************************************/
385 
386 
387 #ifdef __cplusplus
388 }
389 #endif
390 
391 #endif /* RTLS_CTRL_API_H_ */
392 
#define CHIP_ID_SIZE
Chip Identifier Size.
Definition: rtls_ctrl_api.h:82
void RTLSCtrl_processSyncLostEvt(uint8_t opcode, uint16_t syncHandle)
RTLS Configuration structure.
Definition: rtls_ctrl_api.h:131
uint8_t * pData
Pointer to request.
Definition: rtls_ctrl_api.h:145
void RTLSCtrl_dataSentEvt(uint16_t connHandle, uint8_t status)
RTLSCtrl_dataSentEvt.
rtlsCapabilities_e
Enumeration for RTLS Capabilities.
Definition: rtls_ctrl_api.h:115
uint8_t cmdOp
RTLS Application Command Opcode.
Definition: rtls_ctrl_api.h:152
void RTLSCtrl_scanResultEvt(rtlsStatus_e status, uint8_t *scanResult, uint8_t size)
RTLSCtrl_scanResultEvt.
void RTLSCtrl_sendDebugEvt(uint8_t *debug_string, uint32_t debug_value)
RTLSCtrl_sendDebugEvt.
void RTLSCtrl_connResultEvt(uint16_t connHandle, uint8_t status)
RTLSCtrl_connResultEvt.
void RTLSCtrl_rtlsPacketEvt(uint8_t *pPkt)
RTLSCtrl_rtlsPacketEvt.
void RTLSCtrl_connInfoEvt(uint8_t *connInfo, uint16_t connInfoLen)
RTLSCtrl_connInfoEvt.
void RTLSCtrl_processSyncEstEvt(uint8_t opcode, uint8_t status, uint16_t syncHandle, uint8_t advSid, uint8_t advAddrType, uint8_t advAddress[6], uint8_t advPhy, uint16_t periodicAdvInt, uint8_t advClockAccuracy)
RTLSCtrl_processSyncEstEvt.
void(* pfnRtlsAppCb)(uint8_t *cmd)
Application callback function.
Definition: rtls_ctrl_api.h:100
RTLS Enable Sync - This will tell the RTLS Application to start notifying RTLS Control about a specif...
Definition: rtls_ctrl_api.h:158
uint16_t payloadLen
Length.
Definition: rtls_ctrl_api.h:153
void RTLSCTRL_processPeriodicAdvReport(uint8_t opcode, uint16_t syncHandle, int8_t txPower, int8_t rssi, uint8_t cteType, uint8_t dataStatus, uint8_t dataLen, uint8_t *pData)
uint16_t revNum
Revision.
Definition: rtls_ctrl_api.h:135
void RTLSCtrl_sendPeriodicListSize(uint8_t *pEvt)
RTLSCtrl_sendPeriodicListSize.
rtlsCapabilities_e rtlsCapab
RTLS Capabilities.
Definition: rtls_ctrl_api.h:133
uint8_t reqOp
Request Opcode.
Definition: rtls_ctrl_api.h:144
uint16_t connHandle
Connection handle.
Definition: rtls_ctrl_api.h:167
void RTLSCtrl_open(rtlsConfiguration_t *rtlsConfig)
RTLSCtrl_open.
RTLS Packet - Generic structure that will be translated to a specific command.
Definition: rtls_ctrl_api.h:149
pfnRtlsAppCb rtlsAppCb
Application callback function.
Definition: rtls_ctrl_api.h:138
rtlsStatus_e
Enumeration for RTLS Status.
Definition: rtls_ctrl_api.h:103
RTLS Get Active Connection Info - get the connection information for a specific handle.
Definition: rtls_ctrl_api.h:178
void RTLSCtrl_processTerminateSyncEvt(void)
void RTLSCtrl_syncNotifyEvt(uint16_t connHandle, rtlsStatus_e status, uint32_t timeToNextEvent, int8_t rssi, uint8_t channel)
RTLSCtrl_syncNotifyEvt.
RTLS Control request.
Definition: rtls_ctrl_api.h:142
uint16_t connHandle
Connection handle.
Definition: rtls_ctrl_api.h:151
uint8_t maxNumConns
Maximum number of connections to support.
Definition: rtls_ctrl_api.h:137
RTLS update connection interval request.
Definition: rtls_ctrl_api.h:165
uint8_t devId
Device ID.
Definition: rtls_ctrl_api.h:136
uint16_t connInterval
Connection interval.
Definition: rtls_ctrl_api.h:168
© Copyright 1995-2021, Texas Instruments Incorporated. All rights reserved.
Trademarks | Privacy policy | Terms of use | Terms of sale