TI BLE5-Stack API Documentation  2.01.01.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 // RTLS Control version
50 #define RTLS_CTRL_REV 0x2
51 
52 // RTLS Application Command Opcodes
53 #define RTLS_REQ_ENABLE_SYNC 0x1
54 #define RTLS_REQ_CONN 0x2
55 #define RTLS_REQ_SCAN 0x3
56 #define RTLS_REQ_SEND_DATA 0x4
57 #define RTLS_REQ_TERMINATE_LINK 0x5
58 #define RTLS_REQ_SET_AOA_PARAMS 0x6
59 #define RTLS_REQ_AOA_ENABLE 0x7
60 #define RTLS_REQ_UPDATE_CONN_INTERVAL 0x8
61 #define RTLS_REQ_GET_ACTIVE_CONN_INFO 0x9
62 
63 // Chip Identifier Address
64 #define CHIP_ID_ADDR ((uint8_t *)(0x50001000 + 0x2E8))
65 #define CHIP_ID_SIZE 6
66 
67 #define RTLS_FALSE 0
68 #define RTLS_TRUE 1
69 
70 // Connection Handle defines
71 #define RTLS_CONNHANDLE_ALL 0xFFFD // All connection handles
72 #define RTLS_CONNHANDLE_INVALID 0xFFFF // Invalid connection handle, used for no connection handle
73 
74 /*********************************************************************
75  * MACROS
76  */
77 
78 /*********************************************************************
79  * TYPEDEFS
80  */
81 
83 typedef void (*pfnRtlsAppCb)(uint8_t *cmd);
84 
86 typedef enum
87 {
88  RTLS_SUCCESS,
89  RTLS_FAIL,
90  RTLS_LINK_ESTAB_FAIL,
91  RTLS_LINK_TERMINATED,
92  RTLS_OUT_OF_MEMORY,
93  RTLS_CONFIG_NOT_SUPPORTED,
94  RTLS_ILLEGAL_CMD
95 } rtlsStatus_e;
96 
98 typedef enum
99 {
100  RTLS_CAP_NOT_INITIALIZED = 0x00000000,
101  RTLS_CAP_CM = 0x00000001,
102  RTLS_CAP_AOA_TX = 0x00000002,
103  RTLS_CAP_AOA_RX = 0x00000004,
104  RTLS_CAP_TOF_SLAVE = 0x00000008,
105  RTLS_CAP_TOF_PASSIVE = 0x00000010,
106  RTLS_CAP_TOF_MASTER = 0x00000020,
107  RTLS_CAP_RTLS_SLAVE = 0x00000040,
108  RTLS_CAP_RTLS_MASTER = 0x00000080,
109  RTLS_CAP_RTLS_PASSIVE = 0x00000100
111 
113 typedef struct
114 {
116  uint8_t identifier[CHIP_ID_SIZE];
117  uint16_t revNum;
118  uint8_t devId;
119  uint8_t maxNumConns;
122 
124 typedef struct
125 {
126  uint8_t reqOp;
127  uint8_t *pData;
128 } rtlsCtrlReq_t;
129 
131 typedef struct
132 {
133  uint16_t connHandle;
134  uint8_t cmdOp;
135  uint16_t payloadLen;
136  uint8_t pPayload[];
137 } rtlsPacket_t;
138 
140 typedef struct
141 {
142  uint16_t connHandle;
143  uint8_t enable;
145 
147 typedef struct __attribute__((packed))
148 {
149  uint16_t connHandle;
150  uint16_t connInterval;
151 } rtlsUpdateConnIntReq_t;
152 
154 typedef struct __attribute__((packed))
155 {
156  uint16_t connHandle;
157 } rtlsTerminateLinkReq_t;
158 
160 typedef struct
161 {
162  uint16_t connHandle;
164 
165 /*********************************************************************
166  * API FUNCTIONS
167  */
168 
176 void RTLSCtrl_open(rtlsConfiguration_t *rtlsConfig);
177 
188 void RTLSCtrl_scanResultEvt(rtlsStatus_e status, uint8_t *scanResult, uint8_t size);
189 
198 void RTLSCtrl_connResultEvt(uint16_t connHandle, uint8_t status);
199 
208 void RTLSCtrl_connInfoEvt(uint8_t *connInfo, uint16_t connInfoLen);
209 
217 void RTLSCtrl_processRtlsPacket(uint8_t *pPkt);
218 
232 void RTLSCtrl_syncEventNotify(uint16_t connHandle, rtlsStatus_e status, uint32_t timeToNextEvent, int8_t rssi, uint8_t channel);
233 
243 void RTLSCtrl_processDataSent(uint16_t connHandle, uint8_t status);
244 
262 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 *pI, int8_t *pQ);
263 
272 void RTLSCtrl_sendDebugEvent(uint8_t *debug_string, uint32_t debug_value);
273 
274 /*********************************************************************
275 *********************************************************************/
276 
277 
278 #ifdef __cplusplus
279 }
280 #endif
281 
282 #endif /* RTLS_CTRL_API_H_ */
283 
#define CHIP_ID_SIZE
Chip Identifier Size.
Definition: rtls_ctrl_api.h:65
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 *pI, int8_t *pQ)
RTLSCtrl_aoaResultEvt.
void RTLSCtrl_sendDebugEvent(uint8_t *debug_string, uint32_t debug_value)
RTLSCtrl_sendDebugEvent.
RTLS Configuration structure.
Definition: rtls_ctrl_api.h:113
uint8_t * pData
Pointer to request.
Definition: rtls_ctrl_api.h:127
void RTLSCtrl_processRtlsPacket(uint8_t *pPkt)
RTLSCtrl_processRtlsPacket.
rtlsCapabilities_e
Enumeration for RTLS Capabilities.
Definition: rtls_ctrl_api.h:98
uint8_t cmdOp
RTLS Application Command Opcode.
Definition: rtls_ctrl_api.h:134
void RTLSCtrl_scanResultEvt(rtlsStatus_e status, uint8_t *scanResult, uint8_t size)
RTLS Control Scan Results.
void RTLSCtrl_connResultEvt(uint16_t connHandle, uint8_t status)
RTLS Control Connection Results.
void RTLSCtrl_connInfoEvt(uint8_t *connInfo, uint16_t connInfoLen)
RTLS Control Connection Info.
void(* pfnRtlsAppCb)(uint8_t *cmd)
Application callback function.
Definition: rtls_ctrl_api.h:83
RTLS Enable Sync - This will tell the RTLS Application to start notifying RTLS Control about a specif...
Definition: rtls_ctrl_api.h:140
void RTLSCtrl_processDataSent(uint16_t connHandle, uint8_t status)
RTLS Application Data Sent.
uint16_t payloadLen
Length.
Definition: rtls_ctrl_api.h:135
uint16_t revNum
Revision.
Definition: rtls_ctrl_api.h:117
rtlsCapabilities_e rtlsCapab
RTLS Capabilities.
Definition: rtls_ctrl_api.h:115
uint8_t reqOp
Request Opcode.
Definition: rtls_ctrl_api.h:126
void RTLSCtrl_syncEventNotify(uint16_t connHandle, rtlsStatus_e status, uint32_t timeToNextEvent, int8_t rssi, uint8_t channel)
RTLSCtrl_syncEventNotify.
void RTLSCtrl_open(rtlsConfiguration_t *rtlsConfig)
RTLSCtrl_open.
struct __attribute__((packed))
RTLS update connection interval request.
Definition: rtls_ctrl_api.h:147
RTLS Packet - Generic structure that will be translated to a specific command.
Definition: rtls_ctrl_api.h:131
pfnRtlsAppCb rtlsAppCb
Application callback function.
Definition: rtls_ctrl_api.h:120
rtlsStatus_e
Enumeration for RTLS Status.
Definition: rtls_ctrl_api.h:86
RTLS Get Active Connection Info - get the connection information for a specific handle.
Definition: rtls_ctrl_api.h:160
RTLS Control request.
Definition: rtls_ctrl_api.h:124
uint16_t connHandle
Connection handle.
Definition: rtls_ctrl_api.h:133
uint8_t maxNumConns
Maximum number of connections to support.
Definition: rtls_ctrl_api.h:119
uint8_t devId
Device ID.
Definition: rtls_ctrl_api.h:118
© Copyright 1995-2019, Texas Instruments Incorporated. All rights reserved.
Trademarks | Privacy policy | Terms of use | Terms of sale