Skip to content

Commit d695c1c

Browse files
author
José Mendes
committed
applications: clime: Add enabled check to shell commands
Signed-off-by: José Mendes <[email protected]>
1 parent c4cdd60 commit d695c1c

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

subsys/ctr_ble_tag/ctr_ble_tag.c

+10
Original file line numberDiff line numberDiff line change
@@ -579,6 +579,11 @@ static int cmd_config_clear_tags(const struct shell *shell, size_t argc, char **
579579

580580
static int cmd_config_scan(const struct shell *shell, size_t argc, char **argv)
581581
{
582+
if (!m_config.enabled) {
583+
shell_error(shell, "tag subsystem is disabled");
584+
return -EINVAL;
585+
}
586+
582587
shell_print(shell, "scanning...");
583588

584589
k_sem_take(&m_scan_sem, K_FOREVER);
@@ -640,6 +645,11 @@ static int cmd_config_scan(const struct shell *shell, size_t argc, char **argv)
640645

641646
static int cmd_config_enroll(const struct shell *shell, size_t argc, char **argv)
642647
{
648+
if (!m_config.enabled) {
649+
shell_error(shell, "tag subsystem is disabled");
650+
return -EINVAL;
651+
}
652+
643653
k_sem_take(&m_scan_sem, K_FOREVER);
644654

645655
shell_print(shell, "enrolling...");

0 commit comments

Comments
 (0)