nRF Connect SDK API 2.8.99
|
#define NRF_RPC_IPC_TRANSPORT | ( | _name, | |
_ipc, | |||
_ept_name ) |
#include <include/nrf_rpc/nrf_rpc_ipc.h>
Defines the nRF IPC Transport instance.
It creates the nRF RPC IPC Service transport instance. The _ipc
parameter defines the destination remote CPU. A single instance of this transport can be shared between several nRF RPC groups. Thus, a single endpoint is shared by multiple nRF RPC groups. It is also allowed to share a single IPC instance with a different endpoint name between groups.
Example:
Two groups share the same IPC instance and the same endpoint:
NRF_RPC_IPC_TRANSPORT(nrf_rpc_1, DEVICE_DT_GET(DT_NODELABEL(ipc0)), "nrf_rpc_ept_1");
NRF_RPC_GROUP_DEFINE(group_1, "Group_1", &nrf_rpc_1, NULL, NULL, NULL); NRF_RPC_GROUP_DEFINE(group_2, "Group_2", &nrf_rpc_1, NULL, NULL, NULL);
Two groups share the same IPC instance but endpoint is different for each group:
NRF_RPC_IPC_TRANSPORT(nrf_rpc_1, DEVICE_DT_GET(DT_NODELABEL(ipc0)), "nrf_rpc_ept_1"); NRF_RPC_IPC_TRANSPORT(nrf_rpc_2, DEVICE_DT_GET(DT_NODELABEL(ipc0)), "nrf_rpc_ept_2");
NRF_RPC_GROUP_DEFINE(group_1, "Group_1", &nrf_rpc_1, NULL, NULL, NULL); NRF_RPC_GROUP_DEFINE(group_2, "Group_2", &nrf_rpc_2, NULL, NULL, NULL);
Each group use different IPC instance, for example each IPC instance defined communication with different remote CPUs:
NRF_RPC_IPC_TRANSPORT(nrf_rpc_1, DEVICE_DT_GET(DT_NODELABEL(ipc0)), "nrf_rpc_ept"); NRF_RPC_IPC_TRANSPORT(nrf_rpc_2, DEVICE_DT_GET(DT_NODELABEL(ipc1)), "nrf_rpc_ept");
NRF_RPC_GROUP_DEFINE(group_1, "Group_1", &nrf_rpc_1, NULL, NULL, NULL); NRF_RPC_GROUP_DEFINE(group_2, "Group_2", &nrf_rpc_2, NULL, NULL, NULL);
[in] | _name | nRF RPC IPC Service transport instance name. |
[in] | _ipc | The instance used for the IPC Service to transfer data between CPUs. |
[in] | _ept_name | IPC Service endpoint name. The endpoint must have the same name on the corresponding remote CPU. |