ble_gatts_struct_serialization.h 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259
  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_GATTS_STRUCT_SERIALIZATION_H
  41. #define BLE_GATTS_STRUCT_SERIALIZATION_H
  42. #include "ble_gatts.h"
  43. #ifdef __cplusplus
  44. extern "C" {
  45. #endif
  46. uint32_t ble_gatts_char_pf_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_gatts_char_pf_t_dec(uint8_t const * const p_buf,
  51. uint32_t buf_len,
  52. uint32_t * const p_index,
  53. void * const p_void_struct);
  54. uint32_t ble_gatts_attr_md_t_enc(void const * const p_void_struct,
  55. uint8_t * const p_buf,
  56. uint32_t buf_len,
  57. uint32_t * const p_index);
  58. uint32_t ble_gatts_attr_md_t_dec(uint8_t const * const p_buf,
  59. uint32_t buf_len,
  60. uint32_t * const p_index,
  61. void * const p_void_struct);
  62. uint32_t ble_gatts_char_md_t_enc(void const * const p_void_struct,
  63. uint8_t * const p_buf,
  64. uint32_t buf_len,
  65. uint32_t * const p_index);
  66. uint32_t ble_gatts_char_md_t_dec(uint8_t const * const p_buf,
  67. uint32_t buf_len,
  68. uint32_t * const p_index,
  69. void * const p_void_struct);
  70. uint32_t ble_gatts_attr_t_enc(void const * const p_void_struct,
  71. uint8_t * const p_buf,
  72. uint32_t buf_len,
  73. uint32_t * const p_index);
  74. uint32_t ble_gatts_attr_t_dec(uint8_t const * const p_buf,
  75. uint32_t buf_len,
  76. uint32_t * const p_index,
  77. void * const p_void_struct);
  78. uint32_t ble_gatts_char_handles_t_enc(void const * const p_void_struct,
  79. uint8_t * const p_buf,
  80. uint32_t buf_len,
  81. uint32_t * const p_index);
  82. uint32_t ble_gatts_char_handles_t_dec(uint8_t const * const p_buf,
  83. uint32_t buf_len,
  84. uint32_t * const p_index,
  85. void * const p_void_struct);
  86. uint32_t ble_gatts_evt_write_t_enc(void const * const p_void_struct,
  87. uint8_t * const p_buf,
  88. uint32_t buf_len,
  89. uint32_t * const p_index);
  90. uint32_t ble_gatts_evt_write_t_dec(uint8_t const * const p_buf,
  91. uint32_t buf_len,
  92. uint32_t * const p_index,
  93. uint32_t * const p_ext_len,
  94. void * const p_void_struct);
  95. uint32_t ble_gatts_hvx_params_t_enc(void const * const p_void_struct,
  96. uint8_t * const p_buf,
  97. uint32_t buf_len,
  98. uint32_t * const p_index);
  99. uint32_t ble_gatts_hvx_params_t_dec(uint8_t const * const p_buf,
  100. uint32_t buf_len,
  101. uint32_t * const p_index,
  102. void * const p_void_struct);
  103. uint32_t ble_gatts_evt_read_t_enc(void const * const p_void_struct,
  104. uint8_t * const p_buf,
  105. uint32_t buf_len,
  106. uint32_t * const p_index);
  107. uint32_t ble_gatts_evt_read_t_dec(uint8_t const * const p_buf,
  108. uint32_t buf_len,
  109. uint32_t * const p_index,
  110. void * const p_void_struct);
  111. uint32_t ble_gatts_evt_rw_authorize_request_t_enc(void const * const p_void_struct,
  112. uint8_t * const p_buf,
  113. uint32_t buf_len,
  114. uint32_t * const p_index);
  115. uint32_t ble_gatts_evt_rw_authorize_request_t_dec(uint8_t const * const p_buf,
  116. uint32_t buf_len,
  117. uint32_t * const p_index,
  118. uint32_t * const p_ext_len,
  119. void * const p_void_struct);
  120. uint32_t ble_gatts_authorize_params_t_enc(void const * const p_void_struct,
  121. uint8_t * const p_buf,
  122. uint32_t buf_len,
  123. uint32_t * const p_index);
  124. uint32_t ble_gatts_authorize_params_t_dec(uint8_t const * const p_buf,
  125. uint32_t buf_len,
  126. uint32_t * const p_index,
  127. void * const p_void_struct);
  128. uint32_t ble_gatts_rw_authorize_reply_params_t_enc(void const * const p_void_struct,
  129. uint8_t * const p_buf,
  130. uint32_t buf_len,
  131. uint32_t * const p_index);
  132. uint32_t ble_gatts_rw_authorize_reply_params_t_dec(uint8_t const * const p_buf,
  133. uint32_t buf_len,
  134. uint32_t * const p_index,
  135. void * const p_void_struct);
  136. #if defined(NRF_SD_BLE_API_VERSION) && NRF_SD_BLE_API_VERSION < 4
  137. uint32_t ble_gatts_enable_params_t_enc(void const * const p_void_struct,
  138. uint8_t * const p_buf,
  139. uint32_t buf_len,
  140. uint32_t * const p_index);
  141. uint32_t ble_gatts_enable_params_t_dec(uint8_t const * const p_buf,
  142. uint32_t buf_len,
  143. uint32_t * const p_index,
  144. void * const p_void_struct);
  145. #endif
  146. uint32_t ble_gatts_value_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_gatts_value_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_gatts_evt_exchange_mtu_request_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_gatts_evt_exchange_mtu_request_t_dec(uint8_t const * const p_buf,
  159. uint32_t buf_len,
  160. uint32_t * const p_index,
  161. void * const p_void_struct);
  162. uint32_t ble_gatts_evt_hvc_t_enc(void const * const p_void_struct,
  163. uint8_t * const p_buf,
  164. uint32_t buf_len,
  165. uint32_t * const p_index);
  166. uint32_t ble_gatts_evt_hvc_t_dec(uint8_t const * const p_buf,
  167. uint32_t buf_len,
  168. uint32_t * const p_index,
  169. void * const p_void_struct);
  170. uint32_t ble_gatts_evt_sys_attr_missing_t_enc(void const * const p_void_struct,
  171. uint8_t * const p_buf,
  172. uint32_t buf_len,
  173. uint32_t * const p_index);
  174. uint32_t ble_gatts_evt_sys_attr_missing_t_dec(uint8_t const * const p_buf,
  175. uint32_t buf_len,
  176. uint32_t * const p_index,
  177. void * const p_void_struct);
  178. uint32_t ble_gatts_evt_timeout_t_enc(void const * const p_void_struct,
  179. uint8_t * const p_buf,
  180. uint32_t buf_len,
  181. uint32_t * const p_index);
  182. uint32_t ble_gatts_evt_timeout_t_dec(uint8_t const * const p_buf,
  183. uint32_t buf_len,
  184. uint32_t * const p_index,
  185. void * const p_void_struct);
  186. #if NRF_SD_BLE_API_VERSION >= 4
  187. uint32_t ble_gatts_conn_cfg_t_enc(void const * const p_void_struct,
  188. uint8_t * const p_buf,
  189. uint32_t buf_len,
  190. uint32_t * const p_index);
  191. uint32_t ble_gatts_conn_cfg_t_dec(uint8_t const * const p_buf,
  192. uint32_t buf_len,
  193. uint32_t * const p_index,
  194. void * const p_void_struct);
  195. uint32_t ble_gatts_cfg_service_changed_t_enc(void const * const p_void_struct,
  196. uint8_t * const p_buf,
  197. uint32_t buf_len,
  198. uint32_t * const p_index);
  199. uint32_t ble_gatts_cfg_service_changed_t_dec(uint8_t const * const p_buf,
  200. uint32_t buf_len,
  201. uint32_t * const p_index,
  202. void * const p_void_struct);
  203. uint32_t ble_gatts_cfg_attr_tab_size_t_enc(void const * const p_void_struct,
  204. uint8_t * const p_buf,
  205. uint32_t buf_len,
  206. uint32_t * const p_index);
  207. uint32_t ble_gatts_cfg_attr_tab_size_t_dec(uint8_t const * const p_buf,
  208. uint32_t buf_len,
  209. uint32_t * const p_index,
  210. void * const p_void_struct);
  211. #endif
  212. #ifdef __cplusplus
  213. }
  214. #endif
  215. #endif /* BLE_GATTS_STRUCT_SERIALIZATION_H */