nRF Connect SDK API 2.8.99
Loading...
Searching...
No Matches

◆ NRF_RPC_SCRATCHPAD_DECLARE

#define NRF_RPC_SCRATCHPAD_DECLARE ( _scratchpad,
_ctx )

#include <include/nrf_rpc/nrf_rpc_serialize.h>

Value:
(_scratchpad)->ctx = _ctx; \
uint32_t _scratchpad_size = nrf_rpc_decode_uint(_ctx); \
uint32_t _scratchpad_data[NRF_RPC_SCRATCHPAD_ALIGN(_scratchpad_size) / sizeof(uint32_t)]; \
net_buf_simple_init_with_data(&(_scratchpad)->buf, _scratchpad_data, _scratchpad_size); \
net_buf_simple_reset(&(_scratchpad)->buf)
#define NRF_RPC_SCRATCHPAD_ALIGN(size)
Get a scratchpad item size aligned to 4-byte boundary.
Definition nrf_rpc_serialize.h:31
uint32_t nrf_rpc_decode_uint(struct nrf_rpc_cbor_ctx *ctx)
Decode an unsigned integer value.

Alloc the scratchpad. Scratchpad is used to store a data when decoding serialized data.

Parameters
[in]_scratchpadScratchpad name.
[in]_ctxCBOR decoding context. One unsigned integer will be decoded from this value that contains scratchpad buffer size.