ble_gattc_struct_serialization.h 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293
  1. /**
  2. * Copyright (c) 2014 - 2020, Nordic Semiconductor ASA
  3. *
  4. * All rights reserved.
  5. *
  6. * Redistribution and use in source and binary forms, with or without modification,
  7. * are permitted provided that the following conditions are met:
  8. *
  9. * 1. Redistributions of source code must retain the above copyright notice, this
  10. * list of conditions and the following disclaimer.
  11. *
  12. * 2. Redistributions in binary form, except as embedded into a Nordic
  13. * Semiconductor ASA integrated circuit in a product or a software update for
  14. * such product, must reproduce the above copyright notice, this list of
  15. * conditions and the following disclaimer in the documentation and/or other
  16. * materials provided with the distribution.
  17. *
  18. * 3. Neither the name of Nordic Semiconductor ASA nor the names of its
  19. * contributors may be used to endorse or promote products derived from this
  20. * software without specific prior written permission.
  21. *
  22. * 4. This software, with or without modification, must only be used with a
  23. * Nordic Semiconductor ASA integrated circuit.
  24. *
  25. * 5. Any software provided in binary form under this license must not be reverse
  26. * engineered, decompiled, modified and/or disassembled.
  27. *
  28. * THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA "AS IS" AND ANY EXPRESS
  29. * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
  30. * OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE
  31. * DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA OR CONTRIBUTORS BE
  32. * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
  33. * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
  34. * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  35. * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
  36. * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
  37. * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  38. *
  39. */
  40. #ifndef BLE_GATTC_STRUCT_SERIALIZATION_H
  41. #define BLE_GATTC_STRUCT_SERIALIZATION_H
  42. #include "ble_gattc.h"
  43. #ifdef __cplusplus
  44. extern "C" {
  45. #endif
  46. uint32_t ble_gattc_evt_char_val_by_uuid_read_rsp_t_enc(void const * const p_void_struct,
  47. uint8_t * const p_buf,
  48. uint32_t buf_len,
  49. uint32_t * const p_index);
  50. uint32_t ble_gattc_evt_char_val_by_uuid_read_rsp_t_dec(uint8_t const * const p_buf,
  51. uint32_t buf_len,
  52. uint32_t * const p_index,
  53. uint32_t * const p_ext_len,
  54. void * const p_void_struct);
  55. uint32_t ble_gattc_evt_char_vals_read_rsp_t_enc(void const * const p_void_struct,
  56. uint8_t * const p_buf,
  57. uint32_t buf_len,
  58. uint32_t * const p_index);
  59. uint32_t ble_gattc_evt_char_vals_read_rsp_t_dec(uint8_t const * const p_buf,
  60. uint32_t buf_len,
  61. uint32_t * const p_index,
  62. uint32_t * const p_ext_len,
  63. void * const p_void_struct);
  64. uint32_t ble_gattc_handle_range_t_enc(void const * const p_void_struct,
  65. uint8_t * const p_buf,
  66. uint32_t buf_len,
  67. uint32_t * const p_index);
  68. uint32_t ble_gattc_handle_range_t_dec(uint8_t const * const p_buf,
  69. uint32_t buf_len,
  70. uint32_t * const p_index,
  71. void * const p_void_struct);
  72. uint32_t ble_gattc_service_t_enc(void const * const p_void_struct,
  73. uint8_t * const p_buf,
  74. uint32_t buf_len,
  75. uint32_t * const p_index);
  76. uint32_t ble_gattc_service_t_dec(uint8_t const * const p_buf,
  77. uint32_t buf_len,
  78. uint32_t * const p_index,
  79. void * const p_void_struct);
  80. uint32_t ble_gattc_include_t_enc(void const * const p_void_struct,
  81. uint8_t * const p_buf,
  82. uint32_t buf_len,
  83. uint32_t * const p_index);
  84. uint32_t ble_gattc_include_t_dec(uint8_t const * const p_buf,
  85. uint32_t buf_len,
  86. uint32_t * const p_index,
  87. void * const p_void_struct);
  88. uint32_t ble_gattc_evt_rel_disc_rsp_t_enc(void const * const p_void_struct,
  89. uint8_t * const p_buf,
  90. uint32_t buf_len,
  91. uint32_t * const p_index);
  92. uint32_t ble_gattc_evt_rel_disc_rsp_t_dec(uint8_t const * const p_buf,
  93. uint32_t buf_len,
  94. uint32_t * const p_index,
  95. uint32_t * const p_ext_len,
  96. void * const p_void_struct);
  97. uint32_t ble_gattc_write_params_t_enc(void const * const p_void_struct,
  98. uint8_t * const p_buf,
  99. uint32_t buf_len,
  100. uint32_t * const p_index);
  101. uint32_t ble_gattc_write_params_t_dec(uint8_t const * const p_buf,
  102. uint32_t buf_len,
  103. uint32_t * const p_index,
  104. void * const p_void_struct);
  105. uint32_t ble_gattc_attr_info16_t_enc(void const * const p_void_struct,
  106. uint8_t * const p_buf,
  107. uint32_t buf_len,
  108. uint32_t * const p_index);
  109. uint32_t ble_gattc_attr_info16_t_dec(uint8_t const * const p_buf,
  110. uint32_t buf_len,
  111. uint32_t * const p_index,
  112. void * const p_void_struct);
  113. uint32_t ble_gattc_attr_info128_t_enc(void const * const p_void_struct,
  114. uint8_t * const p_buf,
  115. uint32_t buf_len,
  116. uint32_t * const p_index);
  117. uint32_t ble_gattc_attr_info128_t_dec(uint8_t const * const p_buf,
  118. uint32_t buf_len,
  119. uint32_t * const p_index,
  120. void * const p_void_struct);
  121. uint32_t ble_gattc_evt_attr_info_disc_rsp_t_enc(void const * const p_void_struct,
  122. uint8_t * const p_buf,
  123. uint32_t buf_len,
  124. uint32_t * const p_index);
  125. uint32_t ble_gattc_evt_attr_info_disc_rsp_t_dec(uint8_t const * const p_buf,
  126. uint32_t buf_len,
  127. uint32_t * const p_index,
  128. uint32_t * const p_ext_len,
  129. void * const p_void_struct);
  130. uint32_t ble_gatt_char_props_t_enc(void const * const p_void_struct,
  131. uint8_t * const p_buf,
  132. uint32_t buf_len,
  133. uint32_t * const p_index);
  134. uint32_t ble_gatt_char_props_t_dec(uint8_t const * const p_buf,
  135. uint32_t buf_len,
  136. uint32_t * const p_index,
  137. void * const p_void_struct);
  138. uint32_t ble_gatt_char_ext_props_t_enc(void const * const p_void_struct,
  139. uint8_t * const p_buf,
  140. uint32_t buf_len,
  141. uint32_t * const p_index);
  142. uint32_t ble_gatt_char_ext_props_t_dec(uint8_t const * const p_buf,
  143. uint32_t buf_len,
  144. uint32_t * const p_index,
  145. void * const p_void_struct);
  146. uint32_t ble_gattc_char_t_enc(void const * const p_void_struct,
  147. uint8_t * const p_buf,
  148. uint32_t buf_len,
  149. uint32_t * const p_index);
  150. uint32_t ble_gattc_char_t_dec(uint8_t const * const p_buf,
  151. uint32_t buf_len,
  152. uint32_t * const p_index,
  153. void * const p_void_struct);
  154. uint32_t ble_gattc_evt_char_disc_rsp_t_enc(void const * const p_void_struct,
  155. uint8_t * const p_buf,
  156. uint32_t buf_len,
  157. uint32_t * const p_index);
  158. uint32_t ble_gattc_evt_char_disc_rsp_t_dec(uint8_t const * const p_buf,
  159. uint32_t buf_len,
  160. uint32_t * const p_index,
  161. uint32_t * const p_ext_len,
  162. void * const p_void_struct);
  163. uint32_t ble_gattc_desc_t_enc(void const * const p_void_struct,
  164. uint8_t * const p_buf,
  165. uint32_t buf_len,
  166. uint32_t * const p_index);
  167. uint32_t ble_gattc_desc_t_dec(uint8_t const * const p_buf,
  168. uint32_t buf_len,
  169. uint32_t * const p_index,
  170. void * const p_void_struct);
  171. uint32_t ble_gattc_evt_desc_disc_rsp_t_enc(void const * const p_void_struct,
  172. uint8_t * const p_buf,
  173. uint32_t buf_len,
  174. uint32_t * const p_index);
  175. uint32_t ble_gattc_evt_desc_disc_rsp_t_dec(uint8_t const * const p_buf,
  176. uint32_t buf_len,
  177. uint32_t * const p_index,
  178. uint32_t * const p_ext_len,
  179. void * const p_void_struct);
  180. uint32_t ble_gattc_evt_hvx_t_enc(void const * const p_void_struct,
  181. uint8_t * const p_buf,
  182. uint32_t buf_len,
  183. uint32_t * const p_index);
  184. uint32_t ble_gattc_evt_hvx_t_dec(uint8_t const * const p_buf,
  185. uint32_t buf_len,
  186. uint32_t * const p_index,
  187. uint32_t * const p_ext_len,
  188. void * const p_void_struct);
  189. uint32_t ble_gattc_evt_prim_srvc_disc_rsp_t_enc(void const * const p_void_struct,
  190. uint8_t * const p_buf,
  191. uint32_t buf_len,
  192. uint32_t * const p_index);
  193. uint32_t ble_gattc_evt_prim_srvc_disc_rsp_t_dec(uint8_t const * const p_buf,
  194. uint32_t buf_len,
  195. uint32_t * const p_index,
  196. uint32_t * const p_ext_len,
  197. void * const p_void_struct);
  198. uint32_t ble_gattc_evt_read_rsp_t_enc(void const * const p_void_struct,
  199. uint8_t * const p_buf,
  200. uint32_t buf_len,
  201. uint32_t * const p_index);
  202. uint32_t ble_gattc_evt_read_rsp_t_dec(uint8_t const * const p_buf,
  203. uint32_t buf_len,
  204. uint32_t * const p_index,
  205. uint32_t * const p_ext_len,
  206. void * const p_void_struct);
  207. uint32_t ble_gattc_evt_timeout_t_enc(void const * const p_void_struct,
  208. uint8_t * const p_buf,
  209. uint32_t buf_len,
  210. uint32_t * const p_index);
  211. uint32_t ble_gattc_evt_timeout_t_dec(uint8_t const * const p_buf,
  212. uint32_t buf_len,
  213. uint32_t * const p_index,
  214. void * const p_void_struct);
  215. uint32_t ble_gattc_evt_write_rsp_t_enc(void const * const p_void_struct,
  216. uint8_t * const p_buf,
  217. uint32_t buf_len,
  218. uint32_t * const p_index);
  219. uint32_t ble_gattc_evt_write_rsp_t_dec(uint8_t const * const p_buf,
  220. uint32_t buf_len,
  221. uint32_t * const p_index,
  222. uint32_t * const p_ext_len,
  223. void * const p_void_struct);
  224. uint32_t ble_gattc_evt_exchange_mtu_rsp_t_enc(void const * const p_void_struct,
  225. uint8_t * const p_buf,
  226. uint32_t buf_len,
  227. uint32_t * const p_index);
  228. uint32_t ble_gattc_evt_exchange_mtu_rsp_t_dec(uint8_t const * const p_buf,
  229. uint32_t buf_len,
  230. uint32_t * const p_index,
  231. void * const p_void_struct);
  232. #if NRF_SD_BLE_API_VERSION >= 4
  233. uint32_t ble_gattc_conn_cfg_t_enc(void const * const p_void_struct,
  234. uint8_t * const p_buf,
  235. uint32_t buf_len,
  236. uint32_t * const p_index);
  237. uint32_t ble_gattc_conn_cfg_t_dec(uint8_t const * const p_buf,
  238. uint32_t buf_len,
  239. uint32_t * const p_index,
  240. void * const p_void_struct);
  241. #endif
  242. #ifdef __cplusplus
  243. }
  244. #endif
  245. #endif /*BLE_GATTC_STRUCT_SERIALIZATION_H*/