1 /*
2  * Copyright (c) 2023 Nordic Semiconductor ASA
3  * Copyright (c) 2023 Jamie M.
4  *
5  * SPDX-License-Identifier: Apache-2.0
6  */
7 
8 #ifndef H_SMP_TEST_UTIL_
9 #define H_SMP_TEST_UTIL_
10 
11 #include <zephyr/ztest.h>
12 #include <zephyr/mgmt/mcumgr/mgmt/mgmt.h>
13 #include <zcbor_common.h>
14 #include <smp_internal.h>
15 #include <zephyr/drivers/rtc.h>
16 
17 /* SMP header function for generating os_mgmt datetime command header with sequence number set
18  * to 1
19  */
20 void smp_make_hdr(struct smp_hdr *rsp_hdr, size_t len, bool version2, bool write);
21 
22 /* Function for creating an os_mgmt datetime get command */
23 bool create_mcumgr_datetime_get_packet(zcbor_state_t *zse, bool version2, uint8_t *buffer,
24 				       uint8_t *output_buffer, uint16_t *buffer_size);
25 
26 /* Function for creating an os_mgmt datetime set command */
27 bool create_mcumgr_datetime_set_packet_str(zcbor_state_t *zse, bool version2, const char *data,
28 					   uint8_t *buffer, uint8_t *output_buffer,
29 					   uint16_t *buffer_size);
30 
31 bool create_mcumgr_datetime_set_packet(zcbor_state_t *zse, bool version2, struct rtc_time *a_time,
32 				       uint8_t *buffer, uint8_t *output_buffer,
33 				       uint16_t *buffer_size);
34 
35 #endif
36