Skip to content

Commit

Permalink
sdfw_services: Regenerate zcbor-generated client code
Browse files Browse the repository at this point in the history
Using zcbor 0.9.0

Signed-off-by: Øyvind Rønningstad <oyvind.ronningstad@nordicsemi.no>
  • Loading branch information
oyvindronningstad committed Sep 10, 2024
1 parent 04b3cb3 commit 15a4fe9
Show file tree
Hide file tree
Showing 37 changed files with 7,376 additions and 8,034 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -837,6 +837,11 @@ Shell libraries

|no_changes_yet_note|

sdfw
----

* sdfw_services: Regenerated generated code files using zcbor 0.9.0.

Libraries for Zigbee
--------------------

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,82 +5,86 @@
*/

/*
* Generated using zcbor version 0.8.1
* Generated using zcbor version 0.9.0
* https://github.com/NordicSemiconductor/zcbor
* Generated with a --default-max-qty of 3
*/

#include <stdint.h>
#include "echo_service_decode.h"
#include "zcbor_decode.h"
#include "zcbor_print.h"
#include <stdbool.h>
#include <stddef.h>
#include <stdint.h>
#include <string.h>
#include "zcbor_decode.h"
#include "echo_service_decode.h"
#include "zcbor_print.h"

#if DEFAULT_MAX_QTY != 3
#error "The type file was generated with a different default_max_qty than this file"
#error \
"The type file was generated with a different default_max_qty than this file"
#endif

static bool decode_echo_service_rsp(zcbor_state_t *state, struct echo_service_rsp *result);
static bool decode_echo_service_req(zcbor_state_t *state, struct zcbor_string *result);

static bool decode_echo_service_rsp(zcbor_state_t *state, struct echo_service_rsp *result)
{
zcbor_log("%s\r\n", __func__);

bool tmp_result =
(((zcbor_list_start_decode(state) &&
((((zcbor_int32_decode(state, (&(*result).echo_service_rsp_ret)))) &&
((zcbor_tstr_decode(state, (&(*result).echo_service_rsp_str_out))))) ||
(zcbor_list_map_end_force_decode(state), false)) &&
zcbor_list_end_decode(state))));

if (!tmp_result) {
zcbor_trace_file(state);
zcbor_log("%s error: %s\r\n", __func__, zcbor_error_str(zcbor_peek_error(state)));
} else {
zcbor_log("%s success\r\n", __func__);
}

return tmp_result;
#define log_result(state, result, func) \
do { \
if (!result) { \
zcbor_trace_file(state); \
zcbor_log("%s error: %s\r\n", func, \
zcbor_error_str(zcbor_peek_error(state))); \
} else { \
zcbor_log("%s success\r\n", func); \
} \
} while (0)

static bool decode_echo_service_rsp(zcbor_state_t *state,
struct echo_service_rsp *result);
static bool decode_echo_service_req(zcbor_state_t *state,
struct zcbor_string *result);

static bool decode_echo_service_rsp(zcbor_state_t *state,
struct echo_service_rsp *result) {
zcbor_log("%s\r\n", __func__);

bool res = ((
(zcbor_list_start_decode(state) &&
((((zcbor_int32_decode(state, (&(*result).echo_service_rsp_ret)))) &&
((zcbor_tstr_decode(state, (&(*result).echo_service_rsp_str_out))))) ||
(zcbor_list_map_end_force_decode(state), false)) &&
zcbor_list_end_decode(state))));

log_result(state, res, __func__);
return res;
}

static bool decode_echo_service_req(zcbor_state_t *state, struct zcbor_string *result)
{
zcbor_log("%s\r\n", __func__);
static bool decode_echo_service_req(zcbor_state_t *state,
struct zcbor_string *result) {
zcbor_log("%s\r\n", __func__);

bool tmp_result = (((zcbor_list_start_decode(state) &&
((((zcbor_tstr_decode(state, (&(*result)))))) ||
(zcbor_list_map_end_force_decode(state), false)) &&
zcbor_list_end_decode(state))));
bool res = (((zcbor_list_start_decode(state) &&
((((zcbor_tstr_decode(state, (&(*result)))))) ||
(zcbor_list_map_end_force_decode(state), false)) &&
zcbor_list_end_decode(state))));

if (!tmp_result) {
zcbor_trace_file(state);
zcbor_log("%s error: %s\r\n", __func__, zcbor_error_str(zcbor_peek_error(state)));
} else {
zcbor_log("%s success\r\n", __func__);
}

return tmp_result;
log_result(state, res, __func__);
return res;
}

int cbor_decode_echo_service_req(const uint8_t *payload, size_t payload_len,
struct zcbor_string *result, size_t *payload_len_out)
{
zcbor_state_t states[3];

return zcbor_entry_function(payload, payload_len, (void *)result, payload_len_out, states,
(zcbor_decoder_t *)decode_echo_service_req,
sizeof(states) / sizeof(zcbor_state_t), 1);
struct zcbor_string *result,
size_t *payload_len_out) {
zcbor_state_t states[3];

return zcbor_entry_function(payload, payload_len, (void *)result,
payload_len_out, states,
(zcbor_decoder_t *)decode_echo_service_req,
sizeof(states) / sizeof(zcbor_state_t), 1);
}

int cbor_decode_echo_service_rsp(const uint8_t *payload, size_t payload_len,
struct echo_service_rsp *result, size_t *payload_len_out)
{
zcbor_state_t states[3];

return zcbor_entry_function(payload, payload_len, (void *)result, payload_len_out, states,
(zcbor_decoder_t *)decode_echo_service_rsp,
sizeof(states) / sizeof(zcbor_state_t), 1);
struct echo_service_rsp *result,
size_t *payload_len_out) {
zcbor_state_t states[3];

return zcbor_entry_function(payload, payload_len, (void *)result,
payload_len_out, states,
(zcbor_decoder_t *)decode_echo_service_rsp,
sizeof(states) / sizeof(zcbor_state_t), 1);
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,33 +5,36 @@
*/

/*
* Generated using zcbor version 0.8.1
* Generated using zcbor version 0.9.0
* https://github.com/NordicSemiconductor/zcbor
* Generated with a --default-max-qty of 3
*/

#ifndef ECHO_SERVICE_DECODE_H__
#define ECHO_SERVICE_DECODE_H__

#include <stdint.h>
#include "echo_service_types.h"
#include <stdbool.h>
#include <stddef.h>
#include <stdint.h>
#include <string.h>
#include "echo_service_types.h"

#ifdef __cplusplus
extern "C" {
#endif

#if DEFAULT_MAX_QTY != 3
#error "The type file was generated with a different default_max_qty than this file"
#error \
"The type file was generated with a different default_max_qty than this file"
#endif

int cbor_decode_echo_service_req(const uint8_t *payload, size_t payload_len,
struct zcbor_string *result, size_t *payload_len_out);
struct zcbor_string *result,
size_t *payload_len_out);

int cbor_decode_echo_service_rsp(const uint8_t *payload, size_t payload_len,
struct echo_service_rsp *result, size_t *payload_len_out);
struct echo_service_rsp *result,
size_t *payload_len_out);

#ifdef __cplusplus
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,82 +5,86 @@
*/

/*
* Generated using zcbor version 0.8.1
* Generated using zcbor version 0.9.0
* https://github.com/NordicSemiconductor/zcbor
* Generated with a --default-max-qty of 3
*/

#include <stdint.h>
#include "echo_service_encode.h"
#include "zcbor_encode.h"
#include "zcbor_print.h"
#include <stdbool.h>
#include <stddef.h>
#include <stdint.h>
#include <string.h>
#include "zcbor_encode.h"
#include "echo_service_encode.h"
#include "zcbor_print.h"

#if DEFAULT_MAX_QTY != 3
#error "The type file was generated with a different default_max_qty than this file"
#error \
"The type file was generated with a different default_max_qty than this file"
#endif

static bool encode_echo_service_rsp(zcbor_state_t *state, const struct echo_service_rsp *input);
static bool encode_echo_service_req(zcbor_state_t *state, const struct zcbor_string *input);

static bool encode_echo_service_rsp(zcbor_state_t *state, const struct echo_service_rsp *input)
{
zcbor_log("%s\r\n", __func__);

bool tmp_result =
(((zcbor_list_start_encode(state, 2) &&
((((zcbor_int32_encode(state, (&(*input).echo_service_rsp_ret)))) &&
((zcbor_tstr_encode(state, (&(*input).echo_service_rsp_str_out))))) ||
(zcbor_list_map_end_force_encode(state), false)) &&
zcbor_list_end_encode(state, 2))));

if (!tmp_result) {
zcbor_trace_file(state);
zcbor_log("%s error: %s\r\n", __func__, zcbor_error_str(zcbor_peek_error(state)));
} else {
zcbor_log("%s success\r\n", __func__);
}

return tmp_result;
#define log_result(state, result, func) \
do { \
if (!result) { \
zcbor_trace_file(state); \
zcbor_log("%s error: %s\r\n", func, \
zcbor_error_str(zcbor_peek_error(state))); \
} else { \
zcbor_log("%s success\r\n", func); \
} \
} while (0)

static bool encode_echo_service_rsp(zcbor_state_t *state,
const struct echo_service_rsp *input);
static bool encode_echo_service_req(zcbor_state_t *state,
const struct zcbor_string *input);

static bool encode_echo_service_rsp(zcbor_state_t *state,
const struct echo_service_rsp *input) {
zcbor_log("%s\r\n", __func__);

bool res = ((
(zcbor_list_start_encode(state, 2) &&
((((zcbor_int32_encode(state, (&(*input).echo_service_rsp_ret)))) &&
((zcbor_tstr_encode(state, (&(*input).echo_service_rsp_str_out))))) ||
(zcbor_list_map_end_force_encode(state), false)) &&
zcbor_list_end_encode(state, 2))));

log_result(state, res, __func__);
return res;
}

static bool encode_echo_service_req(zcbor_state_t *state, const struct zcbor_string *input)
{
zcbor_log("%s\r\n", __func__);
static bool encode_echo_service_req(zcbor_state_t *state,
const struct zcbor_string *input) {
zcbor_log("%s\r\n", __func__);

bool tmp_result = (((zcbor_list_start_encode(state, 1) &&
((((zcbor_tstr_encode(state, (&(*input)))))) ||
(zcbor_list_map_end_force_encode(state), false)) &&
zcbor_list_end_encode(state, 1))));
bool res = (((zcbor_list_start_encode(state, 1) &&
((((zcbor_tstr_encode(state, (&(*input)))))) ||
(zcbor_list_map_end_force_encode(state), false)) &&
zcbor_list_end_encode(state, 1))));

if (!tmp_result) {
zcbor_trace_file(state);
zcbor_log("%s error: %s\r\n", __func__, zcbor_error_str(zcbor_peek_error(state)));
} else {
zcbor_log("%s success\r\n", __func__);
}

return tmp_result;
log_result(state, res, __func__);
return res;
}

int cbor_encode_echo_service_req(uint8_t *payload, size_t payload_len,
const struct zcbor_string *input, size_t *payload_len_out)
{
zcbor_state_t states[3];

return zcbor_entry_function(payload, payload_len, (void *)input, payload_len_out, states,
(zcbor_decoder_t *)encode_echo_service_req,
sizeof(states) / sizeof(zcbor_state_t), 1);
const struct zcbor_string *input,
size_t *payload_len_out) {
zcbor_state_t states[3];

return zcbor_entry_function(payload, payload_len, (void *)input,
payload_len_out, states,
(zcbor_decoder_t *)encode_echo_service_req,
sizeof(states) / sizeof(zcbor_state_t), 1);
}

int cbor_encode_echo_service_rsp(uint8_t *payload, size_t payload_len,
const struct echo_service_rsp *input, size_t *payload_len_out)
{
zcbor_state_t states[3];

return zcbor_entry_function(payload, payload_len, (void *)input, payload_len_out, states,
(zcbor_decoder_t *)encode_echo_service_rsp,
sizeof(states) / sizeof(zcbor_state_t), 1);
const struct echo_service_rsp *input,
size_t *payload_len_out) {
zcbor_state_t states[3];

return zcbor_entry_function(payload, payload_len, (void *)input,
payload_len_out, states,
(zcbor_decoder_t *)encode_echo_service_rsp,
sizeof(states) / sizeof(zcbor_state_t), 1);
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,33 +5,36 @@
*/

/*
* Generated using zcbor version 0.8.1
* Generated using zcbor version 0.9.0
* https://github.com/NordicSemiconductor/zcbor
* Generated with a --default-max-qty of 3
*/

#ifndef ECHO_SERVICE_ENCODE_H__
#define ECHO_SERVICE_ENCODE_H__

#include <stdint.h>
#include "echo_service_types.h"
#include <stdbool.h>
#include <stddef.h>
#include <stdint.h>
#include <string.h>
#include "echo_service_types.h"

#ifdef __cplusplus
extern "C" {
#endif

#if DEFAULT_MAX_QTY != 3
#error "The type file was generated with a different default_max_qty than this file"
#error \
"The type file was generated with a different default_max_qty than this file"
#endif

int cbor_encode_echo_service_req(uint8_t *payload, size_t payload_len,
const struct zcbor_string *input, size_t *payload_len_out);
const struct zcbor_string *input,
size_t *payload_len_out);

int cbor_encode_echo_service_rsp(uint8_t *payload, size_t payload_len,
const struct echo_service_rsp *input, size_t *payload_len_out);
const struct echo_service_rsp *input,
size_t *payload_len_out);

#ifdef __cplusplus
}
Expand Down
Loading

0 comments on commit 15a4fe9

Please sign in to comment.