nrfxlib API 2.8.99
Loading...
Searching...
No Matches

◆ NRF_RPC_CBOR_ALLOC

#define NRF_RPC_CBOR_ALLOC ( _group,
_ctx,
_len )

#include <nrf_rpc/include/nrf_rpc_cbor.h>

Value:
do { \
nrf_rpc_alloc_tx_buf(_group, &((_ctx).out_packet), (_len) + 1); \
_nrf_rpc_cbor_prepare((struct nrf_rpc_cbor_ctx *)(&(_ctx)), (_len) + 1); \
} while (0)
Context for encoding and sending commands, events and responses.
Definition nrf_rpc_cbor.h:60

Allocates memory for a packet.

Macro may allocate some variables on stack, so it should be used at top level of a function.

Memory is automatically deallocated when it is passed to any of the send functions. If not NRF_RPC_CBOR_DISCARD() can be used.

Parameters
[in]_groupnRF RPC group.
[out]_ctxVariable of type nrf_rpc_cbor_ctx that will hold newly allocated resources to encode and send a packet.
[in]_lenRequested length of the packet.