From e1dd295cbdb2d83b52ef74ebaf4e503d3589614f Mon Sep 17 00:00:00 2001 From: Uros Majstorovic Date: Sun, 9 Aug 2020 20:32:25 +0200 Subject: added new sms flags --- fw/esp32/components/eos/gsm.c | 53 +++++++++++++++++++++++++++-------- fw/esp32/components/eos/include/gsm.h | 8 ++++-- 2 files changed, 48 insertions(+), 13 deletions(-) diff --git a/fw/esp32/components/eos/gsm.c b/fw/esp32/components/eos/gsm.c index 552af66..6ae73ee 100644 --- a/fw/esp32/components/eos/gsm.c +++ b/fw/esp32/components/eos/gsm.c @@ -7,13 +7,18 @@ #define DIVC(x,y) ((x) / (y) + ((x) % (y) != 0)) uint8_t pdu_getc(char *pdu) { + int ch; sscanf(pdu, "%2X", &ch); return ch; } void pdu_putc(uint8_t ch, char *pdu) { - sprintf(pdu, "%.2X", ch); + char b[3]; + + sprintf(b, "%.2X", ch); + *pdu = b[0]; + *(pdu + 1) = b[1]; } void pdu_gets(char *pdu, uint8_t *s, int s_len) { @@ -27,9 +32,12 @@ void pdu_gets(char *pdu, uint8_t *s, int s_len) { void pdu_puts(uint8_t *s, int s_len, char *pdu) { int i; + char b[3]; for (i=0; i