ble_app.c 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513
  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 <stdlib.h>
  41. #include <string.h>
  42. #include "ble_app.h"
  43. #include "ble_serialization.h"
  44. #include "ble_struct_serialization.h"
  45. #include "ble_gap_struct_serialization.h"
  46. #include "ble_gatt_struct_serialization.h"
  47. #include "ble_gattc_struct_serialization.h"
  48. #include "ble_gatts_struct_serialization.h"
  49. #include "ble_l2cap_struct_serialization.h"
  50. #include "cond_field_serialization.h"
  51. #include "app_util.h"
  52. #if defined(NRF_SD_BLE_API_VERSION) && NRF_SD_BLE_API_VERSION < 4
  53. uint32_t ble_enable_req_enc(ble_enable_params_t * p_ble_enable_params,
  54. uint8_t * const p_buf,
  55. uint32_t * const p_buf_len)
  56. {
  57. SER_REQ_ENC_BEGIN(SD_BLE_ENABLE);
  58. SER_PUSH_COND(p_ble_enable_params, ble_enable_params_t_enc);
  59. SER_REQ_ENC_END;
  60. }
  61. #else
  62. uint32_t ble_enable_req_enc(uint8_t * const p_buf,
  63. uint32_t * const p_buf_len)
  64. {
  65. SER_REQ_ENC_BEGIN(SD_BLE_ENABLE);
  66. SER_REQ_ENC_END;
  67. }
  68. #endif
  69. uint32_t ble_enable_rsp_dec(uint8_t const * const p_buf,
  70. uint32_t packet_len,
  71. uint32_t * const p_result_code)
  72. {
  73. SER_RSP_DEC_RESULT_ONLY(SD_BLE_ENABLE);
  74. }
  75. uint32_t ble_opt_get_req_enc(uint32_t opt_id,
  76. ble_opt_t const * const p_opt,
  77. uint8_t * const p_buf,
  78. uint32_t * const p_buf_len)
  79. {
  80. SER_REQ_ENC_BEGIN(SD_BLE_OPT_GET);
  81. SER_PUSH_uint32(&opt_id);
  82. SER_PUSH_COND(p_opt, NULL);
  83. SER_REQ_ENC_END;
  84. }
  85. uint32_t ble_opt_get_rsp_dec(uint8_t const * const p_buf,
  86. uint32_t packet_len,
  87. uint32_t * const p_opt_id,
  88. ble_opt_t * const p_opt,
  89. uint32_t * const p_result_code)
  90. {
  91. SER_RSP_DEC_BEGIN(SD_BLE_OPT_GET);
  92. SER_PULL_uint32(p_opt_id);
  93. field_decoder_handler_t fp_decoder = NULL;
  94. void * p_struct = NULL;
  95. switch (*p_opt_id)
  96. {
  97. #if defined(NRF_SD_BLE_API_VERSION) && NRF_SD_BLE_API_VERSION < 4
  98. case BLE_COMMON_OPT_CONN_BW:
  99. fp_decoder = ble_common_opt_conn_bw_t_dec;
  100. p_struct = &(p_opt->common_opt.conn_bw);
  101. break;
  102. #endif
  103. case BLE_COMMON_OPT_PA_LNA:
  104. fp_decoder = ble_common_opt_pa_lna_t_dec;
  105. p_struct = &(p_opt->common_opt.pa_lna);
  106. break;
  107. case BLE_COMMON_OPT_CONN_EVT_EXT:
  108. fp_decoder = ble_common_opt_conn_evt_ext_t_dec;
  109. p_struct = &(p_opt->common_opt.conn_evt_ext);
  110. break;
  111. case BLE_GAP_OPT_CH_MAP:
  112. fp_decoder = ble_gap_opt_ch_map_t_dec;
  113. p_struct =&(p_opt->gap_opt.ch_map);
  114. break;
  115. case BLE_GAP_OPT_LOCAL_CONN_LATENCY:
  116. fp_decoder = ble_gap_opt_local_conn_latency_t_dec;
  117. p_struct = &(p_opt->gap_opt.local_conn_latency);
  118. break;
  119. case BLE_GAP_OPT_PASSKEY:
  120. fp_decoder = ble_gap_opt_passkey_t_dec;
  121. p_struct = &(p_opt->gap_opt.passkey);
  122. break;
  123. case BLE_GAP_OPT_AUTH_PAYLOAD_TIMEOUT:
  124. fp_decoder = ble_gap_opt_auth_payload_timeout_t_dec;
  125. p_struct = &(p_opt->gap_opt.auth_payload_timeout);
  126. break;
  127. #if defined(NRF_SD_BLE_API_VERSION) && NRF_SD_BLE_API_VERSION < 4
  128. case BLE_GAP_OPT_EXT_LEN:
  129. fp_decoder = ble_gap_opt_ext_len_t_dec;
  130. p_struct = &(p_opt->gap_opt.ext_len);
  131. break;
  132. #endif
  133. #if defined(NRF_SD_BLE_API_VERSION) && NRF_SD_BLE_API_VERSION < 6
  134. case BLE_GAP_OPT_SCAN_REQ_REPORT:
  135. fp_decoder = ble_gap_opt_scan_req_report_t_dec;
  136. p_struct = &(p_opt->gap_opt.scan_req_report);
  137. break;
  138. #endif
  139. #if defined(NRF_SD_BLE_API_VERSION) && NRF_SD_BLE_API_VERSION < 4
  140. case BLE_GAP_OPT_COMPAT_MODE:
  141. fp_decoder = ble_gap_opt_compat_mode_t_dec;
  142. p_struct = &(p_opt->gap_opt.compat_mode);
  143. break;
  144. #else
  145. #ifndef S112
  146. case BLE_GAP_OPT_COMPAT_MODE_1:
  147. fp_decoder = ble_gap_opt_compat_mode_1_t_dec;
  148. p_struct = &(p_opt->gap_opt.compat_mode_1);
  149. break;
  150. #endif
  151. #endif
  152. #if defined(NRF_SD_BLE_API_VERSION) && NRF_SD_BLE_API_VERSION == 4
  153. case BLE_GAP_OPT_COMPAT_MODE_2:
  154. fp_decoder = ble_gap_opt_compat_mode_2_t_dec;
  155. p_struct = &(p_opt->gap_opt.compat_mode_2);
  156. break;
  157. #endif
  158. default:
  159. SER_ASSERT(NRF_ERROR_INVALID_PARAM, NRF_ERROR_INVALID_PARAM);
  160. break;
  161. }
  162. SER_PULL_FIELD(p_struct, fp_decoder);
  163. SER_RSP_DEC_END;
  164. }
  165. uint32_t ble_opt_set_req_enc(uint32_t const opt_id,
  166. ble_opt_t const * const p_opt,
  167. uint8_t * const p_buf,
  168. uint32_t * const p_buf_len)
  169. {
  170. SER_REQ_ENC_BEGIN(SD_BLE_OPT_SET);
  171. SER_PUSH_uint32(&opt_id);
  172. field_encoder_handler_t fp_encoder = NULL;
  173. void const * p_struct = NULL;
  174. SER_PUSH_COND(p_opt, NULL);
  175. if (p_opt)
  176. {
  177. switch (opt_id)
  178. {
  179. #if defined(NRF_SD_BLE_API_VERSION) && NRF_SD_BLE_API_VERSION < 4
  180. case BLE_COMMON_OPT_CONN_BW:
  181. fp_encoder = ble_common_opt_conn_bw_t_enc;
  182. p_struct = &(p_opt->common_opt.conn_bw);
  183. break;
  184. #endif
  185. case BLE_COMMON_OPT_PA_LNA:
  186. fp_encoder = ble_common_opt_pa_lna_t_enc;
  187. p_struct = &(p_opt->common_opt.pa_lna);
  188. break;
  189. case BLE_COMMON_OPT_CONN_EVT_EXT:
  190. fp_encoder = ble_common_opt_conn_evt_ext_t_enc;
  191. p_struct = &(p_opt->common_opt.conn_evt_ext);
  192. break;
  193. case BLE_GAP_OPT_CH_MAP:
  194. fp_encoder = ble_gap_opt_ch_map_t_enc;
  195. p_struct = &(p_opt->gap_opt.ch_map);
  196. break;
  197. case BLE_GAP_OPT_LOCAL_CONN_LATENCY:
  198. fp_encoder = ble_gap_opt_local_conn_latency_t_enc;
  199. p_struct = &(p_opt->gap_opt.local_conn_latency);
  200. break;
  201. case BLE_GAP_OPT_PASSKEY:
  202. fp_encoder = ble_gap_opt_passkey_t_enc;
  203. p_struct = &(p_opt->gap_opt.passkey);
  204. break;
  205. case BLE_GAP_OPT_AUTH_PAYLOAD_TIMEOUT:
  206. fp_encoder = ble_gap_opt_auth_payload_timeout_t_enc;
  207. p_struct = &(p_opt->gap_opt.auth_payload_timeout);
  208. break;
  209. #if defined(NRF_SD_BLE_API_VERSION) && NRF_SD_BLE_API_VERSION < 4
  210. case BLE_GAP_OPT_EXT_LEN:
  211. fp_encoder = ble_gap_opt_ext_len_t_enc;
  212. p_struct = &(p_opt->gap_opt.ext_len);
  213. break;
  214. #endif
  215. #if defined(NRF_SD_BLE_API_VERSION) && NRF_SD_BLE_API_VERSION < 6
  216. case BLE_GAP_OPT_SCAN_REQ_REPORT:
  217. fp_encoder = ble_gap_opt_scan_req_report_t_enc;
  218. p_struct = &(p_opt->gap_opt.scan_req_report);
  219. break;
  220. #endif
  221. #if defined(NRF_SD_BLE_API_VERSION) && NRF_SD_BLE_API_VERSION < 4
  222. case BLE_GAP_OPT_COMPAT_MODE:
  223. fp_encoder = ble_gap_opt_compat_mode_t_enc;
  224. p_struct = &(p_opt->gap_opt.compat_mode);
  225. break;
  226. #else
  227. #ifndef S112
  228. case BLE_GAP_OPT_COMPAT_MODE_1:
  229. fp_encoder = ble_gap_opt_compat_mode_1_t_enc;
  230. p_struct = &(p_opt->gap_opt.compat_mode_1);
  231. break;
  232. #endif
  233. case BLE_GAP_OPT_SLAVE_LATENCY_DISABLE:
  234. fp_encoder = ble_gap_opt_slave_latency_disable_t_enc;
  235. p_struct = &(p_opt->gap_opt.slave_latency_disable);
  236. break;
  237. #endif
  238. #if defined(NRF_SD_BLE_API_VERSION) && NRF_SD_BLE_API_VERSION == 4
  239. case BLE_GAP_OPT_COMPAT_MODE_2:
  240. fp_encoder = ble_gap_opt_compat_mode_2_t_enc;
  241. p_struct = &(p_opt->gap_opt.compat_mode_2);
  242. break;
  243. #endif
  244. default:
  245. SER_ASSERT(NRF_ERROR_INVALID_PARAM,NRF_ERROR_INVALID_PARAM);
  246. break;
  247. }
  248. SER_PUSH_FIELD(p_struct, fp_encoder);
  249. }
  250. SER_REQ_ENC_END;
  251. }
  252. uint32_t ble_opt_set_rsp_dec(uint8_t const * const p_buf,
  253. uint32_t packet_len,
  254. uint32_t * const p_result_code)
  255. {
  256. SER_RSP_DEC_RESULT_ONLY(SD_BLE_OPT_SET);
  257. }
  258. #if defined(NRF_SD_BLE_API_VERSION) && NRF_SD_BLE_API_VERSION < 4
  259. uint32_t ble_tx_packet_count_get_req_enc(uint16_t conn_handle,
  260. uint8_t const * const p_count,
  261. uint8_t * const p_buf,
  262. uint32_t * const p_buf_len)
  263. {
  264. SER_REQ_ENC_BEGIN(SD_BLE_TX_PACKET_COUNT_GET);
  265. SER_PUSH_uint16(&conn_handle);
  266. SER_PUSH_COND(p_count, NULL);
  267. SER_REQ_ENC_END;
  268. }
  269. uint32_t ble_tx_packet_count_get_rsp_dec(uint8_t const * const p_buf,
  270. uint32_t packet_len,
  271. uint8_t * * const pp_count,
  272. uint32_t * const p_result_code)
  273. {
  274. SER_RSP_DEC_BEGIN(SD_BLE_TX_PACKET_COUNT_GET);
  275. SER_PULL_COND(pp_count, uint8_t_dec);
  276. SER_RSP_DEC_END;
  277. }
  278. #endif
  279. uint32_t ble_user_mem_reply_req_enc(uint16_t conn_handle,
  280. ble_user_mem_block_t const * p_block,
  281. uint8_t * const p_buf,
  282. uint32_t * const p_buf_len)
  283. {
  284. SER_REQ_ENC_BEGIN(SD_BLE_USER_MEM_REPLY);
  285. SER_PUSH_uint16(&conn_handle);
  286. SER_PUSH_COND(p_block, ble_user_mem_block_t_enc);
  287. SER_REQ_ENC_END;
  288. }
  289. uint32_t ble_user_mem_reply_rsp_dec(uint8_t const * const p_buf,
  290. uint32_t packet_len,
  291. uint32_t * const p_result_code)
  292. {
  293. SER_RSP_DEC_RESULT_ONLY(SD_BLE_USER_MEM_REPLY);
  294. }
  295. uint32_t ble_uuid_decode_req_enc(uint8_t uuid_le_len,
  296. uint8_t const * const p_uuid_le,
  297. ble_uuid_t * const p_uuid,
  298. uint8_t * const p_buf,
  299. uint32_t * const p_buf_len)
  300. {
  301. SER_REQ_ENC_BEGIN(SD_BLE_UUID_DECODE);
  302. SER_PUSH_len8data(p_uuid_le, uuid_le_len);
  303. SER_PUSH_COND(p_uuid, NULL);
  304. SER_REQ_ENC_END;
  305. }
  306. uint32_t ble_uuid_decode_rsp_dec(uint8_t const * const p_buf,
  307. uint32_t packet_len,
  308. ble_uuid_t * * const pp_uuid,
  309. uint32_t * const p_result_code)
  310. {
  311. SER_RSP_DEC_BEGIN(SD_BLE_UUID_DECODE);
  312. SER_PULL_COND(pp_uuid, ble_uuid_t_dec);
  313. SER_RSP_DEC_END;
  314. }
  315. uint32_t ble_uuid_encode_req_enc(ble_uuid_t const * const p_uuid,
  316. uint8_t const * const p_uuid_le_len,
  317. uint8_t const * const p_uuid_le,
  318. uint8_t * const p_buf,
  319. uint32_t * const p_buf_len)
  320. {
  321. SER_REQ_ENC_BEGIN(SD_BLE_UUID_ENCODE);
  322. SER_PUSH_COND(p_uuid, ble_uuid_t_enc);
  323. SER_PUSH_COND(p_uuid_le_len, NULL);
  324. SER_PUSH_COND(p_uuid_le, NULL);
  325. SER_REQ_ENC_END;
  326. }
  327. uint32_t ble_uuid_encode_rsp_dec(uint8_t const * const p_buf,
  328. uint32_t packet_len,
  329. uint8_t * const p_uuid_le_len,
  330. uint8_t * const p_uuid_le,
  331. uint32_t * const p_result_code)
  332. {
  333. SER_RSP_DEC_BEGIN(SD_BLE_UUID_ENCODE);
  334. uint8_t uuid_le_len;
  335. SER_PULL_uint8(&uuid_le_len);
  336. if (p_uuid_le_len)
  337. {
  338. *p_uuid_le_len = uuid_le_len;
  339. if (p_uuid_le)
  340. {
  341. SER_PULL_uint8array(p_uuid_le, uuid_le_len);
  342. }
  343. }
  344. SER_RSP_DEC_END;
  345. }
  346. uint32_t ble_uuid_vs_add_req_enc(ble_uuid128_t const * const p_vs_uuid,
  347. uint8_t * const p_uuid_type,
  348. uint8_t * const p_buf,
  349. uint32_t * const p_buf_len)
  350. {
  351. SER_REQ_ENC_BEGIN(SD_BLE_UUID_VS_ADD);
  352. SER_PUSH_COND(p_vs_uuid, ble_uuid128_t_enc);
  353. SER_PUSH_COND(p_uuid_type, NULL);
  354. SER_REQ_ENC_END;
  355. }
  356. uint32_t ble_uuid_vs_add_rsp_dec(uint8_t const * const p_buf,
  357. uint32_t packet_len,
  358. uint8_t * * const pp_uuid_type,
  359. uint32_t * const p_result_code)
  360. {
  361. SER_RSP_DEC_BEGIN(SD_BLE_UUID_VS_ADD);
  362. SER_ASSERT_NOT_NULL(pp_uuid_type);
  363. SER_PULL_COND(pp_uuid_type, uint8_t_dec);
  364. SER_RSP_DEC_END;
  365. }
  366. uint32_t ble_version_get_req_enc(ble_version_t const * const p_version,
  367. uint8_t * const p_buf,
  368. uint32_t * const p_buf_len)
  369. {
  370. SER_REQ_ENC_BEGIN(SD_BLE_VERSION_GET);
  371. SER_PUSH_COND(p_version, NULL);
  372. SER_REQ_ENC_END;
  373. }
  374. uint32_t ble_version_get_rsp_dec(uint8_t const * const p_buf,
  375. uint32_t packet_len,
  376. ble_version_t * p_version,
  377. uint32_t * const p_result_code)
  378. {
  379. SER_RSP_DEC_BEGIN(SD_BLE_VERSION_GET);
  380. SER_PULL_FIELD(p_version, ble_version_t_dec);
  381. SER_RSP_DEC_END;
  382. }
  383. #if NRF_SD_BLE_API_VERSION >= 4
  384. uint32_t ble_cfg_set_req_enc(uint32_t cfg_id,
  385. ble_cfg_t const * p_cfg,
  386. uint8_t * const p_buf,
  387. uint32_t * const p_buf_len)
  388. {
  389. SER_REQ_ENC_BEGIN(SD_BLE_CFG_SET);
  390. SER_PUSH_uint32(&cfg_id);
  391. field_encoder_handler_t fp_encoder = NULL;
  392. void const * p_struct = NULL;
  393. SER_PUSH_COND(p_cfg, NULL);
  394. if (p_cfg)
  395. {
  396. switch (cfg_id)
  397. {
  398. case BLE_CONN_CFG_GAP:
  399. fp_encoder = ble_gap_conn_cfg_t_enc;
  400. p_struct = &(p_cfg->conn_cfg.params.gap_conn_cfg);
  401. break;
  402. case BLE_CONN_CFG_GATTC:
  403. fp_encoder = ble_gattc_conn_cfg_t_enc;
  404. p_struct = &(p_cfg->conn_cfg.params.gattc_conn_cfg);
  405. break;
  406. case BLE_CONN_CFG_GATTS:
  407. fp_encoder = ble_gatts_conn_cfg_t_enc;
  408. p_struct = &(p_cfg->conn_cfg.params.gatts_conn_cfg);
  409. break;
  410. case BLE_CONN_CFG_GATT:
  411. fp_encoder = ble_gatt_conn_cfg_t_enc;
  412. p_struct = &(p_cfg->conn_cfg.params.gatt_conn_cfg);
  413. break;
  414. #if defined(NRF_SD_BLE_API_VERSION) && NRF_SD_BLE_API_VERSION >= 5 && !defined(S112)
  415. case BLE_CONN_CFG_L2CAP:
  416. fp_encoder = ble_l2cap_conn_cfg_t_enc;
  417. p_struct = &(p_cfg->conn_cfg.params.l2cap_conn_cfg);
  418. break;
  419. #endif
  420. case BLE_COMMON_CFG_VS_UUID:
  421. fp_encoder = ble_common_cfg_vs_uuid_t_enc;
  422. p_struct = &(p_cfg->common_cfg.vs_uuid_cfg);
  423. break;
  424. case BLE_GAP_CFG_ROLE_COUNT:
  425. fp_encoder = ble_gap_cfg_role_count_t_enc;
  426. p_struct = &(p_cfg->gap_cfg.role_count_cfg);
  427. break;
  428. case BLE_GAP_CFG_DEVICE_NAME:
  429. fp_encoder = ble_gap_cfg_device_name_t_enc;
  430. p_struct = &(p_cfg->gap_cfg.device_name_cfg);
  431. break;
  432. case BLE_GATTS_CFG_SERVICE_CHANGED:
  433. fp_encoder = ble_gatts_cfg_service_changed_t_enc;
  434. p_struct = &(p_cfg->gatts_cfg.service_changed);
  435. break;
  436. case BLE_GATTS_CFG_ATTR_TAB_SIZE:
  437. fp_encoder = ble_gatts_cfg_attr_tab_size_t_enc;
  438. p_struct = &(p_cfg->gatts_cfg.attr_tab_size);
  439. break;
  440. }
  441. if (cfg_id >= BLE_CONN_CFG_BASE && cfg_id <= BLE_CONN_CFG_GATT)
  442. {
  443. SER_PUSH_uint8(&p_cfg->conn_cfg.conn_cfg_tag);
  444. }
  445. SER_PUSH_FIELD(p_struct, fp_encoder);
  446. }
  447. SER_REQ_ENC_END;
  448. }
  449. uint32_t ble_cfg_set_rsp_dec(uint8_t const * const p_buf,
  450. uint32_t packet_len,
  451. uint32_t * const p_result_code)
  452. {
  453. SER_RSP_DEC_RESULT_ONLY(SD_BLE_CFG_SET);
  454. }
  455. #endif //NRF_SD_BLE_API_VERSION >= 4