Skip to content

Commit e06ccd6

Browse files
committed
modem: Add warning to modem shell for long SMS (#152)
Added a warning to modem shell for SMS messages larger than the specified maximum value. Signed-off-by: Jared Baumann <jared.baumann8@t-mobile.com>
1 parent f6c649b commit e06ccd6

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

drivers/modem/modem_shell.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -270,6 +270,11 @@ static int cmd_modem_sms_send(const struct shell *shell, size_t argc,
270270
return -ENOEXEC;
271271
}
272272

273+
if (strlen(argv[3]) > (sizeof(sms.msg) - 1)) {
274+
shell_fprintf(shell, SHELL_WARNING,
275+
"Specified message longer than maximum, truncating message\n");
276+
}
277+
273278
snprintk(sms.phone, sizeof(sms.phone), "%s", argv[2]);
274279
snprintk(sms.msg, sizeof(sms.msg), "%s", argv[3]);
275280

0 commit comments

Comments
 (0)