Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions app/src/sm_at_sms.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
6 changes: 3 additions & 3 deletions doc/app/at_sms.rst
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ This is the notification syntax when an SMS message is received:

* The ``<datetime>`` 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 ``<number>`` parameter is a string.
It represents the SMS sender's phone number.
* The ``<text>`` parameter is a string.
Expand All @@ -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
------------
Expand Down
Loading