nrfxlib API 0.1.0
Loading...
Searching...
No Matches

◆ NRF_RPC_CMD_DECODER

#define NRF_RPC_CMD_DECODER (   _group,
  _name,
  _cmd,
  _handler,
  _data 
)

#include <nrf_rpc/include/nrf_rpc.h>

Value:
NRF_RPC_STATIC_ASSERT(_cmd <= 0xFE, "Command out of range"); \
NRF_RPC_AUTO_ARR_ITEM(const struct _nrf_rpc_decoder, \
NRF_RPC_CONCAT(_name, _cmd_dec), \
"cmd_" NRF_RPC_STRINGIFY(_group), \
NRF_RPC_STRINGIFY(_name)) = { \
.id = _cmd, \
.handler = _handler, \
.handler_data = _data, \
}
#define NRF_RPC_CONCAT(_x, _y)
Macro for concatenating two tokens in macro expansion.
Definition: nrf_rpc_common.h:40
#define NRF_RPC_STRINGIFY(_x)
Macro for converting macro argument into a string constans.
Definition: nrf_rpc_common.h:58
#define NRF_RPC_STATIC_ASSERT(_expr, _msg)
Compile-time assert.
Definition: nrf_rpc_common.h:87

Register a command decoder.

Parameters
_groupGroup that the decoder will belong to, created with a NRF_RPC_GROUP_DEFINE().
_nameName of the decoder.
_cmdCommand id. Can be from 0 to 254.
_handlerHandler function of type nrf_rpc_handler_t.
_dataOpaque pointer for the _handler.