ble_struct_serialization.c 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545
  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. #include "ble_struct_serialization.h"
  41. #include "ble_gap_struct_serialization.h"
  42. #include "ble_gatt_struct_serialization.h"
  43. #include "ble_gatts_struct_serialization.h"
  44. #include "ble_serialization.h"
  45. #include "app_util.h"
  46. #include "ble_types.h"
  47. #include "ble.h"
  48. #include "cond_field_serialization.h"
  49. #include "ser_config.h"
  50. #include <string.h>
  51. #if NRF_SD_BLE_API_VERSION > 5
  52. #ifdef UNIT_TEST
  53. #include "conn_ble_gap_sec_keys.h"
  54. #include "app_ble_gap_sec_keys.h"
  55. bool serialization_connectivity_role = true;
  56. #elif defined(SER_CONNECTIVITY)
  57. #include "conn_ble_gap_sec_keys.h"
  58. #else
  59. #include "app_ble_gap_sec_keys.h"
  60. #endif /* UNIT_TEST */
  61. #endif /* NRF_SD_BLE_API_VERSION > 5 */
  62. uint32_t ble_uuid_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. {
  67. SER_STRUCT_ENC_BEGIN(ble_uuid_t);
  68. SER_PUSH_uint16(&p_struct->uuid);
  69. SER_PUSH_uint8(&p_struct->type);
  70. SER_STRUCT_ENC_END;
  71. }
  72. uint32_t ble_uuid_t_dec(uint8_t const * const p_buf,
  73. uint32_t buf_len,
  74. uint32_t * const p_index,
  75. void * const p_void_struct)
  76. {
  77. SER_STRUCT_DEC_BEGIN(ble_uuid_t);
  78. SER_PULL_uint16(&p_struct->uuid);
  79. SER_PULL_uint8(&p_struct->type);
  80. SER_STRUCT_DEC_END;
  81. }
  82. uint32_t ble_uuid128_t_enc(void const * const p_void_struct,
  83. uint8_t * const p_buf,
  84. uint32_t buf_len,
  85. uint32_t * const p_index)
  86. {
  87. SER_STRUCT_ENC_BEGIN(ble_uuid128_t);
  88. SER_PUSH_uint8array(p_struct->uuid128, sizeof (p_struct->uuid128));
  89. SER_STRUCT_ENC_END;
  90. }
  91. uint32_t ble_uuid128_t_dec(uint8_t const * const p_buf,
  92. uint32_t buf_len,
  93. uint32_t * const p_index,
  94. void * const p_void_struct)
  95. {
  96. SER_STRUCT_DEC_BEGIN(ble_uuid128_t);
  97. SER_PULL_uint8array(p_struct->uuid128, sizeof (p_struct->uuid128));
  98. SER_STRUCT_DEC_END;
  99. }
  100. #if defined(NRF_SD_BLE_API_VERSION) && NRF_SD_BLE_API_VERSION < 4
  101. uint32_t ble_enable_params_t_enc(void const * const p_void_struct,
  102. uint8_t * const p_buf,
  103. uint32_t buf_len,
  104. uint32_t * const p_index)
  105. {
  106. SER_STRUCT_ENC_BEGIN(ble_enable_params_t);
  107. SER_PUSH_FIELD(&p_struct->common_enable_params, ble_common_enable_params_t_enc);
  108. SER_PUSH_FIELD(&p_struct->gap_enable_params, ble_gap_enable_params_t_enc);
  109. SER_PUSH_FIELD(&p_struct->gatt_enable_params, ble_gatt_enable_params_t_enc);
  110. SER_PUSH_FIELD(&p_struct->gatts_enable_params, ble_gatts_enable_params_t_enc);
  111. SER_STRUCT_ENC_END;
  112. }
  113. uint32_t ble_enable_params_t_dec(uint8_t const * const p_buf,
  114. uint32_t buf_len,
  115. uint32_t * const p_index,
  116. void * const p_void_struct)
  117. {
  118. SER_STRUCT_DEC_BEGIN(ble_enable_params_t);
  119. SER_PULL_FIELD(&p_struct->common_enable_params, ble_common_enable_params_t_dec);
  120. SER_PULL_FIELD(&p_struct->gap_enable_params, ble_gap_enable_params_t_dec);
  121. SER_PULL_FIELD(&p_struct->gatt_enable_params, ble_gatt_enable_params_t_dec);
  122. SER_PULL_FIELD(&p_struct->gatts_enable_params, ble_gatts_enable_params_t_dec);
  123. SER_STRUCT_DEC_END;
  124. }
  125. uint32_t ble_conn_bw_t_enc(void const * const p_void_struct,
  126. uint8_t * const p_buf,
  127. uint32_t buf_len,
  128. uint32_t * const p_index)
  129. {
  130. SER_STRUCT_ENC_BEGIN(ble_conn_bw_t);
  131. SER_PUSH_uint8(&p_struct->conn_bw_rx);
  132. SER_PUSH_uint8(&p_struct->conn_bw_tx);
  133. SER_STRUCT_ENC_END;
  134. }
  135. uint32_t ble_conn_bw_t_dec(uint8_t const * const p_buf,
  136. uint32_t buf_len,
  137. uint32_t * const p_index,
  138. void * const p_void_struct)
  139. {
  140. SER_STRUCT_DEC_BEGIN(ble_conn_bw_t);
  141. SER_PULL_uint8(&p_struct->conn_bw_rx);
  142. SER_PULL_uint8(&p_struct->conn_bw_tx);
  143. SER_STRUCT_DEC_END;
  144. }
  145. uint32_t ble_common_opt_conn_bw_t_enc(void const * const p_void_struct,
  146. uint8_t * const p_buf,
  147. uint32_t buf_len,
  148. uint32_t * const p_index)
  149. {
  150. SER_STRUCT_ENC_BEGIN(ble_common_opt_conn_bw_t);
  151. SER_PUSH_uint8(&p_struct->role);
  152. SER_PUSH_FIELD(&p_struct->conn_bw, ble_conn_bw_t_enc);
  153. SER_STRUCT_ENC_END;
  154. }
  155. uint32_t ble_common_opt_conn_bw_t_dec(uint8_t const * const p_buf,
  156. uint32_t buf_len,
  157. uint32_t * const p_index,
  158. void * const p_void_struct)
  159. {
  160. SER_STRUCT_DEC_BEGIN(ble_common_opt_conn_bw_t);
  161. SER_PULL_uint8(&p_struct->role);
  162. SER_PULL_FIELD(&p_struct->conn_bw, ble_conn_bw_t_dec);
  163. SER_STRUCT_DEC_END;
  164. }
  165. uint32_t ble_conn_bw_count_t_enc(void const * const p_void_struct,
  166. uint8_t * const p_buf,
  167. uint32_t buf_len,
  168. uint32_t * const p_index)
  169. {
  170. SER_STRUCT_ENC_BEGIN(ble_conn_bw_count_t);
  171. SER_PUSH_uint8(&p_struct->high_count);
  172. SER_PUSH_uint8(&p_struct->mid_count);
  173. SER_PUSH_uint8(&p_struct->low_count);
  174. SER_STRUCT_DEC_END;
  175. }
  176. uint32_t ble_conn_bw_count_t_dec(uint8_t const * const p_buf,
  177. uint32_t buf_len,
  178. uint32_t * const p_index,
  179. void * const p_void_struct)
  180. {
  181. SER_STRUCT_DEC_BEGIN(ble_conn_bw_count_t);
  182. SER_PULL_uint8(&p_struct->high_count);
  183. SER_PULL_uint8(&p_struct->mid_count);
  184. SER_PULL_uint8(&p_struct->low_count);
  185. SER_STRUCT_DEC_END;
  186. }
  187. uint32_t ble_conn_bw_counts_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. {
  192. SER_STRUCT_ENC_BEGIN(ble_conn_bw_counts_t);
  193. SER_PUSH_FIELD(&p_struct->tx_counts, ble_conn_bw_count_t_enc);
  194. SER_PUSH_FIELD(&p_struct->rx_counts, ble_conn_bw_count_t_enc);
  195. SER_STRUCT_DEC_END;
  196. }
  197. uint32_t ble_conn_bw_counts_t_dec(uint8_t const * const p_buf,
  198. uint32_t buf_len,
  199. uint32_t * const p_index,
  200. void * const p_void_struct)
  201. {
  202. SER_STRUCT_DEC_BEGIN(ble_conn_bw_counts_t);
  203. SER_PULL_FIELD(&p_struct->tx_counts, ble_conn_bw_count_t_dec);
  204. SER_PULL_FIELD(&p_struct->rx_counts, ble_conn_bw_count_t_dec);
  205. SER_STRUCT_DEC_END;
  206. }
  207. uint32_t ble_common_enable_params_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. {
  212. SER_STRUCT_ENC_BEGIN(ble_common_enable_params_t);
  213. SER_PUSH_uint16(&p_struct->vs_uuid_count);
  214. SER_PUSH_COND(p_struct->p_conn_bw_counts, ble_conn_bw_counts_t_enc);
  215. SER_STRUCT_ENC_END;
  216. }
  217. uint32_t ble_common_enable_params_t_dec(uint8_t const * const p_buf,
  218. uint32_t buf_len,
  219. uint32_t * const p_index,
  220. void * const p_void_struct)
  221. {
  222. SER_STRUCT_DEC_BEGIN(ble_common_enable_params_t);
  223. SER_PULL_uint16(&p_struct->vs_uuid_count);
  224. SER_PULL_COND(&p_struct->p_conn_bw_counts, ble_conn_bw_counts_t_dec);
  225. SER_STRUCT_DEC_END;
  226. }
  227. #endif
  228. uint32_t ble_common_opt_pa_lna_t_enc(void const * const p_void_struct,
  229. uint8_t * const p_buf,
  230. uint32_t buf_len,
  231. uint32_t * const p_index)
  232. {
  233. SER_STRUCT_ENC_BEGIN(ble_common_opt_pa_lna_t);
  234. SER_PUSH_FIELD(&p_struct->pa_cfg, ble_pa_lna_cfg_t_enc);
  235. SER_PUSH_FIELD(&p_struct->lna_cfg, ble_pa_lna_cfg_t_enc);
  236. SER_PUSH_uint8(&p_struct->ppi_ch_id_set);
  237. SER_PUSH_uint8(&p_struct->ppi_ch_id_clr);
  238. SER_PUSH_uint8(&p_struct->gpiote_ch_id);
  239. SER_STRUCT_ENC_END;
  240. }
  241. uint32_t ble_common_opt_pa_lna_t_dec(uint8_t const * const p_buf,
  242. uint32_t buf_len,
  243. uint32_t * const p_index,
  244. void * const p_void_struct)
  245. {
  246. SER_STRUCT_DEC_BEGIN(ble_common_opt_pa_lna_t);
  247. SER_PULL_FIELD(&p_struct->pa_cfg, ble_pa_lna_cfg_t_dec);
  248. SER_PULL_FIELD(&p_struct->lna_cfg, ble_pa_lna_cfg_t_dec);
  249. SER_PULL_uint8(&p_struct->ppi_ch_id_set);
  250. SER_PULL_uint8(&p_struct->ppi_ch_id_clr);
  251. SER_PULL_uint8(&p_struct->gpiote_ch_id);
  252. SER_STRUCT_DEC_END;
  253. }
  254. uint32_t ble_pa_lna_cfg_t_enc(void const * const p_void_struct,
  255. uint8_t * const p_buf,
  256. uint32_t buf_len,
  257. uint32_t * const p_index)
  258. {
  259. SER_STRUCT_ENC_BEGIN(ble_pa_lna_cfg_t);
  260. uint8_t ser_data = (p_struct->enable & 0x01)
  261. | ((p_struct->active_high & 0x01) << 1)
  262. | ((p_struct->gpio_pin & 0x3F) << 2);
  263. SER_PUSH_uint8(&ser_data);
  264. SER_STRUCT_ENC_END;
  265. }
  266. uint32_t ble_pa_lna_cfg_t_dec(uint8_t const * const p_buf,
  267. uint32_t buf_len,
  268. uint32_t * const p_index,
  269. void * const p_void_struct)
  270. {
  271. SER_STRUCT_DEC_BEGIN(ble_pa_lna_cfg_t);
  272. uint8_t ser_data;
  273. SER_PULL_uint8(&ser_data);
  274. p_struct->enable = ser_data & 0x01;
  275. p_struct->active_high = (ser_data >> 1) & 0x01;
  276. p_struct->gpio_pin = (ser_data >> 2) & 0x3F;
  277. SER_STRUCT_DEC_END;
  278. }
  279. uint32_t ble_user_mem_block_t_enc(void const * const p_void_struct,
  280. uint8_t * const p_buf,
  281. uint32_t buf_len,
  282. uint32_t * const p_index)
  283. {
  284. SER_STRUCT_ENC_BEGIN(ble_user_mem_block_t);
  285. SER_PUSH_uint16(&p_struct->len);
  286. SER_PUSH_COND(p_struct->p_mem, NULL);
  287. SER_STRUCT_ENC_END;
  288. }
  289. uint32_t ble_user_mem_block_t_dec(uint8_t const * const p_buf,
  290. uint32_t buf_len,
  291. uint32_t * const p_index,
  292. void * const p_void_struct)
  293. {
  294. SER_STRUCT_DEC_BEGIN(ble_user_mem_block_t);
  295. SER_PULL_uint16(&p_struct->len);
  296. SER_PULL_COND(&p_struct->p_mem, NULL);
  297. SER_STRUCT_DEC_END;
  298. }
  299. uint32_t ble_version_t_enc(void const * const p_void_struct,
  300. uint8_t * const p_buf,
  301. uint32_t buf_len,
  302. uint32_t * const p_index)
  303. {
  304. SER_STRUCT_ENC_BEGIN(ble_version_t);
  305. SER_PUSH_uint8(&p_struct->version_number);
  306. SER_PUSH_uint16(&p_struct->company_id);
  307. SER_PUSH_uint16(&p_struct->subversion_number);
  308. SER_STRUCT_ENC_END;
  309. }
  310. uint32_t ble_version_t_dec(uint8_t const * const p_buf,
  311. uint32_t buf_len,
  312. uint32_t * const p_index,
  313. void * const p_void_struct)
  314. {
  315. SER_STRUCT_DEC_BEGIN(ble_version_t);
  316. SER_PULL_uint8(&p_struct->version_number);
  317. SER_PULL_uint16(&p_struct->company_id);
  318. SER_PULL_uint16(&p_struct->subversion_number);
  319. SER_STRUCT_DEC_END;
  320. }
  321. #if defined(NRF_SD_BLE_API_VERSION) && NRF_SD_BLE_API_VERSION < 4
  322. uint32_t ble_evt_data_length_changed_t_enc(void const * const p_void_struct,
  323. uint8_t * const p_buf,
  324. uint32_t buf_len,
  325. uint32_t * const p_index)
  326. {
  327. SER_STRUCT_ENC_BEGIN(ble_evt_data_length_changed_t);
  328. SER_PUSH_uint16(&p_struct->max_tx_octets);
  329. SER_PUSH_uint16(&p_struct->max_tx_time);
  330. SER_PUSH_uint16(&p_struct->max_rx_octets);
  331. SER_PUSH_uint16(&p_struct->max_rx_time);
  332. SER_STRUCT_ENC_END;
  333. }
  334. uint32_t ble_evt_data_length_changed_t_dec(uint8_t const * const p_buf,
  335. uint32_t buf_len,
  336. uint32_t * const p_index,
  337. void * const p_void_struct)
  338. {
  339. SER_STRUCT_DEC_BEGIN(ble_evt_data_length_changed_t);
  340. SER_PULL_uint16(&p_struct->max_tx_octets);
  341. SER_PULL_uint16(&p_struct->max_tx_time);
  342. SER_PULL_uint16(&p_struct->max_rx_octets);
  343. SER_PULL_uint16(&p_struct->max_rx_time);
  344. SER_STRUCT_DEC_END;
  345. }
  346. #endif
  347. uint32_t ble_common_opt_conn_evt_ext_t_enc(void const * const p_void_struct,
  348. uint8_t * const p_buf,
  349. uint32_t buf_len,
  350. uint32_t * const p_index)
  351. {
  352. SER_STRUCT_ENC_BEGIN(ble_common_opt_conn_evt_ext_t);
  353. uint8_t ser_data = p_struct->enable & 0x01;
  354. SER_PUSH_uint8(&ser_data);
  355. SER_STRUCT_ENC_END;
  356. }
  357. uint32_t ble_common_opt_conn_evt_ext_t_dec(uint8_t const * const p_buf,
  358. uint32_t buf_len,
  359. uint32_t * const p_index,
  360. void * const p_void_struct)
  361. {
  362. SER_STRUCT_DEC_BEGIN(ble_common_opt_conn_evt_ext_t);
  363. uint8_t ser_data;
  364. SER_PULL_uint8(&ser_data);
  365. p_struct->enable = ser_data & 0x01;
  366. SER_STRUCT_DEC_END;
  367. }
  368. #if NRF_SD_BLE_API_VERSION >= 4
  369. uint32_t ble_common_cfg_vs_uuid_t_enc(void const * const p_void_struct,
  370. uint8_t * const p_buf,
  371. uint32_t buf_len,
  372. uint32_t * const p_index)
  373. {
  374. SER_STRUCT_ENC_BEGIN(ble_common_cfg_vs_uuid_t);
  375. SER_PUSH_uint8(&p_struct->vs_uuid_count);
  376. SER_STRUCT_ENC_END;
  377. }
  378. uint32_t ble_common_cfg_vs_uuid_t_dec(uint8_t const * const p_buf,
  379. uint32_t buf_len,
  380. uint32_t * const p_index,
  381. void * const p_void_struct)
  382. {
  383. SER_STRUCT_DEC_BEGIN(ble_common_cfg_vs_uuid_t);
  384. SER_PULL_uint8(&p_struct->vs_uuid_count);
  385. SER_STRUCT_DEC_END;
  386. }
  387. #endif
  388. #if defined(NRF_SD_BLE_API_VERSION) && NRF_SD_BLE_API_VERSION > 4
  389. uint32_t ble_data_t_enc(void const * const p_void_struct,
  390. uint8_t * const p_buf,
  391. uint32_t buf_len,
  392. uint32_t * const p_index)
  393. {
  394. SER_STRUCT_ENC_BEGIN(ble_data_t);
  395. int buf_id = 0;
  396. #if NRF_SD_BLE_API_VERSION > 5
  397. #ifdef UNIT_TEST
  398. if (serialization_connectivity_role)
  399. {
  400. buf_id = conn_ble_gap_ble_data_buf_free(p_struct->p_data);
  401. }
  402. else
  403. {
  404. buf_id = app_ble_gap_adv_buf_register(p_struct->p_data);
  405. SER_ASSERT(buf_id >= 0, NRF_ERROR_NO_MEM);
  406. }
  407. #elif defined(SER_CONNECTIVITY)
  408. buf_id = conn_ble_gap_ble_data_buf_free(p_struct->p_data);
  409. #else
  410. buf_id = app_ble_gap_adv_buf_register(p_struct->p_data);
  411. SER_ASSERT(buf_id >= 0, NRF_ERROR_NO_MEM);
  412. #endif
  413. #endif /* NRF_SD_BLE_API_VERSION > 5 */
  414. SER_PUSH_uint32((uint32_t *)&buf_id);
  415. SER_PUSH_len16data(p_struct->p_data, p_struct->len);
  416. SER_STRUCT_ENC_END;
  417. }
  418. uint32_t ble_data_t_dec(uint8_t const * const p_buf,
  419. uint32_t buf_len,
  420. uint32_t * const p_index,
  421. void * const p_void_struct)
  422. {
  423. SER_STRUCT_DEC_BEGIN(ble_data_t);
  424. uint32_t buf_id;
  425. SER_PULL_uint32(&buf_id);
  426. p_struct->len = SER_MAX_ADV_DATA;
  427. #if NRF_SD_BLE_API_VERSION > 5
  428. #ifdef UNIT_TEST
  429. if (serialization_connectivity_role)
  430. {
  431. if (buf_id && (p_struct->p_data == NULL))
  432. {
  433. p_struct->p_data = conn_ble_gap_ble_data_buf_alloc(buf_id);
  434. }
  435. }
  436. else
  437. {
  438. p_struct->p_data = app_ble_gap_adv_buf_unregister((int)buf_id, true);
  439. }
  440. #elif defined(SER_CONNECTIVITY)
  441. if (buf_id && (p_struct->p_data == NULL))
  442. {
  443. p_struct->p_data = conn_ble_gap_ble_data_buf_alloc(buf_id);
  444. }
  445. #else
  446. p_struct->p_data = app_ble_gap_adv_buf_unregister(buf_id, true);
  447. #endif
  448. #endif /* NRF_SD_BLE_API_VERSION > 5*/
  449. SER_PULL_len16data(&p_struct->p_data, &p_struct->len);
  450. SER_STRUCT_DEC_END;
  451. }
  452. #endif