1 /* 2 * Copyright (c) 2023 Nordic Semiconductor ASA 3 * 4 * SPDX-License-Identifier: Apache-2.0 5 */ 6 7 #ifndef H_SMP_TEST_UTIL_ 8 #define H_SMP_TEST_UTIL_ 9 10 #include <zephyr/ztest.h> 11 #include <zephyr/mgmt/mcumgr/mgmt/mgmt.h> 12 #include <zcbor_common.h> 13 #include <smp_internal.h> 14 15 /* Function for creating an settings_mgmt read command */ 16 bool create_settings_mgmt_read_packet(zcbor_state_t *zse, uint8_t *buffer, uint8_t *output_buffer, 17 uint16_t *buffer_size, char *name, uint32_t max_size); 18 19 /* Function for creating an settings_mgmt write command */ 20 bool create_settings_mgmt_write_packet(zcbor_state_t *zse, uint8_t *buffer, uint8_t *output_buffer, 21 uint16_t *buffer_size, char *name, const uint8_t *val, 22 size_t val_size); 23 24 /* Function for creating an settings_mgmt delete command */ 25 bool create_settings_mgmt_delete_packet(zcbor_state_t *zse, uint8_t *buffer, 26 uint8_t *output_buffer, uint16_t *buffer_size, char *name); 27 28 /* Function for creating an settings_mgmt commit command */ 29 bool create_settings_mgmt_commit_packet(zcbor_state_t *zse, uint8_t *buffer, 30 uint8_t *output_buffer, uint16_t *buffer_size); 31 32 /* Function for creating an settings_mgmt load command */ 33 bool create_settings_mgmt_load_packet(zcbor_state_t *zse, uint8_t *buffer, uint8_t *output_buffer, 34 uint16_t *buffer_size); 35 36 /* Function for creating an settings_mgmt save command */ 37 bool create_settings_mgmt_save_packet(zcbor_state_t *zse, uint8_t *buffer, uint8_t *output_buffer, 38 uint16_t *buffer_size); 39 40 #endif 41