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

◆ NRF_RPC_GROUP_DEFINE_INTERNAL__

#define NRF_RPC_GROUP_DEFINE_INTERNAL__ ( _name,
_strid,
_transport,
_ack_handler,
_ack_data,
_err_handler,
_bound_handler,
_wait_on_init,
_initiator )

#include <nrf_rpc/include/nrf_rpc.h>

Value:
NRF_RPC_AUTO_ARR(NRF_RPC_CONCAT(_name, _cmd_array), \
"cmd_" NRF_RPC_STRINGIFY(_name)); \
NRF_RPC_AUTO_ARR(NRF_RPC_CONCAT(_name, _evt_array), \
"evt_" NRF_RPC_STRINGIFY(_name)); \
\
static struct nrf_rpc_group_data NRF_RPC_CONCAT(_name, _group_data) = { \
.src_group_id = NRF_RPC_ID_UNKNOWN, \
.dst_group_id = NRF_RPC_ID_UNKNOWN, \
.transport_initialized = false, \
}; \
\
NRF_RPC_AUTO_ARR_ITEM(const struct nrf_rpc_group, _name, "grp", \
_strid) = { \
.cmd_array = &NRF_RPC_CONCAT(_name, _cmd_array), \
.evt_array = &NRF_RPC_CONCAT(_name, _evt_array), \
.data = &NRF_RPC_CONCAT(_name, _group_data), \
.ack_handler = _ack_handler, \
.ack_handler_data = _ack_data, \
.strid = _strid, \
.transport = _transport, \
.err_handler = _err_handler, \
.bound_handler = _bound_handler, \
.flags = NRF_RPC_FLAG_COND(_wait_on_init, NRF_RPC_FLAGS_WAIT_ON_INIT) \
}
#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_AUTO_ARR(_name, _array_key)
Creates new automatically registered array.
Definition nrf_rpc_common.h:111
#define NRF_RPC_ID_UNKNOWN
Special value to indicate that ID is unknown or irrelevant.
Definition nrf_rpc.h:33
#define NRF_RPC_FLAGS_WAIT_ON_INIT
Flag indicating that the group does not block on initialization.
Definition nrf_rpc.h:36
#define NRF_RPC_FLAG_COND(_cond, _flag)
Helper macro for conditional flag initialization.
Definition nrf_rpc.h:42
#define NRF_RPC_FLAGS_INITIATOR
Flag indicating that the peer must initiate group binding.
Definition nrf_rpc.h:39
Group data structure. It contains no constant group data.
Definition nrf_rpc.h:125
Defines a group of commands and events.
Definition nrf_rpc.h:139

Internal macro for parametrizing nrf_rpc groups.

Parameters
_nameSymbol name of the group.
_stridString containing a unique identifier of the group. Naming conventions are the same as with C symbol name. Groups on local and remote must have the same unique identifier.
_transportGroup transport. It is used by group to communicate with a remote processor.
_ack_handlerHandler of type nrf_rpc_ack_handler_t, called when ACK was received after event completion. Can be NULL if the group does not want to receive ACK notifications.
_ack_dataOpaque pointer for the _ack_handler.
_err_handlerHandler of type nrf_rpc_err_handler_t, called when an error occurred in context of this group. Can be NULL if the group does not want to receive error notifications.
_bound_handlerHandler of type nrf_rpc_group_bound_handler_t, called when the group was successfuly bound. The callback is called each time the remote peer binds to the group. This can be used to detect a remote peer reset and can be used by the application to reset the local state.
_wait_on_initThe group does not block until it is bound.
_initiatorThe group is the initiator.