Skip to content

Commit e1fb005

Browse files
committed
lib: modem_slm: Command for toggling power pin
Add command for toggling power pin. Also adding main command for operations done in SLM shell device. Toggling is done as follows: "slmsh powerpin" Jira: LRCS-84 Signed-off-by: Tommi Rantanen <tommi.rantanen@nordicsemi.no>
1 parent ea8b6f8 commit e1fb005

File tree

1 file changed

+22
-2
lines changed

1 file changed

+22
-2
lines changed

lib/modem_slm/modem_slm.c

+22-2
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ static void gpio_wakeup_wk(struct k_work *work)
6565
if (gpio_pin_set(gpio_dev, CONFIG_MODEM_SLM_WAKEUP_PIN, 0) != 0) {
6666
LOG_WRN("GPIO set error");
6767
}
68-
LOG_DBG("Stop wake-up");
68+
LOG_INF("Stop wake-up");
6969
}
7070

7171
static void slm_data_wk(struct k_work *work)
@@ -525,6 +525,26 @@ int modem_slm_shell(const struct shell *shell, size_t argc, char **argv)
525525
return modem_slm_send_cmd((char *)argv[1], 0);
526526
}
527527

528-
SHELL_CMD_REGISTER(slm, NULL, "SLM Shell", modem_slm_shell);
528+
int modem_slm_shell_slmsh_powerpin(const struct shell *shell, size_t argc, char **argv)
529+
{
530+
int err;
531+
532+
err = modem_slm_wake_up();
533+
if (err) {
534+
LOG_ERR("Failed to toggle power pin");
535+
}
536+
return 0;
537+
}
538+
539+
SHELL_CMD_REGISTER(slm, NULL, "Send AT commands to SLM device", modem_slm_shell);
540+
541+
SHELL_STATIC_SUBCMD_SET_CREATE(
542+
sub_slmsh,
543+
SHELL_CMD(powerpin, NULL, "Toggle power pin configured with CONFIG_SLM_POWER_PIN",
544+
modem_slm_shell_slmsh_powerpin),
545+
SHELL_SUBCMD_SET_END
546+
);
547+
548+
SHELL_CMD_REGISTER(slmsh, &sub_slmsh, "Commands handled in SLM shell device", NULL);
529549

530550
#endif /* CONFIG_MODEM_SLM_SHELL */

0 commit comments

Comments
 (0)