ant-wireless 0.1.0.pre.20210617213631

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,445 @@
1
+ /*
2
+ This software is subject to the license described in the License.txt file
3
+ included with this software distribution. You may not use this file except
4
+ in compliance with this license.
5
+
6
+ Copyright (c) Dynastream Innovations Inc. 2016
7
+ All rights reserved.
8
+ */
9
+ #ifndef ANTMESSAGE_H
10
+ #define ANTMESSAGE_H
11
+
12
+ #include "types.h"
13
+ #include "antdefines.h"
14
+
15
+ /////////////////////////////////////////////////////////////////////////////
16
+ // Message Format
17
+ // Messages are in the format:
18
+ //
19
+ // AX XX YY -------- CK
20
+ //
21
+ // where: AX is the 1 byte sync byte either transmit or recieve
22
+ // XX is the 1 byte size of the message (0-249) NOTE: THIS WILL BE LIMITED BY THE EMBEDDED RECEIVE BUFFER SIZE
23
+ // YY is the 1 byte ID of the message (1-255, 0 is invalid)
24
+ // ----- is the data of the message (0-249 bytes of data)
25
+ // CK is the 1 byte Checksum of the message
26
+ /////////////////////////////////////////////////////////////////////////////
27
+ #define MESG_TX_SYNC ((UCHAR)0xA4)
28
+ #define MESG_RX_SYNC ((UCHAR)0xA5)
29
+ #define MESG_SYNC_SIZE ((UCHAR)1)
30
+ #define MESG_SIZE_SIZE ((UCHAR)1)
31
+ #define MESG_ID_SIZE ((UCHAR)1)
32
+ #define MESG_CHANNEL_NUM_SIZE ((UCHAR)1)
33
+ #define MESG_EXT_MESG_BF_SIZE ((UCHAR)1) // NOTE: this could increase in the future
34
+ #define MESG_CHECKSUM_SIZE ((UCHAR)1)
35
+ #define MESG_DATA_SIZE ((UCHAR)9)
36
+
37
+ // The largest serial message is an ANT data message with all of the extended fields
38
+ #define MESG_ANT_MAX_PAYLOAD_SIZE ANT_STANDARD_DATA_PAYLOAD_SIZE
39
+
40
+ #define MESG_MAX_EXT_DATA_SIZE (ANT_EXT_MESG_DEVICE_ID_FIELD_SIZE + ANT_EXT_STRING_SIZE) // ANT device ID (4 bytes) + Padding for ANT EXT string size(27 bytes)
41
+
42
+ #define MESG_MAX_DATA_SIZE (MESG_ANT_MAX_PAYLOAD_SIZE + MESG_EXT_MESG_BF_SIZE + MESG_MAX_EXT_DATA_SIZE) // ANT data payload (8 bytes) + extended bitfield (1 byte) + extended data (31 bytes) = 40 bytes
43
+ #define MESG_MAX_SIZE_VALUE (MESG_MAX_DATA_SIZE + MESG_CHANNEL_NUM_SIZE) // this is the maximum value that the serial message size value is allowed to be (40 + 1 = 41 bytes)
44
+ #define MESG_BUFFER_SIZE (MESG_SIZE_SIZE + MESG_ID_SIZE + MESG_CHANNEL_NUM_SIZE + MESG_MAX_DATA_SIZE + MESG_CHECKSUM_SIZE)
45
+ #define MESG_FRAMED_SIZE (MESG_ID_SIZE + MESG_CHANNEL_NUM_SIZE + MESG_MAX_DATA_SIZE)
46
+ #define MESG_HEADER_SIZE (MESG_SYNC_SIZE + MESG_SIZE_SIZE + MESG_ID_SIZE)
47
+ #define MESG_FRAME_SIZE (MESG_HEADER_SIZE + MESG_CHECKSUM_SIZE)
48
+ #define MESG_MAX_SIZE (MESG_MAX_DATA_SIZE + MESG_FRAME_SIZE)
49
+
50
+ #define MESG_SIZE_OFFSET (MESG_SYNC_SIZE)
51
+ #define MESG_ID_OFFSET (MESG_SYNC_SIZE + MESG_SIZE_SIZE)
52
+ #define MESG_DATA_OFFSET (MESG_HEADER_SIZE)
53
+ #define MESG_RECOMMENDED_BUFFER_SIZE ((UCHAR) 64) // This is the recommended size for serial message buffers if there are no RAM restrictions on the system
54
+
55
+ //////////////////////////////////////////////
56
+ // Message ID's
57
+ //////////////////////////////////////////////
58
+ #define MESG_INVALID_ID ((UCHAR)0x00)
59
+ #define MESG_EVENT_ID ((UCHAR)0x01)
60
+
61
+ #define MESG_VERSION_ID ((UCHAR)0x3E)
62
+ #define MESG_RESPONSE_EVENT_ID ((UCHAR)0x40)
63
+
64
+ #define MESG_UNASSIGN_CHANNEL_ID ((UCHAR)0x41)
65
+ #define MESG_ASSIGN_CHANNEL_ID ((UCHAR)0x42)
66
+ #define MESG_CHANNEL_MESG_PERIOD_ID ((UCHAR)0x43)
67
+ #define MESG_CHANNEL_SEARCH_TIMEOUT_ID ((UCHAR)0x44)
68
+ #define MESG_CHANNEL_RADIO_FREQ_ID ((UCHAR)0x45)
69
+ #define MESG_NETWORK_KEY_ID ((UCHAR)0x46)
70
+ #define MESG_RADIO_TX_POWER_ID ((UCHAR)0x47)
71
+ #define MESG_RADIO_CW_MODE_ID ((UCHAR)0x48)
72
+ #define MESG_SYSTEM_RESET_ID ((UCHAR)0x4A)
73
+ #define MESG_OPEN_CHANNEL_ID ((UCHAR)0x4B)
74
+ #define MESG_CLOSE_CHANNEL_ID ((UCHAR)0x4C)
75
+ #define MESG_REQUEST_ID ((UCHAR)0x4D)
76
+
77
+ #define MESG_BROADCAST_DATA_ID ((UCHAR)0x4E)
78
+ #define MESG_ACKNOWLEDGED_DATA_ID ((UCHAR)0x4F)
79
+ #define MESG_BURST_DATA_ID ((UCHAR)0x50)
80
+
81
+ #define MESG_CHANNEL_ID_ID ((UCHAR)0x51)
82
+ #define MESG_CHANNEL_STATUS_ID ((UCHAR)0x52)
83
+ #define MESG_RADIO_CW_INIT_ID ((UCHAR)0x53)
84
+ #define MESG_CAPABILITIES_ID ((UCHAR)0x54)
85
+
86
+ #define MESG_STACKLIMIT_ID ((UCHAR)0x55)
87
+
88
+ #define MESG_SCRIPT_DATA_ID ((UCHAR)0x56)
89
+ #define MESG_SCRIPT_CMD_ID ((UCHAR)0x57)
90
+
91
+ #define MESG_ID_LIST_ADD_ID ((UCHAR)0x59)
92
+ #define MESG_CRYPTO_ID_LIST_ADD_ID ((UCHAR)0x59)
93
+ #define MESG_ID_LIST_CONFIG_ID ((UCHAR)0x5A)
94
+ #define MESG_CRYPTO_ID_LIST_CONFIG_ID ((UCHAR)0x5A)
95
+ #define MESG_OPEN_RX_SCAN_ID ((UCHAR)0x5B)
96
+
97
+ #define MESG_EXT_CHANNEL_RADIO_FREQ_ID ((UCHAR)0x5C) // OBSOLETE: (for 905 radio)
98
+ #define MESG_EXT_BROADCAST_DATA_ID ((UCHAR)0x5D)
99
+ #define MESG_EXT_ACKNOWLEDGED_DATA_ID ((UCHAR)0x5E)
100
+ #define MESG_EXT_BURST_DATA_ID ((UCHAR)0x5F)
101
+
102
+ #define MESG_CHANNEL_RADIO_TX_POWER_ID ((UCHAR)0x60)
103
+ #define MESG_GET_SERIAL_NUM_ID ((UCHAR)0x61)
104
+ #define MESG_GET_TEMP_CAL_ID ((UCHAR)0x62)
105
+ #define MESG_SET_LP_SEARCH_TIMEOUT_ID ((UCHAR)0x63)
106
+ #define MESG_SET_TX_SEARCH_ON_NEXT_ID ((UCHAR)0x64)
107
+ #define MESG_SERIAL_NUM_SET_CHANNEL_ID_ID ((UCHAR)0x65)
108
+ #define MESG_RX_EXT_MESGS_ENABLE_ID ((UCHAR)0x66)
109
+ #define MESG_RADIO_CONFIG_ALWAYS_ID ((UCHAR)0x67)
110
+ #define MESG_ENABLE_LED_FLASH_ID ((UCHAR)0x68)
111
+ #define MESG_XTAL_ENABLE_ID ((UCHAR)0x6D)
112
+ #define MESG_ANTLIB_CONFIG_ID ((UCHAR)0x6E)
113
+ #define MESG_STARTUP_MESG_ID ((UCHAR)0x6F)
114
+ #define MESG_AUTO_FREQ_CONFIG_ID ((UCHAR)0x70)
115
+ #define MESG_PROX_SEARCH_CONFIG_ID ((UCHAR)0x71)
116
+
117
+ #define MESG_ADV_BURST_DATA_ID ((UCHAR)0x72)
118
+ #define MESG_EVENT_BUFFERING_CONFIG_ID ((UCHAR)0x74)
119
+
120
+ #define MESG_SET_SEARCH_CH_PRIORITY_ID ((UCHAR)0x75)
121
+
122
+ #define MESG_HIGH_DUTY_SEARCH_MODE_ID ((UCHAR)0x77)
123
+ #define MESG_CONFIG_ADV_BURST_ID ((UCHAR)0x78)
124
+ #define MESG_EVENT_FILTER_CONFIG_ID ((UCHAR)0x79)
125
+ #define MESG_SDU_CONFIG_ID ((UCHAR)0x7A)
126
+ #define MESG_SDU_SET_MASK_ID ((UCHAR)0x7B)
127
+ #define MESG_USER_CONFIG_PAGE_ID ((UCHAR)0x7C)
128
+ #define MESG_ENCRYPT_ENABLE_ID ((UCHAR)0x7D)
129
+ #define MESG_SET_CRYPTO_KEY_ID ((UCHAR)0x7E)
130
+ #define MESG_SET_CRYPTO_INFO_ID ((UCHAR)0x7F)
131
+ #define MESG_CUBE_CMD_ID ((UCHAR)0x80)
132
+
133
+ #define MESG_ACTIVE_SEARCH_SHARING_ID ((UCHAR)0x81)
134
+ #define MESG_NVM_CRYPTO_KEY_OPS_ID ((UCHAR)0x83)
135
+
136
+ #define MESG_GET_PIN_DIODE_CONTROL_ID ((UCHAR)0x8D)
137
+ #define MESG_PIN_DIODE_CONTROL_ID ((UCHAR)0x8E)
138
+ #define MESG_FIT1_SET_AGC_ID ((UCHAR)0x8F)
139
+
140
+ #define MESG_FIT1_SET_EQUIP_STATE_ID ((UCHAR)0x91) // *** CONFLICT: w/ Sensrcore, Fit1 will never have sensrcore enabled
141
+
142
+ // Sensrcore Messages
143
+ #define MESG_SET_CHANNEL_INPUT_MASK_ID ((UCHAR)0x90)
144
+ #define MESG_SET_CHANNEL_DATA_TYPE_ID ((UCHAR)0x91)
145
+ #define MESG_READ_PINS_FOR_SECT_ID ((UCHAR)0x92)
146
+ #define MESG_TIMER_SELECT_ID ((UCHAR)0x93)
147
+ #define MESG_ATOD_SETTINGS_ID ((UCHAR)0x94)
148
+ #define MESG_SET_SHARED_ADDRESS_ID ((UCHAR)0x95)
149
+ #define MESG_ATOD_EXTERNAL_ENABLE_ID ((UCHAR)0x96)
150
+ #define MESG_ATOD_PIN_SETUP_ID ((UCHAR)0x97)
151
+ #define MESG_SETUP_ALARM_ID ((UCHAR)0x98)
152
+ #define MESG_ALARM_VARIABLE_MODIFY_TEST_ID ((UCHAR)0x99)
153
+ #define MESG_PARTIAL_RESET_ID ((UCHAR)0x9A)
154
+ #define MESG_OVERWRITE_TEMP_CAL_ID ((UCHAR)0x9B)
155
+ #define MESG_SERIAL_PASSTHRU_SETTINGS_ID ((UCHAR)0x9C)
156
+
157
+ #define MESG_BIST_ID ((UCHAR)0xAA)
158
+ #define MESG_UNLOCK_INTERFACE_ID ((UCHAR)0xAD)
159
+ #define MESG_SERIAL_ERROR_ID ((UCHAR)0xAE)
160
+ #define MESG_SET_ID_STRING_ID ((UCHAR)0xAF)
161
+
162
+ #define MESG_PORT_GET_IO_STATE_ID ((UCHAR)0xB4)
163
+ #define MESG_PORT_SET_IO_STATE_ID ((UCHAR)0xB5)
164
+
165
+ #define MESG_RSSI_ID ((UCHAR)0xC0)
166
+ #define MESG_RSSI_BROADCAST_DATA_ID ((UCHAR)0xC1)
167
+ #define MESG_RSSI_ACKNOWLEDGED_DATA_ID ((UCHAR)0xC2)
168
+ #define MESG_RSSI_BURST_DATA_ID ((UCHAR)0xC3)
169
+ #define MESG_RSSI_SEARCH_THRESHOLD_ID ((UCHAR)0xC4)
170
+ #define MESG_SLEEP_ID ((UCHAR)0xC5)
171
+ #define MESG_GET_GRMN_ESN_ID ((UCHAR)0xC6)
172
+ #define MESG_SET_USB_INFO_ID ((UCHAR)0xC7)
173
+
174
+ #define MESG_HCI_COMMAND_COMPLETE ((UCHAR)0xC8)
175
+
176
+ // 0xE0 - 0xEF reserved for extended ID
177
+ #define MESG_EXT_ID_0 ((UCHAR)0xE0)
178
+ #define MESG_EXT_ID_1 ((UCHAR)0xE1)
179
+ #define MESG_EXT_ID_2 ((UCHAR)0xE2)
180
+
181
+ // 0xE0 extended IDs
182
+ #define MESG_EXT_RESPONSE_ID ((USHORT)0xE000)
183
+
184
+ // 0xE1 extended IDs
185
+ #define MESG_EXT_REQUEST_ID ((USHORT)0xE100)
186
+
187
+ // 0xE2 extended IDs
188
+ #define MESG_FS_INIT_MEMORY_ID ((USHORT)0xE200)
189
+ #define MESG_FS_FORMAT_MEMORY_ID ((USHORT)0xE201)
190
+ #define MESG_FS_GET_USED_SPACE_ID ((USHORT)0xE202)
191
+ #define MESG_FS_GET_FREE_SPACE_ID ((USHORT)0xE203)
192
+ #define MESG_FS_FIND_FILE_INDEX_ID ((USHORT)0xE204)
193
+ #define MESG_FS_DIRECTORY_READ_ABSOLUTE_ID ((USHORT)0xE205)
194
+ #define MESG_FS_DIRECTORY_READ_ENTRY_ID ((USHORT)0xE206)
195
+ #define MESG_FS_DIRECTORY_SAVE_ID ((USHORT)0xE207)
196
+ #define MESG_FS_DIRECTORY_GET_SIZE_ID ((USHORT)0xE208)
197
+ #define MESG_FS_DIRECTORY_REBUILD_ID ((USHORT)0xE209)
198
+ #define MESG_FS_FILE_CREATE_ID ((USHORT)0xE20A)
199
+ #define MESG_FS_FILE_OPEN_ID ((USHORT)0xE20B)
200
+ #define MESG_FS_FILE_DELETE_ID ((USHORT)0xE20C)
201
+ #define MESG_FS_FILE_CLOSE_ID ((USHORT)0xE20D)
202
+ #define MESG_FS_FILE_READ_ABSOLUTE_ID ((USHORT)0xE20E)
203
+ #define MESG_FS_FILE_READ_RELATIVE_ID ((USHORT)0xE20F)
204
+ #define MESG_FS_FILE_WRITE_ABSOLUTE_ID ((USHORT)0xE210)
205
+ #define MESG_FS_FILE_WRITE_RELATIVE_ID ((USHORT)0xE211)
206
+ #define MESG_FS_FILE_SET_SPECIFIC_FLAGS_ID ((USHORT)0xE212)
207
+ #define MESG_FS_FILE_GET_SIZE_ID ((USHORT)0xE213)
208
+ #define MESG_FS_FILE_GET_SPECIFIC_FILE_FLAGS_ID ((USHORT)0xE214)
209
+ #define MESG_FS_FILE_GET_SIZE_IN_MEM_ID ((USHORT)0xE215)
210
+ #define MESG_FS_DIRECTORY_READ_LOCK_ID ((USHORT)0xE216)
211
+
212
+ #define MESG_FS_FILE_SET_GENERAL_FLAGS_ID ((USHORT)0xE21E)
213
+ #define MESG_FS_DIRECTORY_WRITE_ABSOLUTE_ID ((USHORT)0xE21F)
214
+ // reserved
215
+ #define MESG_MEMDEV_EEPROM_INIT_ID ((USHORT)0xE220)
216
+ #define MESG_MEMDEV_FLASH_INIT_ID ((USHORT)0xE221)
217
+ //reserved
218
+ #define MESG_FS_ANTFS_EVENT_ID ((USHORT)0xE230)
219
+ #define MESG_FS_ANTFS_OPEN_ID ((USHORT)0xE231)
220
+ #define MESG_FS_ANTFS_CLOSE_ID ((USHORT)0xE232)
221
+ #define MESG_FS_ANTFS_CONFIG_BEACON_ID ((USHORT)0xE233)
222
+ #define MESG_FS_ANTFS_SET_AUTH_STRING_ID ((USHORT)0xE234)
223
+ #define MESG_FS_ANTFS_SET_BEACON_STATE_ID ((USHORT)0xE235)
224
+ #define MESG_FS_ANTFS_PAIR_RESPONSE_ID ((USHORT)0xE236)
225
+ #define MESG_FS_ANTFS_SET_LINK_FREQ_ID ((USHORT)0xE237)
226
+ #define MESG_FS_ANTFS_SET_BEACON_TIMEOUT_ID ((USHORT)0xE238)
227
+ #define MESG_FS_ANTFS_SET_PAIRING_TIMEOUT_ID ((USHORT)0xE239)
228
+ #define MESG_FS_ANTFS_REMOTE_FILE_CREATE_EN_ID ((USHORT)0xE23A)
229
+ #define MESG_FS_ANTFS_GET_CMD_PIPE_ID ((USHORT)0xE23B)
230
+ #define MESG_FS_ANTFS_SET_CMD_PIPE_ID ((USHORT)0xE23C)
231
+ #define MESG_FS_SYSTEM_TIME_ID ((USHORT)0xE23D)
232
+ #define MESG_FS_ANTFS_SET_ANTFS_STATE_ID ((USHORT)0xE23E)
233
+ // reserved
234
+ #define MESG_FS_CRYPTO_ADD_USER_KEY_INDEX_ID ((USHORT)0xE245)
235
+ #define MESG_FS_CRYPTO_SET_USER_KEY_INDEX_ID ((USHORT)0xE246)
236
+ #define MESG_FS_CRYPTO_SET_USER_KEY_VAL_ID ((USHORT)0xE247)
237
+ // reserved
238
+ #define MESG_FS_FIT_FILE_INTEGRITY_CHECK_ID ((USHORT)0xE250)
239
+
240
+
241
+ //////////////////////////////////////////////
242
+ // Message Sizes
243
+ //////////////////////////////////////////////
244
+ #define MESG_INVALID_SIZE ((UCHAR)0)
245
+
246
+ #define MESG_VERSION_SIZE ((UCHAR)13)
247
+ #define MESG_RESPONSE_EVENT_SIZE ((UCHAR)3)
248
+ #define MESG_CHANNEL_STATUS_SIZE ((UCHAR)2)
249
+
250
+ #define MESG_UNASSIGN_CHANNEL_SIZE ((UCHAR)1)
251
+ #define MESG_ASSIGN_CHANNEL_SIZE ((UCHAR)3)
252
+ #define MESG_CHANNEL_ID_SIZE ((UCHAR)5)
253
+ #define MESG_CHANNEL_MESG_PERIOD_SIZE ((UCHAR)3)
254
+ #define MESG_CHANNEL_SEARCH_TIMEOUT_SIZE ((UCHAR)2)
255
+ #define MESG_CHANNEL_RADIO_FREQ_SIZE ((UCHAR)2)
256
+ #define MESG_CHANNEL_RADIO_TX_POWER_SIZE ((UCHAR)2)
257
+ #define MESG_NETWORK_KEY_SIZE ((UCHAR)9)
258
+ #define MESG_RADIO_TX_POWER_SIZE ((UCHAR)2)
259
+ #define MESG_RADIO_CW_MODE_SIZE ((UCHAR)3)
260
+ #define MESG_RADIO_CW_INIT_SIZE ((UCHAR)1)
261
+ #define MESG_SYSTEM_RESET_SIZE ((UCHAR)1)
262
+ #define MESG_OPEN_CHANNEL_SIZE ((UCHAR)1)
263
+ #define MESG_CLOSE_CHANNEL_SIZE ((UCHAR)1)
264
+ #define MESG_REQUEST_SIZE ((UCHAR)2)
265
+ #define MESG_REQUEST_USER_NVM_SIZE ((UCHAR)5)
266
+
267
+ #define MESG_CAPABILITIES_SIZE ((UCHAR)8)
268
+ #define MESG_STACKLIMIT_SIZE ((UCHAR)2)
269
+
270
+ #define MESG_SCRIPT_DATA_SIZE ((UCHAR)10)
271
+ #define MESG_SCRIPT_CMD_SIZE ((UCHAR)3)
272
+
273
+ #define MESG_ID_LIST_ADD_SIZE ((UCHAR)6)
274
+ #define MESG_ID_LIST_CONFIG_SIZE ((UCHAR)3)
275
+ #define MESG_OPEN_RX_SCAN_SIZE ((UCHAR)1)
276
+ #define MESG_EXT_CHANNEL_RADIO_FREQ_SIZE ((UCHAR)3)
277
+
278
+ #define MESG_RADIO_CONFIG_ALWAYS_SIZE ((UCHAR)2)
279
+ #define MESG_RX_EXT_MESGS_ENABLE_SIZE ((UCHAR)2)
280
+ #define MESG_SET_TX_SEARCH_ON_NEXT_SIZE ((UCHAR)2)
281
+ #define MESG_SET_LP_SEARCH_TIMEOUT_SIZE ((UCHAR)2)
282
+
283
+ #define MESG_SERIAL_NUM_SET_CHANNEL_ID_SIZE ((UCHAR)3)
284
+ #define MESG_ENABLE_LED_FLASH_SIZE ((UCHAR)2)
285
+ #define MESG_GET_SERIAL_NUM_SIZE ((UCHAR)4)
286
+ #define MESG_GET_TEMP_CAL_SIZE ((UCHAR)4)
287
+ #define MESG_CONFIG_ADV_BURST_SIZE ((UCHAR)9)
288
+ #define MESG_CONFIG_ADV_BURST_SIZE_EXT ((UCHAR)12)
289
+ #define MESG_ANTLIB_CONFIG_SIZE ((UCHAR)2)
290
+ #define MESG_XTAL_ENABLE_SIZE ((UCHAR)1)
291
+ #define MESG_STARTUP_MESG_SIZE ((UCHAR)1)
292
+ #define MESG_AUTO_FREQ_CONFIG_SIZE ((UCHAR)4)
293
+ #define MESG_PROX_SEARCH_CONFIG_SIZE ((UCHAR)2)
294
+ #define MESG_EVENT_BUFFERING_CONFIG_SIZE ((UCHAR)6)
295
+ #define MESG_EVENT_FILTER_CONFIG_SIZE ((UCHAR)3)
296
+ #define MESG_HIGH_DUTY_SEARCH_MODE_SIZE ((UCHAR)3)
297
+ #define MESG_SDU_CONFIG_SIZE ((UCHAR)3)
298
+ #define MESG_SDU_SET_MASK_SIZE ((UCHAR)9)
299
+
300
+ #define MESG_USER_CONFIG_PAGE_SIZE ((UCHAR)3)
301
+
302
+ #define MESG_ACTIVE_SEARCH_SHARING_SIZE ((UCHAR)2)
303
+
304
+ #define MESG_SET_SEARCH_CH_PRIORITY_SIZE ((UCHAR)2)
305
+
306
+ #define MESG_ENCRYPT_ENABLE_SIZE ((UCHAR)4)
307
+ #define MESG_SET_CRYPTO_KEY_SIZE ((UCHAR)17)
308
+ #define MESG_SET_CRYPTO_ID_SIZE ((UCHAR)5)
309
+ #define MESG_SET_CRYPTO_USER_INFO_SIZE ((UCHAR)20)
310
+ #define MESG_SET_CRYPTO_RNG_SEED_SIZE ((UCHAR)17)
311
+ #define MESG_NVM_CRYPTO_KEY_LOAD_SIZE ((UCHAR)3)
312
+ #define MESG_NVM_CRYPTO_KEY_STORE_SIZE ((UCHAR)18)
313
+ #define MESG_CRYPTO_ID_LIST_ADD_SIZE ((UCHAR)6)
314
+ #define MESG_CRYPTO_ID_LIST_CONFIG_SIZE ((UCHAR)3)
315
+
316
+ #define MESG_GET_PIN_DIODE_CONTROL_SIZE ((UCHAR)1)
317
+ #define MESG_PIN_DIODE_CONTROL_ID_SIZE ((UCHAR)2)
318
+ #define MESG_FIT1_SET_EQUIP_STATE_SIZE ((UCHAR)2)
319
+ #define MESG_FIT1_SET_AGC_SIZE ((UCHAR)4)
320
+
321
+ #define MESG_BIST_SIZE ((UCHAR)6)
322
+ #define MESG_UNLOCK_INTERFACE_SIZE ((UCHAR)1)
323
+ #define MESG_SET_SHARED_ADDRESS_SIZE ((UCHAR)3)
324
+
325
+ #define MESG_GET_GRMN_ESN_SIZE ((UCHAR)5)
326
+
327
+ #define MESG_PORT_SET_IO_STATE_SIZE ((UCHAR)5)
328
+
329
+
330
+ #define MESG_SLEEP_SIZE ((UCHAR)1)
331
+
332
+
333
+ #define MESG_EXT_DATA_SIZE ((UCHAR)13)
334
+
335
+ #define MESG_RSSI_SIZE ((UCHAR)5)
336
+ #define MESG_RSSI_DATA_SIZE ((UCHAR)17)
337
+ #define MESG_RSSI_RESPONSE_SIZE ((UCHAR)7)
338
+ #define MESG_RSSI_SEARCH_THRESHOLD_SIZE ((UCHAR)2)
339
+
340
+ #define MESG_MEMDEV_EEPROM_INIT_SIZE ((UCHAR) 0x04)
341
+ #define MESG_FS_INIT_MEMORY_SIZE ((UCHAR) 0x01)
342
+ #define MESG_FS_FORMAT_MEMORY_SIZE ((UCHAR) 0x05)
343
+ #define MESG_FS_DIRECTORY_SAVE_SIZE ((UCHAR) 0x01)
344
+ #define MESG_FS_DIRECTORY_REBUILD_SIZE ((UCHAR) 0x01)
345
+ #define MESG_FS_FILE_DELETE_SIZE ((UCHAR) 0x02)
346
+ #define MESG_FS_FILE_CLOSE_SIZE ((UCHAR) 0x02)
347
+ #define MESG_FS_FILE_SET_SPECIFIC_FLAGS_SIZE ((UCHAR) 0x03)
348
+ #define MESG_FS_DIRECTORY_READ_LOCK_SIZE ((UCHAR) 0x02)
349
+ #define MESG_FS_SYSTEM_TIME_SIZE ((UCHAR) 0x05)
350
+ #define MESG_FS_CRYPTO_ADD_USER_KEY_INDEX_SIZE ((UCHAR) 0x34)
351
+ #define MESG_FS_CRYPTO_SET_USER_KEY_INDEX_SIZE ((UCHAR) 0x05)
352
+ #define MESG_FS_CRYPTO_SET_USER_KEY_VAL_SIZE ((UCHAR) 0x33)
353
+ #define MESG_FS_FIT_FILE_INTEGRITY_CHECK_SIZE ((UCHAR) 0x02)
354
+ #define MESG_FS_ANTFS_OPEN_SIZE ((UCHAR) 0x01)
355
+ #define MESG_FS_ANTFS_CLOSE_SIZE ((UCHAR) 0x01)
356
+ #define MESG_FS_ANTFS_CONFIG_BEACON_SIZE ((UCHAR) 0x09)
357
+ #define MESG_FS_ANTFS_SET_AUTH_STRING_SIZE ((UCHAR) 0x02)
358
+ #define MESG_FS_ANTFS_SET_BEACON_STATE_SIZE ((UCHAR) 0x02)
359
+ #define MESG_FS_ANTFS_PAIR_RESPONSE_SIZE ((UCHAR) 0x02)
360
+ #define MESG_FS_ANTFS_SET_LINK_FREQ_SIZE ((UCHAR) 0x03)
361
+ #define MESG_FS_ANTFS_SET_BEACON_TIMEOUT_SIZE ((UCHAR) 0x02)
362
+ #define MESG_FS_ANTFS_SET_PAIRING_TIMEOUT_SIZE ((UCHAR) 0x02)
363
+ #define MESG_FS_ANTFS_REMOTE_FILE_CREATE_EN_SIZE ((UCHAR) 0x02)
364
+ #define MESG_FS_GET_USED_SPACE_SIZE ((UCHAR) 0x03)
365
+ #define MESG_FS_GET_FREE_SPACE_SIZE ((UCHAR) 0x03)
366
+ #define MESG_FS_FIND_FILE_INDEX_SIZE ((UCHAR) 0x07)
367
+ #define MESG_FS_DIRECTORY_READ_ABSOLUTE_SIZE ((UCHAR) 0x08)
368
+ #define MESG_FS_DIRECTORY_READ_ENTRY_SIZE ((UCHAR) 0x05)
369
+ #define MESG_FS_DIRECTORY_GET_SIZE_SIZE ((UCHAR) 0x03)
370
+ #define MESG_FS_FILE_CREATE_SIZE ((UCHAR) 0x0B)
371
+ #define MESG_FS_FILE_OPEN_SIZE ((UCHAR) 0x06)
372
+ #define MESG_FS_FILE_READ_ABSOLUTE_SIZE ((UCHAR) 0x09)
373
+ #define MESG_FS_FILE_READ_RELATIVE_SIZE ((UCHAR) 0x05)
374
+ #define MESG_FS_FILE_WRITE_ABSOLUTE_SIZE ((UCHAR) 0x09)
375
+ #define MESG_FS_FILE_WRITE_RELATIVE_SIZE ((UCHAR) 0x05)
376
+ #define MESG_FS_FILE_GET_SIZE_SIZE ((UCHAR) 0x04)
377
+ #define MESG_FS_FILE_GET_SIZE_IN_MEM_SIZE ((UCHAR) 0x04)
378
+ #define MESG_FS_FILE_GET_SPECIFIC_FILE_FLAGS_SIZE ((UCHAR) 0x04)
379
+ #define MESG_FS_SYSTEM_TIME_REQUEST_SIZE ((UCHAR) 0x03)
380
+ #define MESG_FS_ANTFS_GET_CMD_PIPE_SIZE ((UCHAR) 0x05)
381
+ #define MESG_FS_ANTFS_SET_CMD_PIPE_SIZE ((UCHAR) 0x05)
382
+ #define MESG_FS_REQUEST_RESPONSE_SIZE ((UCHAR) 0x03)
383
+
384
+
385
+ //////////////////////////////////////////////
386
+ // ANT serial message structure
387
+ //////////////////////////////////////////////
388
+ #if defined (DSI_TYPES_OTHER_OS) || defined(__BORLANDC__) // Nameless unions/struct are not supported by all compilers, remove this if you wish to use the following structures
389
+
390
+ typedef union
391
+ {
392
+ UCHAR ucExtMesgBF;
393
+ struct
394
+ {
395
+ BOOL bExtFieldCont : 1;
396
+ BOOL : 1;
397
+ BOOL : 1;
398
+ BOOL : 1;
399
+ BOOL : 1;
400
+ BOOL bANTTimeStamp : 1;
401
+ BOOL bReserved1 : 1;
402
+ BOOL bANTDeviceID : 1;
403
+ };
404
+
405
+ } EXT_MESG_BF; // extended message bitfield
406
+
407
+ typedef union
408
+ {
409
+ ULONG ulForceAlign; // force the struct to be 4-byte aligned, required for some casting in command.c
410
+ UCHAR aucMessage[MESG_BUFFER_SIZE]; // the complete message buffer pointer
411
+ struct
412
+ {
413
+ UCHAR ucSize; // the message size
414
+ union
415
+ {
416
+ UCHAR aucFramedData[MESG_FRAMED_SIZE]; // pointer for serial framer
417
+ struct
418
+ {
419
+ UCHAR ucMesgID; // the message ID
420
+ union
421
+ {
422
+ UCHAR aucMesgData[MESG_MAX_SIZE_VALUE]; // the message data
423
+ struct
424
+ {
425
+ union
426
+ {
427
+ UCHAR ucChannel; // ANT channel number
428
+ UCHAR ucSubID; // subID portion of ext ID message
429
+ };
430
+ UCHAR aucPayload[ANT_STANDARD_DATA_PAYLOAD_SIZE];// ANT message payload
431
+ EXT_MESG_BF sExtMesgBF; // extended message bitfield (NOTE: this will not be here for longer data messages)
432
+ UCHAR aucExtData[MESG_MAX_EXT_DATA_SIZE]; // extended message data
433
+ };
434
+ };
435
+ };
436
+ };
437
+ UCHAR ucCheckSum; // the message checksum
438
+ };
439
+
440
+
441
+ } ANT_MESSAGE;
442
+
443
+ #endif
444
+
445
+ #endif // !ANTMESSAGE_H
@@ -0,0 +1,18 @@
1
+ /*
2
+ This software is subject to the license described in the License.txt file
3
+ included with this software distribution. You may not use this file except
4
+ in compliance with this license.
5
+
6
+ Copyright (c) Dynastream Innovations Inc. 2016
7
+ All rights reserved.
8
+ */
9
+ #ifndef _BUILD_VERSION_H_
10
+ #define _BUILD_VERSION_H_
11
+
12
+ #define VERSION_MAJOR 3
13
+ #define VERSION_MINOR 8
14
+ #define VERSION_MICRO 0
15
+ #define VERSION_STEPS 0
16
+ #define PRODUCT_STRING "ANT Lib"
17
+
18
+ #endif //ifndef _BUILD_VERSION_H_