Add RPC demux component
To support multiple co-located service providers, the rpc_demux
may be used. It presents a single input rpc_interface and
demultiplexes incoming call requests to 1..* attached outputs
using the interface_id parameter carried by the underlying
RPC.
Signed-off-by: Julian Hall <julian.hall@arm.com>
Change-Id: I03d7423892cd07d8a8fcd445dbb7dc7e62497455
diff --git a/components/rpc/common/endpoint/rpc_interface.h b/components/rpc/common/endpoint/rpc_interface.h
index 44e5783..ba949de 100644
--- a/components/rpc/common/endpoint/rpc_interface.h
+++ b/components/rpc/common/endpoint/rpc_interface.h
@@ -10,6 +10,7 @@
#include <stddef.h>
#include <stdint.h>
#include <rpc_status.h>
+#include <protocols/rpc/common/packed-c/status.h>
#ifdef __cplusplus
extern "C" {
@@ -120,7 +121,14 @@
static inline rpc_status_t rpc_interface_receive(struct rpc_interface *iface,
struct call_req *req)
{
- return iface->receive(iface, req);
+ rpc_status_t rpc_status = TS_RPC_ERROR_INTERFACE_DOES_NOT_EXIST;
+
+ if (iface) {
+
+ rpc_status = iface->receive(iface, req);
+ }
+
+ return rpc_status;
}
#ifdef __cplusplus