shell: add function checking shell readiness.
Tests with shell commands will fail if they are started before the shell backend is initialized or started. Adding API function: shell_ready indicating shell readiness. Signed-off-by: Jakub Rzeszutko <jakub.rzeszutko@nordicsemi.no>
This commit is contained in:
parent
2b05f467f0
commit
66d4471d48
2 changed files with 16 additions and 0 deletions
|
@ -1690,6 +1690,13 @@ void shell_set_bypass(const struct shell *sh, shell_bypass_cb_t bypass)
|
|||
sh->ctx->bypass = bypass;
|
||||
}
|
||||
|
||||
bool shell_ready(const struct shell *sh)
|
||||
{
|
||||
__ASSERT_NO_MSG(sh);
|
||||
|
||||
return state_get(sh) == SHELL_STATE_ACTIVE;
|
||||
}
|
||||
|
||||
static int cmd_help(const struct shell *shell, size_t argc, char **argv)
|
||||
{
|
||||
ARG_UNUSED(argc);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue