nRF Connect SDK API 0.1.0
Loading...
Searching...
No Matches
NRF RPC serialize API

API for the NRF RPC serialization. More...

Data Structures

struct  nrf_rpc_scratchpad
 Scratchpad structure. More...
 

Macros

#define NRF_RPC_SCRATCHPAD_ALIGN(size)   WB_UP(size)
 Get a scratchpad item size aligned to 4-byte boundary.
 
#define NRF_RPC_SCRATCHPAD_DECLARE(_scratchpad, _ctx)
 Alloc the scratchpad. Scratchpad is used to store a data when decoding serialized data.
 

Functions

static void * nrf_rpc_scratchpad_add (struct nrf_rpc_scratchpad *scratchpad, size_t size)
 Get the scratchpad item of a given size. The scratchpad item size will be round up to multiple of 4.
 
void nrf_rpc_encode_null (struct nrf_rpc_cbor_ctx *ctx)
 Encode a null value.
 
void nrf_rpc_encode_undefined (struct nrf_rpc_cbor_ctx *ctx)
 Encode an undefined value.
 
void nrf_rpc_encode_bool (struct nrf_rpc_cbor_ctx *ctx, bool value)
 Encode a boolean value.
 
void nrf_rpc_encode_uint (struct nrf_rpc_cbor_ctx *ctx, uint32_t value)
 Encode an unsigned integer value.
 
void nrf_rpc_encode_int (struct nrf_rpc_cbor_ctx *ctx, int32_t value)
 Encode an integer value.
 
void nrf_rpc_encode_uint64 (struct nrf_rpc_cbor_ctx *ctx, uint64_t value)
 Encode an 64bits unsigned integer value.
 
void nrf_rpc_encode_int64 (struct nrf_rpc_cbor_ctx *ctx, int64_t value)
 Encode an 64bits integer value.
 
void nrf_rpc_encode_str (struct nrf_rpc_cbor_ctx *ctx, const char *value, int len)
 Encode a string value.
 
void nrf_rpc_encode_buffer (struct nrf_rpc_cbor_ctx *ctx, const void *data, size_t size)
 Encode a buffer.
 
void nrf_rpc_encode_callback (struct nrf_rpc_cbor_ctx *ctx, void *callback)
 Encode a callback.
 
static void nrf_rpc_encode_callback_call (struct nrf_rpc_cbor_ctx *ctx, uint32_t slot)
 Encode a callback slot number.
 
void nrf_rpc_encoder_invalid (struct nrf_rpc_cbor_ctx *ctx)
 Put encode into an invalid state. All further encoding on this encoder will be ignored. Invalid state can be checked with the is_encoder_invalid() function.
 
void nrf_rpc_decode_skip (struct nrf_rpc_cbor_ctx *ctx)
 Skip one value to decode.
 
bool nrf_rpc_decode_is_null (struct nrf_rpc_cbor_ctx *ctx)
 Check if value is a null. This function will not consume the value.
 
bool nrf_rpc_decode_is_undefined (struct nrf_rpc_cbor_ctx *ctx)
 Check if value is an undefined. This function will not consume the value.
 
bool nrf_rpc_decode_bool (struct nrf_rpc_cbor_ctx *ctx)
 Decode a boolean value.
 
uint32_t nrf_rpc_decode_uint (struct nrf_rpc_cbor_ctx *ctx)
 Decode an unsigned integer value.
 
int32_t nrf_rpc_decode_int (struct nrf_rpc_cbor_ctx *ctx)
 Decode a integer value.
 
uint64_t nrf_rpc_decode_uint64 (struct nrf_rpc_cbor_ctx *ctx)
 Decode a 64bits unsigned integer value.
 
int64_t nrf_rpc_decode_int64 (struct nrf_rpc_cbor_ctx *ctx)
 Decode a 64bits integer value.
 
char * nrf_rpc_decode_str (struct nrf_rpc_cbor_ctx *ctx, char *buffer, size_t buffer_size)
 Decode a string value.
 
char * nrf_rpc_decode_str_into_scratchpad (struct nrf_rpc_scratchpad *scratchpad, size_t *len)
 
void * nrf_rpc_decode_buffer (struct nrf_rpc_cbor_ctx *ctx, void *buffer, size_t buffer_size)
 Decode a buffer.
 
const void * nrf_rpc_decode_buffer_ptr_and_size (struct nrf_rpc_cbor_ctx *ctx, size_t *size)
 Decode buffer pointer and length. Moves CBOR buffer pointer past buffer on success.
 
void * nrf_rpc_decode_buffer_into_scratchpad (struct nrf_rpc_scratchpad *scratchpad, size_t *len)
 Decode buffer into a scratchpad.
 
void * nrf_rpc_decode_callbackd (struct nrf_rpc_cbor_ctx *ctx, void *handler)
 Decode a callback.
 
void * nrf_rpc_decode_callback_call (struct nrf_rpc_cbor_ctx *ctx)
 Decode callback slot.
 
void nrf_rpc_decoder_invalid (struct nrf_rpc_cbor_ctx *ctx, int err)
 Put decoder into an invalid state and set error code that caused it. All further decoding on this decoder will be ignored. Invalid state can be checked with the nrf_rpc_decode_valid() function.
 
bool nrf_rpc_decode_valid (const struct nrf_rpc_cbor_ctx *ctx)
 Returns if decoder is in valid state.
 
bool nrf_rpc_decoding_done_and_check (const struct nrf_rpc_group *group, struct nrf_rpc_cbor_ctx *ctx)
 Signalize that decoding is done. Use this function when you finish decoding of the received serialized packet.
 
void nrf_rpc_rsp_decode_bool (const struct nrf_rpc_group *group, struct nrf_rpc_cbor_ctx *ctx, void *handler_data)
 Decode a command response as a boolean value.
 
void nrf_rpc_rsp_decode_uint (const struct nrf_rpc_group *group, struct nrf_rpc_cbor_ctx *ctx, void *result, size_t result_size)
 Decode a command response as an unsigned integer value.
 
void nrf_rpc_rsp_decode_u8 (const struct nrf_rpc_group *group, struct nrf_rpc_cbor_ctx *ctx, void *handler_data)
 Decode a command response as an unsigned 8-bit integer value.
 
void nrf_rpc_rsp_decode_u16 (const struct nrf_rpc_group *group, struct nrf_rpc_cbor_ctx *ctx, void *handler_data)
 Decode a command response as an unsigned 16-bit integer value.
 
void nrf_rpc_rsp_decode_u32 (const struct nrf_rpc_group *group, struct nrf_rpc_cbor_ctx *ctx, void *handler_data)
 Decode a command response as an unsigned 32-bit integer value.
 
void nrf_rpc_rsp_decode_int (const struct nrf_rpc_group *group, struct nrf_rpc_cbor_ctx *ctx, void *result, size_t result_size)
 Decode a command response as a signed integer value.
 
void nrf_rpc_rsp_decode_i8 (const struct nrf_rpc_group *group, struct nrf_rpc_cbor_ctx *ctx, void *handler_data)
 Decode a command response as a signed 8-bit integer value.
 
void nrf_rpc_rsp_decode_i16 (const struct nrf_rpc_group *group, struct nrf_rpc_cbor_ctx *ctx, void *handler_data)
 Decode a command response as a signed 16-bit integer value.
 
void nrf_rpc_rsp_decode_i32 (const struct nrf_rpc_group *group, struct nrf_rpc_cbor_ctx *ctx, void *handler_data)
 Decode a command response as a signed 32-bit integer value.
 
void nrf_rpc_rsp_decode_void (const struct nrf_rpc_group *group, struct nrf_rpc_cbor_ctx *ctx, void *handler_data)
 Decode a command response as a void value.
 
void nrf_rpc_rsp_send_int (const struct nrf_rpc_group *group, int32_t response)
 Send response to a command as an integer value.
 
void nrf_rpc_rsp_send_uint (const struct nrf_rpc_group *group, uint32_t response)
 Send response to a command as an unsigned integer value.
 
void nrf_rpc_rsp_send_bool (const struct nrf_rpc_group *group, bool response)
 Send response to a command as a boolean value.
 
void nrf_rpc_rsp_send_void (const struct nrf_rpc_group *group)
 Send response to a command as a void.
 

Detailed Description

API for the NRF RPC serialization.