TI BLE5-Stack API Documentation  2.01.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 0x1
59 #define RTLS_REQ_CONN 0x2
60 #define RTLS_REQ_SCAN 0x3
61 #define RTLS_REQ_SEND_DATA 0x4
62 #define RTLS_REQ_TERMINATE_LINK 0x5
63 #define RTLS_REQ_SET_AOA_PARAMS 0x6
64 #define RTLS_REQ_AOA_ENABLE 0x7
65 #define RTLS_REQ_UPDATE_CONN_INTERVAL 0x8
66 #define RTLS_REQ_GET_ACTIVE_CONN_INFO 0x9
67 
68 #define RTLS_REQ_BLE_LOG_STRINGS_MAX 0x9
69 extern char *rtlsReq_BleLogStrings[];
70 
71 // Chip Identifier Address
72 #define CHIP_ID_ADDR ((uint8_t *)(0x50001000 + 0x2E8))
73 #define CHIP_ID_SIZE 6
74 
75 #define RTLS_FALSE 0
76 #define RTLS_TRUE 1
77 
78 // Connection Handle defines
79 #define RTLS_CONNHANDLE_ALL 0xFFFD // All connection handles
80 #define RTLS_CONNHANDLE_INVALID 0xFFFF // Invalid connection handle, used for no connection handle
81 
82 /*********************************************************************
83  * MACROS
84  */
85 
86 /*********************************************************************
87  * TYPEDEFS
88  */
89 
91 typedef void (*pfnRtlsAppCb)(uint8_t *cmd);
92 
94 typedef enum
95 {
96  RTLS_SUCCESS,
97  RTLS_FAIL,
98  RTLS_LINK_ESTAB_FAIL,
99  RTLS_LINK_TERMINATED,
100  RTLS_OUT_OF_MEMORY,
101  RTLS_CONFIG_NOT_SUPPORTED,
102  RTLS_ILLEGAL_CMD
103 } rtlsStatus_e;
104 
106 typedef enum
107 {
108  RTLS_CAP_NOT_INITIALIZED = 0x00000000,
109  RTLS_CAP_CM = 0x00000001,
110  RTLS_CAP_AOA_TX = 0x00000002,
111  RTLS_CAP_AOA_RX = 0x00000004,
112  RTLS_CAP_RESERVED1 = 0x00000008,
113  RTLS_CAP_RESERVED2 = 0x00000010,
114  RTLS_CAP_RESERVED3 = 0x00000020,
115  RTLS_CAP_RTLS_SLAVE = 0x00000040,
116  RTLS_CAP_RTLS_MASTER = 0x00000080,
117  RTLS_CAP_RTLS_PASSIVE = 0x00000100
119 
121 typedef struct
122 {
124  uint8_t identifier[CHIP_ID_SIZE];
125  uint16_t revNum;
126  uint8_t devId;
127  uint8_t maxNumConns;
130 
132 typedef struct
133 {
134  uint8_t reqOp;
135  uint8_t *pData;
136 } rtlsCtrlReq_t;
137 
139 typedef struct
140 {
141  uint16_t connHandle;
142  uint8_t cmdOp;
143  uint16_t payloadLen;
144  uint8_t pPayload[];
145 } rtlsPacket_t;
146 
148 typedef struct
149 {
150  uint16_t connHandle;
151  uint8_t enable;
153 
155 typedef struct
156 {
157  uint16_t connHandle;
158  uint16_t connInterval;
160 
162 typedef struct
163 {
164  uint16_t connHandle;
166 
168 typedef struct
169 {
170  uint16_t connHandle;
172 
173 /*********************************************************************
174  * API FUNCTIONS
175  */
176 
184 void RTLSCtrl_open(rtlsConfiguration_t *rtlsConfig);
185 
196 void RTLSCtrl_scanResultEvt(rtlsStatus_e status, uint8_t *scanResult, uint8_t size);
197 
206 void RTLSCtrl_connResultEvt(uint16_t connHandle, uint8_t status);
207 
216 void RTLSCtrl_connInfoEvt(uint8_t *connInfo, uint16_t connInfoLen);
217 
225 void RTLSCtrl_rtlsPacketEvt(uint8_t *pPkt);
226 
240 void RTLSCtrl_syncNotifyEvt(uint16_t connHandle, rtlsStatus_e status, uint32_t timeToNextEvent, int8_t rssi, uint8_t channel);
241 
251 void RTLSCtrl_dataSentEvt(uint16_t connHandle, uint8_t status);
252 
269 void RTLSCtrl_aoaResultEvt(uint16_t connHandle, 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);
270 
279 void RTLSCtrl_sendDebugEvt(uint8_t *debug_string, uint32_t debug_value);
280 
281 /*********************************************************************
282 *********************************************************************/
283 
284 
285 #ifdef __cplusplus
286 }
287 #endif
288 
289 #endif /* RTLS_CTRL_API_H_ */
290 
#define CHIP_ID_SIZE
Chip Identifier Size.
Definition: rtls_ctrl_api.h:73
RTLS Configuration structure.
Definition: rtls_ctrl_api.h:121
uint8_t * pData
Pointer to request.
Definition: rtls_ctrl_api.h:135
void RTLSCtrl_dataSentEvt(uint16_t connHandle, uint8_t status)
RTLSCtrl_dataSentEvt.
rtlsCapabilities_e
Enumeration for RTLS Capabilities.
Definition: rtls_ctrl_api.h:106
uint8_t cmdOp
RTLS Application Command Opcode.
Definition: rtls_ctrl_api.h:142
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(* pfnRtlsAppCb)(uint8_t *cmd)
Application callback function.
Definition: rtls_ctrl_api.h:91
RTLS Enable Sync - This will tell the RTLS Application to start notifying RTLS Control about a specif...
Definition: rtls_ctrl_api.h:148
uint16_t payloadLen
Length.
Definition: rtls_ctrl_api.h:143
uint16_t revNum
Revision.
Definition: rtls_ctrl_api.h:125
void RTLSCtrl_aoaResultEvt(uint16_t connHandle, 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)
RTLSCtrl_aoaResultEvt.
rtlsCapabilities_e rtlsCapab
RTLS Capabilities.
Definition: rtls_ctrl_api.h:123
uint8_t reqOp
Request Opcode.
Definition: rtls_ctrl_api.h:134
uint16_t connHandle
Connection handle.
Definition: rtls_ctrl_api.h:157
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:139
pfnRtlsAppCb rtlsAppCb
Application callback function.
Definition: rtls_ctrl_api.h:128
rtlsStatus_e
Enumeration for RTLS Status.
Definition: rtls_ctrl_api.h:94
RTLS Get Active Connection Info - get the connection information for a specific handle.
Definition: rtls_ctrl_api.h:168
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:132
uint16_t connHandle
Connection handle.
Definition: rtls_ctrl_api.h:141
uint8_t maxNumConns
Maximum number of connections to support.
Definition: rtls_ctrl_api.h:127
RTLS update connection interval request.
Definition: rtls_ctrl_api.h:155
uint8_t devId
Device ID.
Definition: rtls_ctrl_api.h:126
uint16_t connInterval
Connection interval.
Definition: rtls_ctrl_api.h:158
© Copyright 1995-2020, Texas Instruments Incorporated. All rights reserved.
Trademarks | Privacy policy | Terms of use | Terms of sale