nrfxlib API 2.8.99
Loading...
Searching...
No Matches
nrf_rpc_tr.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2020 Nordic Semiconductor ASA
3 *
4 * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
5 */
6
7#ifndef NRF_RPC_TR_H_
8#define NRF_RPC_TR_H_
9
10#include <nrf_rpc.h>
11
12/* Helper nRF transport structure declaration. */
13struct nrf_rpc_tr;
14
22typedef void (*nrf_rpc_tr_receive_handler_t)(const struct nrf_rpc_tr *transport,
23 const uint8_t *packet, size_t len,
24 void *context);
25
39 int (*init)(const struct nrf_rpc_tr *transport, nrf_rpc_tr_receive_handler_t receive_cb,
40 void *context);
41
51 int (*send)(const struct nrf_rpc_tr *transport, const uint8_t *data, size_t length);
52
67 void *(*tx_buf_alloc)(const struct nrf_rpc_tr *transport, size_t *size);
68
77 void (*tx_buf_free)(const struct nrf_rpc_tr *transport, void *buf);
78
87 void (*rx_buf_free)(const struct nrf_rpc_tr *transport, void *buf);
88};
89
92struct nrf_rpc_tr {
94 const struct nrf_rpc_tr_api *api;
95
97 void *ctx;
98};
99
100#endif /* NRF_RPC_TR_H_ */
void(* nrf_rpc_tr_receive_handler_t)(const struct nrf_rpc_tr *transport, const uint8_t *packet, size_t len, void *context)
Packet receive handler callback.
Definition nrf_rpc_tr.h:22
int(* init)(const struct nrf_rpc_tr *transport, nrf_rpc_tr_receive_handler_t receive_cb, void *context)
Function for initialization the nRF RPC transport interface.
Definition nrf_rpc_tr.h:39
int(* send)(const struct nrf_rpc_tr *transport, const uint8_t *data, size_t length)
Function for sending data over transport interface.
Definition nrf_rpc_tr.h:51
void(* tx_buf_free)(const struct nrf_rpc_tr *transport, void *buf)
Function for free allocated Tx buffer.
Definition nrf_rpc_tr.h:77
void(* rx_buf_free)(const struct nrf_rpc_tr *transport, void *buf)
Function for free allocated Rx buffer.
Definition nrf_rpc_tr.h:87
Unified nRF RPC transport API structure.
Definition nrf_rpc_tr.h:28
const struct nrf_rpc_tr_api * api
Definition nrf_rpc_tr.h:94
void * ctx
Definition nrf_rpc_tr.h:97
nRF RPC transport structure.
Definition nrf_rpc_tr.h:92