TI BLE5-Stack API Documentation  2.02.00.00
rtls_ctrl.h
Go to the documentation of this file.
1 /******************************************************************************
2 
3  @file rtls_ctrl.h
4 
5  @brief This file contains internal defines and macros used by rtls_ctrl.c
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_H_
27 #define RTLS_CTRL_H_
28 
29 #ifdef __cplusplus
30 extern "C"
31 {
32 #endif
33 
34 /*********************************************************************
35  * INCLUDES
36  */
37 #ifdef USE_ICALL
38 #include "icall.h"
39 #endif
40 
41 // for BLE_LOG
42 #include "bcomdef.h"
43 #ifdef RTLS_PASSIVE
44 #include "uble.h"
45 #else
46 #include "osal.h"
47 #endif
48 
49 /*********************************************************************
50 * EXTERNAL VARIABLES
51 */
52 
53 /*********************************************************************
54  * CONSTANTS
55  */
56 
57 // RTLS Task configuration
58 #define RTLS_CTRL_TASK_PRIORITY 2
59 #define RTLS_CTRL_TASK_STACK_SIZE 752
60 
61 #define RTLS_QUEUE_EVT UTIL_QUEUE_EVENT_ID
62 
63 #define RTLS_CTRL_ALL_EVENTS (RTLS_QUEUE_EVT)
64 
65 
66 #define RTLS_CMD_IDENTIFY 0x00
67 #define RTLS_CMD_RESERVED 0x01
68 #define RTLS_CMD_CONN_PARAMS 0x02
69 #define RTLS_CMD_CONNECT 0x03
70 #define RTLS_CMD_SCAN 0x04
71 #define RTLS_CMD_SCAN_STOP 0x05
72 #define RTLS_CMD_RESERVED1 0x06
73 #define RTLS_CMD_RESERVED2 0x07
74 #define RTLS_CMD_RESERVED3 0x08
75 #define RTLS_CMD_CREATE_SYNC 0x09
76 #define RTLS_CMD_CREATE_SYNC_CANCEL 0x0A
77 #define RTLS_CMD_TERMINATE_SYNC 0x0B
78 #define RTLS_CMD_PERIODIC_RECEIVE_ENABLE 0x0C
79 #define RTLS_CMD_ADD_DEVICE_ADV_LIST 0x0D
80 #define RTLS_CMD_REMOVE_DEVICE_ADV_LIST 0x0E
81 #define RTLS_CMD_READ_ADV_LIST_SIZE 0x0F
82 #define RTLS_CMD_CLEAR_ADV_LIST 0x10
83 #define RTLS_CMD_AOA_SET_PARAMS 0x13
84 #define RTLS_CMD_AOA_ENABLE 0x14
85 #define RTLS_CMD_CL_AOA_ENABLE 0x15
86 #define RTLS_CMD_RESET_DEVICE 0x20
87 #define RTLS_CMD_TERMINATE_LINK 0x22
88 #define RTLS_CMD_AOA_RESULT_ANGLE 0x23
89 #define RTLS_CMD_AOA_RESULT_RAW 0x24
90 #define RTLS_CMD_AOA_RESULT_PAIR_ANGLES 0x25
91 #define RTLS_CMD_RESERVED4 0x26
92 #define RTLS_CMD_CONN_INFO 0x27
93 #define RTLS_CMD_SET_RTLS_PARAM 0x28
94 #define RTLS_CMD_GET_RTLS_PARAM 0x29
95 #define RTLS_CMD_RESERVED5 0x30
96 #define RTLS_CMD_RESERVED6 0x31
97 #define RTLS_CMD_GET_ACTIVE_CONN_INFO 0x32
98 #define RTLS_CMD_CL_AOA_RESULT_RAW 0x33
99 #define RTLS_CMD_CL_AOA_RESULT_PAIR_ANGLES 0x34
100 #define RTLS_CMD_CL_AOA_RESULT_ANGLE 0x35
101 #define RTLS_CMD_HEAP_SIZE 0x36
102 
103 #define RTLS_CMD_BLE_LOG_STRINGS_MAX 0x32
104 extern char *rtlsCmd_BleLogStrings[];
105 
107 extern uint8_t maxNumClCteBufs;
108 
110 extern uint8_t maxNumClCteBufs;
111 
112 // RTLS async event
113 #define RTLS_EVT_ASSERT 0x80
114 #define RTLS_EVT_ERROR 0x81
115 #define RTLS_EVT_DEBUG 0x82
116 #define RTLS_EVT_CONN_INFO 0x83
117 #define RTLS_EVT_SYNC_EST 0x84
118 #define RTLS_EVT_SYNC_LOST 0x85
119 #define RTLS_EVT_PERIODIC_ADV_RPT 0x86
120 #define RTLS_EVT_TERMINATE_SYNC 0x87
121 #define RTLS_EVT_CL_AOA_ENABLE 0x88
122 
123 // RTLS param types for RTLS_CMD_SET_RTLS_PARAM command
124 #define RTLS_PARAM_CONNECTION_INTERVAL 0x01
125 #define RTLS_PARAM_2 0x02
126 #define RTLS_PARAM_3 0x03
127 
128 /*********************************************************************
129  * MACROS
130  */
131 #ifdef USE_ICALL
132 #define RTLSUTIL_MALLOC(pAlloc, size) { \
134  pAlloc = ICall_malloc(size); \
135  }
136 #define RTLSUTIL_FREE(pMsg) { \
138  ICall_free(pMsg); \
139  pMsg = NULL; \
140  }
141 #else
142 #define RTLSUTIL_MALLOC(pAlloc, size) { \
144  volatile uint32_t keyHwi; \
145  volatile uint32_t keySwi; \
146  keyHwi = Hwi_disable(); \
147  keySwi = Swi_disable(); \
148  pAlloc = malloc(size); \
149  Swi_restore(keySwi); \
150  Hwi_restore(keyHwi); \
151  }
152 #define RTLSUTIL_FREE(pFree) { \
154  volatile uint32_t keyHwi; \
155  volatile uint32_t keySwi; \
156  keyHwi = Hwi_disable(); \
157  keySwi = Swi_disable(); \
158  free(pFree); \
159  pFree = NULL; \
160  Swi_restore(keySwi); \
161  Hwi_restore(keyHwi); \
162  }
163 #endif
164 /*********************************************************************
165  * TYPEDEFS
166  */
167 #ifdef USE_ICALL
168 typedef struct
169 {
170  uint32_t totalHeap;
171  uint32_t freeHeap;
172 } heapStat_t;
173 #endif
174 
175 /*********************************************************************
176  * API FUNCTIONS
177  */
178 
187 void* RTLSCtrl_malloc(uint32_t sz);
188 
189 /*********************************************************************
190 *********************************************************************/
191 
192 #ifdef __cplusplus
193 }
194 #endif
195 
196 #endif /* RTLS_CTRL_H_ */
197 
This API allows the software components in the Z-Stack to be written independently of the specifics o...
This file contains configuration, initialization, and parameter management of Micro BLE Stack...
void * RTLSCtrl_malloc(uint32_t sz)
This function will allocate memory, if we were unable to allocate we will report to RTLS Host...
Type definitions and macros for BLE stack.
ICall layer interface.
uint8_t maxNumClCteBufs
Maximum number of buffers for CL AoA.
Definition: rtls_ctrl.h:110
© Copyright 1995-2021, Texas Instruments Incorporated. All rights reserved.
Trademarks | Privacy policy | Terms of use | Terms of sale