Bez popisu

nrf8001-helloworld.h 9.6KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254
  1. #include "hal_platform.h"
  2. #include "aci.h"
  3. #pragma once
  4. #define SETUP_ID 0
  5. #define SETUP_FORMAT 2 /** nRF8001 Cx */
  6. #define ACI_DYNAMIC_DATA_SIZE 263
  7. /* Service: GATT - Characteristic: Service Changed - Pipe: TX_ACK */
  8. #define PIPE_GATT_SERVICE_CHANGED_TX_ACK 1
  9. #define PIPE_GATT_SERVICE_CHANGED_TX_ACK_MAX_SIZE 4
  10. /* Service: Device Information - Characteristic: Hardware Revision String - Pipe: SET */
  11. #define PIPE_DEVICE_INFORMATION_HARDWARE_REVISION_STRING_SET 2
  12. #define PIPE_DEVICE_INFORMATION_HARDWARE_REVISION_STRING_SET_MAX_SIZE 9
  13. /* Service: Device Information - Characteristic: Manufacturer Name String - Pipe: SET */
  14. #define PIPE_DEVICE_INFORMATION_MANUFACTURER_NAME_STRING_SET 3
  15. #define PIPE_DEVICE_INFORMATION_MANUFACTURER_NAME_STRING_SET_MAX_SIZE 20
  16. /* Service: Device Information - Characteristic: Model Number String - Pipe: SET */
  17. #define PIPE_DEVICE_INFORMATION_MODEL_NUMBER_STRING_SET 4
  18. #define PIPE_DEVICE_INFORMATION_MODEL_NUMBER_STRING_SET_MAX_SIZE 8
  19. /* Service: Device Information - Characteristic: Firmware Revision String - Pipe: SET */
  20. #define PIPE_DEVICE_INFORMATION_FIRMWARE_REVISION_STRING_SET 5
  21. #define PIPE_DEVICE_INFORMATION_FIRMWARE_REVISION_STRING_SET_MAX_SIZE 4
  22. /* Service: Device Information - Characteristic: PNP_ID - Pipe: SET */
  23. #define PIPE_DEVICE_INFORMATION_PNP_ID_SET 6
  24. #define PIPE_DEVICE_INFORMATION_PNP_ID_SET_MAX_SIZE 7
  25. /* Service: UART over BTLE - Characteristic: UART RX - Pipe: RX */
  26. #define PIPE_UART_OVER_BTLE_UART_RX_RX 7
  27. #define PIPE_UART_OVER_BTLE_UART_RX_RX_MAX_SIZE 20
  28. /* Service: UART over BTLE - Characteristic: UART TX - Pipe: TX */
  29. #define PIPE_UART_OVER_BTLE_UART_TX_TX 8
  30. #define PIPE_UART_OVER_BTLE_UART_TX_TX_MAX_SIZE 20
  31. /* Service: UART over BTLE - Characteristic: UART Control Point - Pipe: TX */
  32. #define PIPE_UART_OVER_BTLE_UART_CONTROL_POINT_TX 9
  33. #define PIPE_UART_OVER_BTLE_UART_CONTROL_POINT_TX_MAX_SIZE 9
  34. /* Service: UART over BTLE - Characteristic: UART Control Point - Pipe: RX */
  35. #define PIPE_UART_OVER_BTLE_UART_CONTROL_POINT_RX 10
  36. #define PIPE_UART_OVER_BTLE_UART_CONTROL_POINT_RX_MAX_SIZE 9
  37. /* Service: UART over BTLE - Characteristic: UART Link Timing Current - Pipe: SET */
  38. #define PIPE_UART_OVER_BTLE_UART_LINK_TIMING_CURRENT_SET 11
  39. #define PIPE_UART_OVER_BTLE_UART_LINK_TIMING_CURRENT_SET_MAX_SIZE 6
  40. #define NUMBER_OF_PIPES 11
  41. #define SERVICES_PIPE_TYPE_MAPPING_CONTENT {\
  42. {ACI_STORE_LOCAL, ACI_TX_ACK}, \
  43. {ACI_STORE_LOCAL, ACI_SET}, \
  44. {ACI_STORE_LOCAL, ACI_SET}, \
  45. {ACI_STORE_LOCAL, ACI_SET}, \
  46. {ACI_STORE_LOCAL, ACI_SET}, \
  47. {ACI_STORE_LOCAL, ACI_SET}, \
  48. {ACI_STORE_LOCAL, ACI_RX}, \
  49. {ACI_STORE_LOCAL, ACI_TX}, \
  50. {ACI_STORE_LOCAL, ACI_TX}, \
  51. {ACI_STORE_LOCAL, ACI_RX}, \
  52. {ACI_STORE_LOCAL, ACI_SET}, \
  53. }
  54. #define GAP_PPCP_MAX_CONN_INT 0x12 /**< Maximum connection interval as a multiple of 1.25 msec , 0xFFFF means no specific value requested */
  55. #define GAP_PPCP_MIN_CONN_INT 0xa /**< Minimum connection interval as a multiple of 1.25 msec , 0xFFFF means no specific value requested */
  56. #define GAP_PPCP_SLAVE_LATENCY 0
  57. #define GAP_PPCP_CONN_TIMEOUT 0xa /** Connection Supervision timeout multiplier as a multiple of 10msec, 0xFFFF means no specific value requested */
  58. #define NB_SETUP_MESSAGES 30
  59. #define SETUP_MESSAGES_CONTENT {\
  60. {0x00,\
  61. {\
  62. 0x07,0x06,0x00,0x00,0x02,0x02,0x41,0xfe,\
  63. },\
  64. },\
  65. {0x00,\
  66. {\
  67. 0x1f,0x06,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0a,0x00,0x0b,0x01,0x01,0x00,0x00,0x06,0x00,0x00,\
  68. 0x90,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,\
  69. },\
  70. },\
  71. {0x00,\
  72. {\
  73. 0x1e,0x06,0x10,0x1c,0x01,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,\
  74. 0x00,0x00,0x00,0x10,0x00,0x00,0x00,0x14,0x03,0x90,0x01,\
  75. },\
  76. },\
  77. {0x00,\
  78. {\
  79. 0x1f,0x06,0x20,0x00,0x04,0x04,0x02,0x02,0x00,0x01,0x28,0x00,0x01,0x00,0x18,0x04,0x04,0x05,0x05,0x00,\
  80. 0x02,0x28,0x03,0x01,0x02,0x03,0x00,0x00,0x2a,0x04,0x04,0x14,\
  81. },\
  82. },\
  83. {0x00,\
  84. {\
  85. 0x1f,0x06,0x20,0x1c,0x05,0x00,0x03,0x2a,0x00,0x01,0x48,0x65,0x6c,0x6c,0x6f,0x63,0x73,0x65,0x6d,0x69,\
  86. 0x2e,0x63,0x6f,0x6d,0x00,0x00,0x00,0x00,0x00,0x00,0x04,0x04,\
  87. },\
  88. },\
  89. {0x00,\
  90. {\
  91. 0x1f,0x06,0x20,0x38,0x05,0x05,0x00,0x04,0x28,0x03,0x01,0x02,0x05,0x00,0x01,0x2a,0x06,0x04,0x03,0x02,\
  92. 0x00,0x05,0x2a,0x01,0x01,0x80,0x00,0x04,0x04,0x05,0x05,0x00,\
  93. },\
  94. },\
  95. {0x00,\
  96. {\
  97. 0x1f,0x06,0x20,0x54,0x06,0x28,0x03,0x01,0x02,0x07,0x00,0x04,0x2a,0x06,0x04,0x09,0x08,0x00,0x07,0x2a,\
  98. 0x04,0x01,0x0a,0x00,0x12,0x00,0x00,0x00,0x0a,0x00,0x04,0x04,\
  99. },\
  100. },\
  101. {0x00,\
  102. {\
  103. 0x1f,0x06,0x20,0x70,0x02,0x02,0x00,0x08,0x28,0x00,0x01,0x01,0x18,0x04,0x04,0x05,0x05,0x00,0x09,0x28,\
  104. 0x03,0x01,0x22,0x0a,0x00,0x05,0x2a,0x26,0x04,0x05,0x04,0x00,\
  105. },\
  106. },\
  107. {0x00,\
  108. {\
  109. 0x1f,0x06,0x20,0x8c,0x0a,0x2a,0x05,0x01,0x00,0x00,0x00,0x00,0x46,0x14,0x03,0x02,0x00,0x0b,0x29,0x02,\
  110. 0x01,0x00,0x00,0x04,0x04,0x02,0x02,0x00,0x0c,0x28,0x00,0x01,\
  111. },\
  112. },\
  113. {0x00,\
  114. {\
  115. 0x1f,0x06,0x20,0xa8,0x0a,0x18,0x04,0x04,0x05,0x05,0x00,0x0d,0x28,0x03,0x01,0x02,0x0e,0x00,0x27,0x2a,\
  116. 0x04,0x04,0x09,0x01,0x00,0x0e,0x2a,0x27,0x01,0x0a,0x00,0x00,\
  117. },\
  118. },\
  119. {0x00,\
  120. {\
  121. 0x1f,0x06,0x20,0xc4,0x00,0x00,0x00,0x00,0x00,0x00,0x04,0x04,0x05,0x05,0x00,0x0f,0x28,0x03,0x01,0x02,\
  122. 0x10,0x00,0x29,0x2a,0x04,0x04,0x14,0x02,0x00,0x10,0x2a,0x29,\
  123. },\
  124. },\
  125. {0x00,\
  126. {\
  127. 0x1f,0x06,0x20,0xe0,0x01,0x30,0x31,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,\
  128. 0x00,0x00,0x00,0x00,0x00,0x04,0x04,0x05,0x05,0x00,0x11,0x28,\
  129. },\
  130. },\
  131. {0x00,\
  132. {\
  133. 0x1f,0x06,0x20,0xfc,0x03,0x01,0x02,0x12,0x00,0x24,0x2a,0x04,0x04,0x08,0x02,0x00,0x12,0x2a,0x24,0x01,\
  134. 0x31,0x32,0x00,0x00,0x00,0x00,0x00,0x00,0x04,0x04,0x05,0x05,\
  135. },\
  136. },\
  137. {0x00,\
  138. {\
  139. 0x1f,0x06,0x21,0x18,0x00,0x13,0x28,0x03,0x01,0x02,0x14,0x00,0x26,0x2a,0x04,0x04,0x04,0x02,0x00,0x14,\
  140. 0x2a,0x26,0x01,0x33,0x34,0x00,0x00,0x04,0x04,0x05,0x05,0x00,\
  141. },\
  142. },\
  143. {0x00,\
  144. {\
  145. 0x1f,0x06,0x21,0x34,0x15,0x28,0x03,0x01,0x02,0x16,0x00,0x50,0x2a,0x06,0x04,0x08,0x07,0x00,0x16,0x2a,\
  146. 0x50,0x01,0x02,0x00,0x00,0xaa,0xaa,0xcc,0xcc,0x04,0x04,0x10,\
  147. },\
  148. },\
  149. {0x00,\
  150. {\
  151. 0x1f,0x06,0x21,0x50,0x10,0x00,0x17,0x28,0x00,0x01,0x9e,0xca,0xdc,0x24,0x0e,0xe5,0xa9,0xe0,0x93,0xf3,\
  152. 0xa3,0xb5,0x01,0x00,0x40,0x6e,0x04,0x04,0x13,0x13,0x00,0x18,\
  153. },\
  154. },\
  155. {0x00,\
  156. {\
  157. 0x1f,0x06,0x21,0x6c,0x28,0x03,0x01,0x04,0x19,0x00,0x9e,0xca,0xdc,0x24,0x0e,0xe5,0xa9,0xe0,0x93,0xf3,\
  158. 0xa3,0xb5,0x02,0x00,0x40,0x6e,0x44,0x10,0x14,0x00,0x00,0x19,\
  159. },\
  160. },\
  161. {0x00,\
  162. {\
  163. 0x1f,0x06,0x21,0x88,0x00,0x02,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,\
  164. 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x04,0x04,0x13,0x13,0x00,\
  165. },\
  166. },\
  167. {0x00,\
  168. {\
  169. 0x1f,0x06,0x21,0xa4,0x1a,0x28,0x03,0x01,0x10,0x1b,0x00,0x9e,0xca,0xdc,0x24,0x0e,0xe5,0xa9,0xe0,0x93,\
  170. 0xf3,0xa3,0xb5,0x03,0x00,0x40,0x6e,0x14,0x00,0x14,0x00,0x00,\
  171. },\
  172. },\
  173. {0x00,\
  174. {\
  175. 0x1f,0x06,0x21,0xc0,0x1b,0x00,0x03,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,\
  176. 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x46,0x14,0x03,0x02,\
  177. },\
  178. },\
  179. {0x00,\
  180. {\
  181. 0x1f,0x06,0x21,0xdc,0x00,0x1c,0x29,0x02,0x01,0x00,0x00,0x04,0x04,0x13,0x13,0x00,0x1d,0x28,0x03,0x01,\
  182. 0x14,0x1e,0x00,0x9e,0xca,0xdc,0x24,0x0e,0xe5,0xa9,0xe0,0x93,\
  183. },\
  184. },\
  185. {0x00,\
  186. {\
  187. 0x1f,0x06,0x21,0xf8,0xf3,0xa3,0xb5,0x04,0x00,0x40,0x6e,0x54,0x10,0x09,0x00,0x00,0x1e,0x00,0x04,0x02,\
  188. 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x46,0x14,0x03,\
  189. },\
  190. },\
  191. {0x00,\
  192. {\
  193. 0x1f,0x06,0x22,0x14,0x02,0x00,0x1f,0x29,0x02,0x01,0x00,0x00,0x04,0x04,0x13,0x13,0x00,0x20,0x28,0x03,\
  194. 0x01,0x02,0x21,0x00,0x9e,0xca,0xdc,0x24,0x0e,0xe5,0xa9,0xe0,\
  195. },\
  196. },\
  197. {0x00,\
  198. {\
  199. 0x1b,0x06,0x22,0x30,0x93,0xf3,0xa3,0xb5,0x05,0x00,0x40,0x6e,0x06,0x04,0x07,0x06,0x00,0x21,0x00,0x05,\
  200. 0x02,0xff,0xff,0xff,0xff,0xff,0xff,0x00,\
  201. },\
  202. },\
  203. {0x00,\
  204. {\
  205. 0x1f,0x06,0x40,0x00,0x2a,0x05,0x01,0x00,0x04,0x04,0x00,0x0a,0x00,0x0b,0x2a,0x27,0x01,0x00,0x80,0x04,\
  206. 0x00,0x0e,0x00,0x00,0x2a,0x29,0x01,0x00,0x80,0x04,0x00,0x10,\
  207. },\
  208. },\
  209. {0x00,\
  210. {\
  211. 0x1f,0x06,0x40,0x1c,0x00,0x00,0x2a,0x24,0x01,0x00,0x80,0x04,0x00,0x12,0x00,0x00,0x2a,0x26,0x01,0x00,\
  212. 0x80,0x04,0x00,0x14,0x00,0x00,0x2a,0x50,0x01,0x00,0x80,0x04,\
  213. },\
  214. },\
  215. {0x00,\
  216. {\
  217. 0x1f,0x06,0x40,0x38,0x00,0x16,0x00,0x00,0x00,0x02,0x02,0x00,0x08,0x04,0x00,0x19,0x00,0x00,0x00,0x03,\
  218. 0x02,0x00,0x02,0x04,0x00,0x1b,0x00,0x1c,0x00,0x04,0x02,0x00,\
  219. },\
  220. },\
  221. {0x00,\
  222. {\
  223. 0x13,0x06,0x40,0x54,0x0a,0x04,0x00,0x1e,0x00,0x1f,0x00,0x05,0x02,0x00,0x80,0x04,0x00,0x21,0x00,0x00,\
  224. },\
  225. },\
  226. {0x00,\
  227. {\
  228. 0x13,0x06,0x50,0x00,0x9e,0xca,0xdc,0x24,0x0e,0xe5,0xa9,0xe0,0x93,0xf3,0xa3,0xb5,0x00,0x00,0x40,0x6e,\
  229. },\
  230. },\
  231. {0x00,\
  232. {\
  233. 0x06,0x06,0xf0,0x00,0x02,0xb2,0xd1,\
  234. },\
  235. },\
  236. }