zephyr/samples/tfm_integration/psa_crypto/src/shell.c
Devaraj Ranganna ac9197b640 samples: tfm_integration: Rename sample psa_level_1 to psa_crypto
The example in folder `samples/tfm_integration/psa_level_1` contains
code that demonstrate usage of PSA crypto APIs in Zephyr rather than the
PSA levels. Therefore renaming the sample as `psa_crypto`.

Signed-off-by: Devaraj Ranganna <devaraj.ranganna@linaro.org>
2021-06-09 19:48:43 +02:00

41 lines
819 B
C

/*
* Copyright (c) 2019,2020 Linaro Limited
*
* SPDX-License-Identifier: Apache-2.0
*/
#include <stdlib.h>
#include <ctype.h>
#include <shell/shell.h>
#if CONFIG_PSA_SHELL
static int
psa_shell_invalid_arg(const struct shell *shell, char *arg_name)
{
shell_print(shell, "Error: invalid argument \"%s\"\n", arg_name);
return -EINVAL;
}
static int
psa_shell_cmd_version(const struct shell *shell, size_t argc, char **argv)
{
shell_print(shell, "%s", "0.0.0");
return 0;
}
/* Subcommand array for "psa" (level 1). */
SHELL_STATIC_SUBCMD_SET_CREATE(sub_psa,
/* 'version' command handler. */
SHELL_CMD(version, NULL, "app version", psa_shell_cmd_version),
/* Array terminator. */
SHELL_SUBCMD_SET_END
);
/* Root command "psa" (level 0). */
SHELL_CMD_REGISTER(psa, &sub_psa, "PSA commands", NULL);
#endif