Add packed-c protocol support for crypto service
To provide a lightweight parameter encoding that is aligned to
conventions used by SCMI, the packed-c parameter serialization has
been added to the crypto service. This builds on generic
components that allow other packed-c service access protocols
to be added easily. Service level tests have been extended to
use both protobuf and packed-c clients.
Signed-off-by: julhal01 <julian.hall@arm.com>
Change-Id: I9279b0814bcc9cf6c4aa4e30629e2f46f2df4c23
diff --git a/deployments/ts-demo/ts-demo.cmake b/deployments/ts-demo/ts-demo.cmake
index d6f1067..828a31e 100644
--- a/deployments/ts-demo/ts-demo.cmake
+++ b/deployments/ts-demo/ts-demo.cmake
@@ -36,9 +36,10 @@
BASE_DIR ${TS_ROOT}
COMPONENTS
"components/app/ts-demo"
+ "components/common/tlv"
"components/service/crypto/client/cpp"
- "components/service/common/serializer/protobuf"
- "protocols/service/crypto/protobuf"
+ "components/service/crypto/client/cpp/packed-c"
+ "protocols/service/crypto/packed-c"
)
#-------------------------------------------------------------------------------
@@ -46,11 +47,6 @@
#
#-------------------------------------------------------------------------------
-# Nanopb
-include(${TS_ROOT}/external/nanopb/nanopb.cmake)
-target_link_libraries(ts-demo PRIVATE nanopb::protobuf-nanopb-static)
-protobuf_generate_all(TGT "ts-demo" NAMESPACE "protobuf" BASE_DIR "${TS_ROOT}/protocols")
-
# Mbedcrypto
include(${TS_ROOT}/external/mbed-crypto/mbedcrypto.cmake)
target_link_libraries(ts-demo PRIVATE mbedcrypto)
diff --git a/deployments/ts-demo/ts-demo.cpp b/deployments/ts-demo/ts-demo.cpp
index eaa8b52..2f607e6 100644
--- a/deployments/ts-demo/ts-demo.cpp
+++ b/deployments/ts-demo/ts-demo.cpp
@@ -3,7 +3,7 @@
* Copyright (c) 2020-2021, Arm Limited and Contributors. All rights reserved.
*/
-#include <service/crypto/client/cpp/crypto_client.h>
+#include <service/crypto/client/cpp/packed-c/packedc_crypto_client.h>
#include <protocols/rpc/common/packed-c/encoding.h>
#include <app/ts-demo/ts-demo.h>
#include <service_locator.h>
@@ -25,11 +25,11 @@
struct rpc_caller *caller;
rpc_session_handle rpc_session_handle;
- rpc_session_handle = service_context_open(crypto_service_context, TS_RPC_ENCODING_PROTOBUF, &caller);
+ rpc_session_handle = service_context_open(crypto_service_context, TS_RPC_ENCODING_PACKED_C, &caller);
if (rpc_session_handle) {
- crypto_client crypto_client(caller);
+ packedc_crypto_client crypto_client(caller);
status = run_ts_demo(&crypto_client, true);