From 8c5e2e2b085af51d42df1c21e89c8e3f407f354d Mon Sep 17 00:00:00 2001 From: Tommi Rantanen Date: Fri, 27 Mar 2026 14:12:57 +0200 Subject: [PATCH] app: sms: Add timezone into concatenated msg and doc Normal single SMS reception gives timezone information in the format "UTC+02:00". This was not present for concatenated SMS messages and the format "UTC+02:00" is not mentioned in the documentation. Fixing these. Jira: SM-278 Signed-off-by: Tommi Rantanen --- app/src/sm_at_sms.c | 9 ++++++--- doc/app/at_sms.rst | 6 +++--- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/app/src/sm_at_sms.c b/app/src/sm_at_sms.c index b4142ef3..82c4859e 100644 --- a/app/src/sm_at_sms.c +++ b/app/src/sm_at_sms.c @@ -89,10 +89,13 @@ static void sms_callback(struct sms_data *const data, void *context) goto done; } if (header->concatenated.seq_number == 1) { - sprintf(rsp_buf, "\r\n#XSMS: \"%02d-%02d-%02d %02d:%02d:%02d\",\"", + sprintf(rsp_buf, + "\r\n#XSMS: \"%02d-%02d-%02d %02d:%02d:%02d " + "UTC%+03d:%02d\",\"", header->time.year, header->time.month, header->time.day, - header->time.hour, header->time.minute, - header->time.second); + header->time.hour, header->time.minute, header->time.second, + header->time.timezone * 15 / 60, + abs(header->time.timezone) * 15 % 60); strcat(rsp_buf, header->originating_address.address_str); strcat(rsp_buf, "\",\""); strcat(rsp_buf, data->payload); diff --git a/doc/app/at_sms.rst b/doc/app/at_sms.rst index 96708361..ec651a5a 100644 --- a/doc/app/at_sms.rst +++ b/doc/app/at_sms.rst @@ -49,7 +49,7 @@ This is the notification syntax when an SMS message is received: * The ```` parameter is a string. It represents the time when the SMS is received. - It has a format of ``YY-MM-DD HH:MM:SS``. + It has a format of ``YY-MM-DD HH:MM:SS UTC[+|-]HH:MM``. * The ```` parameter is a string. It represents the SMS sender's phone number. * The ```` parameter is a string. @@ -69,13 +69,13 @@ Example OK - #XSMS: "21-05-24 11:58:22","090xxxxxxxx","Tested OK" + #XSMS: "21-05-24 11:58:22 UTC+09:30","090xxxxxxxx","Tested OK" at#xsms=2,"+8190xxxxxxxx","0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ" OK - #XSMS: "21-05-24 13:29:47","090xxxxxxxx","0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ" + #XSMS: "21-05-24 13:29:47 UTC-09:00","090xxxxxxxx","0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ" Read command ------------