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

◆ nrf_rpc_cmd()

static int nrf_rpc_cmd ( const struct nrf_rpc_group group,
uint8_t  cmd,
uint8_t *  packet,
size_t  len,
nrf_rpc_handler_t  handler,
void *  handler_data 
)
inlinestatic

#include <nrf_rpc/include/nrf_rpc.h>

Send a command and provide callback to handle response.

Parameters
groupGroup that command belongs to.
cmdCommand id.
packetPacket allocated by nrf_rpc_alloc_tx_buf and filled with an encoded data.
lenLength of the packet. Can be smaller than allocated.
handlerCallback that handles the response. In case of error (e.g. malformed response packet was received) it is undefined if the handler will be called.
handler_dataOpaque pointer that will be passed to handler.
Returns
0 on success or negative error code if a transport layer reported a sending error.