antmessage.h 7.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186
  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. 2012
  6. All rights reserved.
  7. */
  8. #ifndef ANTMESSAGE_H
  9. #define ANTMESSAGE_H
  10. #include "types.h"
  11. #define MESG_TX_SYNC ((UCHAR)0xA4)
  12. #define MESG_RX_SYNC ((UCHAR)0xA5)
  13. #define MESG_SIZE_OFFSET ((UCHAR)1)
  14. #define MESG_ID_OFFSET ((UCHAR)2)
  15. #define MESG_SYNC_SIZE ((UCHAR)1)
  16. #define MESG_SIZE_SIZE ((UCHAR)1)
  17. #define MESG_ID_SIZE ((UCHAR)1)
  18. #define MESG_CHECKSUM_SIZE ((UCHAR)1)
  19. #define MESG_MAX_DATA_SIZE ((UCHAR)17)
  20. #define MESG_HEADER_SIZE (MESG_SYNC_SIZE + MESG_SIZE_SIZE + MESG_ID_SIZE)
  21. #define MESG_DATA_OFFSET MESG_HEADER_SIZE
  22. #define MESG_FRAME_SIZE (MESG_HEADER_SIZE + MESG_CHECKSUM_SIZE)
  23. #define MESG_MAX_SIZE (MESG_MAX_DATA_SIZE + MESG_FRAME_SIZE)
  24. //////////////////////////////////////////////
  25. // Message ID's
  26. //////////////////////////////////////////////
  27. #define MESG_INVALID_ID ((UCHAR)0x00)
  28. #define MESG_EVENT_ID ((UCHAR)0x01)
  29. #define MESG_VERSION_ID ((UCHAR)0x3E) // protocol library version
  30. #define MESG_RESPONSE_EVENT_ID ((UCHAR)0x40)
  31. #define MESG_UNASSIGN_CHANNEL_ID ((UCHAR)0x41)
  32. #define MESG_ASSIGN_CHANNEL_ID ((UCHAR)0x42)
  33. #define MESG_CHANNEL_MESG_PERIOD_ID ((UCHAR)0x43)
  34. #define MESG_CHANNEL_SEARCH_TIMEOUT_ID ((UCHAR)0x44)
  35. #define MESG_CHANNEL_RADIO_FREQ_ID ((UCHAR)0x45)
  36. #define MESG_NETWORK_KEY_ID ((UCHAR)0x46)
  37. #define MESG_RADIO_TX_POWER_ID ((UCHAR)0x47)
  38. #define MESG_RADIO_CW_MODE_ID ((UCHAR)0x48)
  39. #define MESG_SEARCH_WAVEFORM_ID ((UCHAR)0x49)
  40. #define MESG_SYSTEM_RESET_ID ((UCHAR)0x4A)
  41. #define MESG_OPEN_CHANNEL_ID ((UCHAR)0x4B)
  42. #define MESG_CLOSE_CHANNEL_ID ((UCHAR)0x4C)
  43. #define MESG_REQUEST_ID ((UCHAR)0x4D)
  44. #define MESG_BROADCAST_DATA_ID ((UCHAR)0x4E)
  45. #define MESG_ACKNOWLEDGED_DATA_ID ((UCHAR)0x4F)
  46. #define MESG_BURST_DATA_ID ((UCHAR)0x50)
  47. #define MESG_CHANNEL_ID_ID ((UCHAR)0x51)
  48. #define MESG_CHANNEL_STATUS_ID ((UCHAR)0x52)
  49. #define MESG_RADIO_CW_INIT_ID ((UCHAR)0x53)
  50. #define MESG_CAPABILITIES_ID ((UCHAR)0x54)
  51. #define MESG_NVM_DATA_ID ((UCHAR)0x56)
  52. #define MESG_NVM_CMD_ID ((UCHAR)0x57)
  53. #define MESG_NVM_STRING_ID ((UCHAR)0x58)
  54. #define MESG_ID_LIST_ADD_ID ((UCHAR)0x59)
  55. #define MESG_ID_LIST_CONFIG_ID ((UCHAR)0x5A)
  56. #define MESG_OPEN_RX_SCAN_ID ((UCHAR)0x5B)
  57. #define MESG_EXT_CHANNEL_RADIO_FREQ_ID ((UCHAR)0x5C)
  58. #define MESG_EXT_BROADCAST_DATA_ID ((UCHAR)0x5D)
  59. #define MESG_EXT_ACKNOWLEDGED_DATA_ID ((UCHAR)0x5E)
  60. #define MESG_EXT_BURST_DATA_ID ((UCHAR)0x5F)
  61. #define MESG_CHANNEL_RADIO_TX_POWER_ID ((UCHAR)0x60)
  62. #define MESG_GET_SERIAL_NUM_ID ((UCHAR)0x61)
  63. #define MESG_GET_TEMP_CAL_ID ((UCHAR)0x62)
  64. #define MESG_SET_LP_SEARCH_TIMEOUT_ID ((UCHAR)0x63)
  65. #define MESG_SET_TX_SEARCH_ON_NEXT_ID ((UCHAR)0x64)
  66. #define MESG_SERIAL_NUM_SET_CHANNEL_ID_ID ((UCHAR)0x65)
  67. #define MESG_RX_EXT_MESGS_ENABLE_ID ((UCHAR)0x66)
  68. #define MESG_RADIO_CONFIG_ALWAYS_ID ((UCHAR)0x67)
  69. #define MESG_ENABLE_LED_FLASH_ID ((UCHAR)0x68)
  70. #define MESG_AGC_CONFIG_ID ((UCHAR)0x6A)
  71. #define MESG_READ_SEGA_ID ((UCHAR)0xA0)
  72. #define MESG_SEGA_CMD_ID ((UCHAR)0xA1)
  73. #define MESG_SEGA_DATA_ID ((UCHAR)0xA2)
  74. #define MESG_SEGA_ERASE_ID ((UCHAR)0XA3)
  75. #define MESG_SEGA_WRITE_ID ((UCHAR)0XA4)
  76. // ((UCHAR)0xA5) //FREE
  77. #define MESG_SEGA_LOCK_ID ((UCHAR)0xA6)
  78. #define MESG_FUSECHECK_ID ((UCHAR)0xA7)
  79. #define MESG_UARTREG_ID ((UCHAR)0XA8)
  80. #define MESG_MAN_TEMP_ID ((UCHAR)0xA9)
  81. #define MESG_BIST_ID ((UCHAR)0XAA)
  82. #define MESG_SELFERASE_ID ((UCHAR)0XAB)
  83. #define MESG_SET_MFG_BITS_ID ((UCHAR)0xAC)
  84. #define MESG_UNLOCK_INTERFACE_ID ((UCHAR)0xAD)
  85. #define MESG_IO_STATE_ID ((UCHAR)0xB0)
  86. #define MESG_CFG_STATE_ID ((UCHAR)0xB1)
  87. #define MESG_BTH_BROADCAST_DATA_ID ((UCHAR)0xD0)
  88. #define MESG_BTH_ACKNOWLEDGED_DATA_ID ((UCHAR)0xD1)
  89. #define MESG_BTH_BURST_DATA_ID ((UCHAR)0xD2)
  90. #define MESG_BTH_EXT_BROADCAST_DATA_ID ((UCHAR)0xD3)
  91. #define MESG_BTH_EXT_ACKNOWLEDGED_DATA_ID ((UCHAR)0xD4)
  92. #define MESG_BTH_EXT_BURST_DATA_ID ((UCHAR)0xD5)
  93. //////////////////////////////////////////////
  94. // Message Sizes
  95. //////////////////////////////////////////////
  96. #define MESG_INVALID_SIZE ((UCHAR)0)
  97. #define MESG_RESPONSE_EVENT_SIZE ((UCHAR)3)
  98. #define MESG_CHANNEL_STATUS_SIZE ((UCHAR)2)
  99. #define MESG_VERSION_SIZE ((UCHAR)9)
  100. #define MESG_UNASSIGN_CHANNEL_SIZE ((UCHAR)1)
  101. #define MESG_ASSIGN_CHANNEL_SIZE ((UCHAR)3)
  102. #define MESG_CHANNEL_ID_SIZE ((UCHAR)5)
  103. #define MESG_CHANNEL_MESG_PERIOD_SIZE ((UCHAR)3)
  104. #define MESG_CHANNEL_SEARCH_TIMEOUT_SIZE ((UCHAR)2)
  105. #define MESG_CHANNEL_RADIO_FREQ_SIZE ((UCHAR)2)
  106. #define MESG_NETWORK_KEY_SIZE ((UCHAR)9)
  107. #define MESG_RADIO_TX_POWER_SIZE ((UCHAR)2)
  108. #define MESG_RADIO_CW_MODE_SIZE ((UCHAR)3)
  109. #define MESG_RADIO_CW_INIT_SIZE ((UCHAR)1)
  110. #define MESG_SEARCH_WAVEFORM_SIZE ((UCHAR)3)
  111. #define MESG_SYSTEM_RESET_SIZE ((UCHAR)1)
  112. #define MESG_OPEN_CHANNEL_SIZE ((UCHAR)1)
  113. #define MESG_CLOSE_CHANNEL_SIZE ((UCHAR)1)
  114. #define MESG_REQUEST_SIZE ((UCHAR)2)
  115. #define MESG_CAPABILITIES_SIZE ((UCHAR)6)
  116. #define MESG_DATA_SIZE ((UCHAR)9)
  117. #define MESG_NVM_DATA_SIZE ((UCHAR)10)
  118. #define MESG_NVM_CMD_SIZE ((UCHAR)3)
  119. #define MESG_NVM_STRING_SIZE ((UCHAR)9)
  120. #define MESG_ID_LIST_ADD_SIZE ((UCHAR)6)
  121. #define MESG_ID_LIST_CONFIG_SIZE ((UCHAR)3)
  122. #define MESG_OPEN_RX_SCAN_SIZE ((UCHAR)1)
  123. #define MESG_EXT_CHANNEL_RADIO_FREQ_SIZE ((UCHAR)3)
  124. #define MESG_EXT_DATA_SIZE ((UCHAR)13)
  125. #define MESG_RADIO_CONFIG_ALWAYS_SIZE ((UCHAR)2)
  126. #define MESG_RX_EXT_MESGS_ENABLE_SIZE ((UCHAR)2)
  127. #define MESG_SET_TX_SEARCH_ON_NEXT_SIZE ((UCHAR)2)
  128. #define MESG_SET_LP_SEARCH_TIMEOUT_SIZE ((UCHAR)2)
  129. #define MESG_SERIAL_NUM_SET_CHANNEL_ID_SIZE ((UCHAR)3)
  130. #define MESG_ENABLE_LED_FLASH_SIZE ((UCHAR)2)
  131. #define MESG_GET_SERIAL_NUM_SIZE ((UCHAR)4)
  132. #define MESG_GET_TEMP_CAL_SIZE ((UCHAR)4)
  133. #define MESG_AGC_CONFIG_SIZE ((UCHAR)2)
  134. #define MESG_READ_SEGA_SIZE ((UCHAR)2)
  135. #define MESG_SEGA_CMD_SIZE ((UCHAR)3)
  136. #define MESG_SEGA_DATA_SIZE ((UCHAR)10)
  137. #define MESG_SEGA_ERASE_SIZE ((UCHAR)0)
  138. #define MESG_SEGA_WRITE_SIZE ((UCHAR)3)
  139. #define MESG_SEGA_LOCKED_SIZE ((UCHAR)1)
  140. #define MESG_SEGA_LOCK_SIZE ((UCHAR)0)
  141. #define MESG_FUSECHECK_SIZE ((UCHAR)1)
  142. #define MESG_UARTREG_SIZE ((UCHAR)2)
  143. #define MESG_MAN_TEMP_SIZE ((UCHAR)2)
  144. #define MESG_BIST_SIZE ((UCHAR)6)
  145. #define MESG_SELFERASE_SIZE ((UCHAR)2)
  146. #define MESG_SET_MFG_BITS_SIZE ((UCHAR)2)
  147. #define MESG_UNLOCK_INTERFACE_SIZE ((UCHAR)1)
  148. #define MESG_IO_STATE_SIZE ((UCHAR)2)
  149. #define MESG_CFG_STATE_SIZE ((UCHAR)2)
  150. #endif // !ANTMESSAGE_H