antmessage.h 19 KB

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