TI BLE5-Stack API Documentation  2.00.04.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 VARIABLES
41 */
42 
43 /*********************************************************************
44  * CONSTANTS
45  */
46 
47 // RTLS Application Command Opcodes
48 #define RTLS_REQ_ENABLE_SYNC 0x1
49 #define RTLS_REQ_CONN 0x2
50 #define RTLS_REQ_SCAN 0x3
51 #define RTLS_REQ_SEND_DATA 0x4
52 #define RTLS_REQ_TERMINATE_LINK 0x5
53 #define RTLS_REQ_SET_AOA_PARAMS 0x6
54 #define RTLS_REQ_AOA_ENABLE 0x7
55 
56 // Chip Identifier Address
57 #define CHIP_ID_ADDR ((uint8_t *)(0x50001000 + 0x2E8))
58 #define CHIP_ID_SIZE 6
59 
60 #define RTLS_FALSE 0
61 #define RTLS_TRUE 1
62 
63 /*********************************************************************
64  * MACROS
65  */
66 
67 /*********************************************************************
68  * TYPEDEFS
69  */
70 
72 typedef void (*pfnRtlsAppCb)(uint8_t *cmd);
73 
75 typedef enum
76 {
77  RTLS_SUCCESS,
78  RTLS_FAIL,
79  RTLS_LINK_LOST,
80  RTLS_LINK_ESTAB_FAIL,
81  RTLS_LINK_TERMINATED,
82  RTLS_OUT_OF_MEMORY,
83  RTLS_ILLEGAL_CMD
84 } rtlsStatus_e;
85 
87 typedef enum
88 {
89  RTLS_CAP_NOT_INITIALIZED = 0x00000000,
90  RTLS_CAP_CM = 0x00000001,
91  RTLS_CAP_AOA_TX = 0x00000002,
92  RTLS_CAP_AOA_RX = 0x00000004,
93  RTLS_CAP_TOF_SLAVE = 0x00000008,
94  RTLS_CAP_TOF_PASSIVE = 0x00000010,
95  RTLS_CAP_TOF_MASTER = 0x00000020,
96  RTLS_CAP_RTLS_SLAVE = 0x00000040,
97  RTLS_CAP_RTLS_MASTER = 0x00000080,
98  RTLS_CAP_RTLS_PASSIVE = 0x00000100
100 
102 typedef struct
103 {
105  uint8_t identifier[CHIP_ID_SIZE];
108 
110 typedef struct
111 {
112  uint8_t reqOp;
113  uint8_t *pData;
114 } rtlsCtrlReq_t;
115 
117 typedef struct
118 {
119  uint8_t cmdOp;
120  uint16_t payloadLen;
121  uint8_t pPayload[];
122 } rtlsPacket_t;
123 
124 /*********************************************************************
125  * API FUNCTIONS
126  */
127 
135 void RTLSCtrl_open(rtlsConfiguration_t *rtlsConfig);
136 
147 void RTLSCtrl_scanResultEvt(rtlsStatus_e status, uint8_t *scanResult, uint8_t size);
148 
156 void RTLSCtrl_connResultEvt(uint8_t status);
157 
166 void RTLSCtrl_connInfoEvt(uint8_t *connInfo, uint16_t connInfoLen);
167 
175 void RTLSCtrl_processRtlsPacket(uint8_t *pPkt);
176 
189 void RTLSCtrl_syncEventNotify(rtlsStatus_e status, uint32_t timeToNextEvent, int8_t rssi, uint8_t channel);
190 
199 void RTLSCtrl_processDataSent(uint8_t status);
200 
216 void RTLSCtrl_aoaResultEvt(int8_t rssi, uint8_t channel, uint16_t numIqSamples, uint8_t sampleRate, uint8_t numAnt, uint8_t antArraySwitchIo, uint16_t *pI, uint16_t *pQ);
217 
226 void RTLSCtrl_sendDebugEvent(uint8_t *debug_string, uint32_t debug_value);
227 
228 /*********************************************************************
229 *********************************************************************/
230 
231 
232 #ifdef __cplusplus
233 }
234 #endif
235 
236 #endif /* RTLS_CTRL_API_H_ */
237 
#define CHIP_ID_SIZE
Chip Identifier Size.
Definition: rtls_ctrl_api.h:58
void RTLSCtrl_processDataSent(uint8_t status)
RTLS Application Data Sent.
void RTLSCtrl_sendDebugEvent(uint8_t *debug_string, uint32_t debug_value)
RTLSCtrl_sendDebugEvent.
void RTLSCtrl_aoaResultEvt(int8_t rssi, uint8_t channel, uint16_t numIqSamples, uint8_t sampleRate, uint8_t numAnt, uint8_t antArraySwitchIo, uint16_t *pI, uint16_t *pQ)
RTLSCtrl_aoaResultEvt.
RTLS Configuration structure.
Definition: rtls_ctrl_api.h:102
uint8_t * pData
Pointer to request.
Definition: rtls_ctrl_api.h:113
void RTLSCtrl_processRtlsPacket(uint8_t *pPkt)
RTLSCtrl_processRtlsPacket.
rtlsCapabilities_e
Enumeration for RTLS Capabilities.
Definition: rtls_ctrl_api.h:87
uint8_t cmdOp
RTLS Application Command Opcode.
Definition: rtls_ctrl_api.h:119
void RTLSCtrl_scanResultEvt(rtlsStatus_e status, uint8_t *scanResult, uint8_t size)
RTLS Control Scan Results.
void RTLSCtrl_connInfoEvt(uint8_t *connInfo, uint16_t connInfoLen)
RTLS Control Connection Info.
void RTLSCtrl_syncEventNotify(rtlsStatus_e status, uint32_t timeToNextEvent, int8_t rssi, uint8_t channel)
RTLSCtrl_syncEventNotify.
void(* pfnRtlsAppCb)(uint8_t *cmd)
Application callback function.
Definition: rtls_ctrl_api.h:72
uint16_t payloadLen
Length.
Definition: rtls_ctrl_api.h:120
rtlsCapabilities_e rtlsCapab
RTLS Capabilities.
Definition: rtls_ctrl_api.h:104
uint8_t reqOp
Request Opcode.
Definition: rtls_ctrl_api.h:112
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:117
pfnRtlsAppCb rtlsAppCb
Application callback function.
Definition: rtls_ctrl_api.h:106
rtlsStatus_e
Enumeration for RTLS Status.
Definition: rtls_ctrl_api.h:75
void RTLSCtrl_connResultEvt(uint8_t status)
RTLS Control Connection Results.
RTLS Control request.
Definition: rtls_ctrl_api.h:110
© Copyright 1995-2019, Texas Instruments Incorporated. All rights reserved.
Trademarks | Privacy policy | Terms of use | Terms of sale