nrfxlib API 2.8.99
Loading...
Searching...
No Matches
nrf_rpc_cbor.h File Reference
#include <stdint.h>
#include <stdbool.h>
#include <stddef.h>
#include <zcbor_common.h>
#include <zcbor_decode.h>
#include <zcbor_encode.h>
#include <nrf_rpc.h>

Go to the source code of this file.

Data Structures

struct  nrf_rpc_cbor_ctx
 Context for encoding and sending commands, events and responses. More...
 

Macros

#define NRF_RPC_ZCBOR_STATES   (2 + CONFIG_NRF_RPC_ZCBOR_BACKUPS)
 
#define NRF_RPC_CBOR_CMD_DECODER(_group, _name, _cmd, _handler, _data)
 Register a command decoder.
 
#define NRF_RPC_CBOR_EVT_DECODER(_group, _name, _evt, _handler, _data)
 Register an event decoder.
 
#define NRF_RPC_CBOR_ALLOC(_group, _ctx, _len)
 Allocates memory for a packet.
 
#define NRF_RPC_CBOR_DISCARD(_group, _ctx)
 Deallocate memory for a packet.
 

Typedefs

typedef void(* nrf_rpc_cbor_handler_t) (const struct nrf_rpc_group *group, struct nrf_rpc_cbor_ctx *ctx, void *handler_data)
 Callback that handles decoding of commands, events and responses.
 

Functions

bool nrf_rpc_cbor_is_alloc (struct nrf_rpc_cbor_ctx *ctx)
 Check that the memory for a packet has been allocated.
 
int nrf_rpc_cbor_cmd (const struct nrf_rpc_group *group, uint8_t cmd, struct nrf_rpc_cbor_ctx *ctx, nrf_rpc_cbor_handler_t handler, void *handler_data)
 Send a command and provide callback to handle response.
 
int nrf_rpc_cbor_cmd_rsp (const struct nrf_rpc_group *group, uint8_t cmd, struct nrf_rpc_cbor_ctx *ctx)
 Send a command and get response as an output parameter.
 
void nrf_rpc_cbor_cmd_no_err (const struct nrf_rpc_group *group, uint8_t cmd, struct nrf_rpc_cbor_ctx *ctx, nrf_rpc_cbor_handler_t handler, void *handler_data)
 Send a command, provide callback to handle response and pass any error to an error handler.
 
void nrf_rpc_cbor_cmd_rsp_no_err (const struct nrf_rpc_group *group, uint8_t cmd, struct nrf_rpc_cbor_ctx *ctx)
 Send a command, get response as an output parameter and pass any error to an error handler.
 
int nrf_rpc_cbor_evt (const struct nrf_rpc_group *group, uint8_t evt, struct nrf_rpc_cbor_ctx *ctx)
 Send an event.
 
void nrf_rpc_cbor_evt_no_err (const struct nrf_rpc_group *group, uint8_t evt, struct nrf_rpc_cbor_ctx *ctx)
 Send an event and pass any error to an error handler.
 
int nrf_rpc_cbor_rsp (const struct nrf_rpc_group *group, struct nrf_rpc_cbor_ctx *ctx)
 Send a response.
 
void nrf_rpc_cbor_rsp_no_err (const struct nrf_rpc_group *group, struct nrf_rpc_cbor_ctx *ctx)
 Send a response and pass any error to an error handler.
 
void nrf_rpc_cbor_decoding_done (const struct nrf_rpc_group *group, struct nrf_rpc_cbor_ctx *ctx)
 Indicate that decoding of the input packet is done.