Skip to content

Commit 61271c3

Browse files
alxelaxnordicjm
authored andcommitted
net: openthread: rpc: revert get_uint_t decoder
Commit reverts get_uint_t decoder to keep client endianness tolerant. Signed-off-by: Aleksandr Khromykh <[email protected]>
1 parent 2079383 commit 61271c3

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

subsys/net/openthread/rpc/client/ot_rpc_diag.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,20 +27,20 @@ static otMeshLocalPrefix mesh_prefix;
2727

2828
static void get_uint_t(int id, void *result, size_t result_size)
2929
{
30+
const size_t cbor_buffer_size = 0;
3031
struct nrf_rpc_cbor_ctx ctx;
31-
uint32_t value;
3232

33-
NRF_RPC_CBOR_ALLOC(&ot_group, ctx, 0);
33+
NRF_RPC_CBOR_ALLOC(&ot_group, ctx, cbor_buffer_size);
3434

3535
nrf_rpc_cbor_cmd_rsp_no_err(&ot_group, id, &ctx);
3636

37-
value = nrf_rpc_decode_uint(&ctx);
38-
if (!nrf_rpc_decoding_done_and_check(&ot_group, &ctx)) {
37+
if (!zcbor_uint_decode(ctx.zs, result, result_size)) {
38+
nrf_rpc_cbor_decoding_done(&ot_group, &ctx);
3939
ot_rpc_report_rsp_decoding_error(id);
4040
return;
4141
}
4242

43-
memcpy(result, &value, result_size);
43+
nrf_rpc_cbor_decoding_done(&ot_group, &ctx);
4444
}
4545

4646
static int get_string(int id, char *buffer, size_t buffer_size)

0 commit comments

Comments
 (0)