From 34f60314bedce036f982aa6591b5473ea4b0fa8b Mon Sep 17 00:00:00 2001 From: Uros Majstorovic Date: Fri, 21 Apr 2023 21:18:57 +0200 Subject: fixed SMS app --- fw/fe310/eos/net/cell.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'fw/fe310/eos') diff --git a/fw/fe310/eos/net/cell.c b/fw/fe310/eos/net/cell.c index b0eb475..b560f52 100644 --- a/fw/fe310/eos/net/cell.c +++ b/fw/fe310/eos/net/cell.c @@ -213,9 +213,17 @@ int eos_cell_sms_send(char *num, char *text, unsigned char *buffer, int sync) { async = !sync; } buffer[0] = EOS_CELL_MTYPE_SMS | EOS_CELL_MTYPE_SMS_MSG; - buffer[1] = (*num == '+' ? EOS_CELL_SMS_ADDRTYPE_INTL : EOS_CELL_SMS_ADDRTYPE_OTHER); - buffer[2] = num_len; - len = 3; + buffer[1] = 0; + buffer[2] = 0; + if (*num == '+') { + buffer[3] = EOS_CELL_SMS_ADDRTYPE_INTL; + num++; + num_len--; + } else { + buffer[3] = EOS_CELL_SMS_ADDRTYPE_OTHER; + } + buffer[4] = num_len; + len = 5; strcpy(buffer + len, num); len += num_len; strcpy(buffer + len, text); -- cgit v1.2.3