Extend RPC parameters
The RPC model is extended to include parameters for identifying
an RPC interface instance at an endpoint and another for
identifying the parameter encoding. The interface ID parameter
allows multiple service interfaces to be co-located. The encoding
parameter allows clients to use different parameter serialization
schemes and to specify the format in each RPC request.
Signed-off-by: julhal01 <julian.hall@arm.com>
Change-Id: I201b3417dc0e9f655113b9931db3494e41f1d74b
diff --git a/components/rpc/common/caller/rpc_caller.c b/components/rpc/common/caller/rpc_caller.c
index 4fd1e5a..00b559c 100644
--- a/components/rpc/common/caller/rpc_caller.c
+++ b/components/rpc/common/caller/rpc_caller.c
@@ -1,11 +1,25 @@
/*
- * Copyright (c) 2020, Arm Limited and Contributors. All rights reserved.
+ * Copyright (c) 2020-2021, Arm Limited and Contributors. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
#include <rpc_caller.h>
#include <stdint.h>
+#include <protocols/rpc/common/packed-c/encoding.h>
+
+void rpc_caller_init(struct rpc_caller *s, void *context)
+{
+ s->context = context;
+
+ /* The default encoding scheme - may be overridden by a client */
+ s->encoding = TS_RPC_ENCODING_PACKED_C;
+}
+
+void rpc_caller_set_encoding_scheme(struct rpc_caller *s, uint32_t encoding)
+{
+ s->encoding = encoding;
+}
rpc_call_handle rpc_caller_begin(struct rpc_caller *s,
uint8_t **req_buf, size_t req_len)