diff options
Diffstat (limited to 'fw/esp32/components/eos/include')
-rw-r--r-- | fw/esp32/components/eos/include/at_cmd.h | 3 | ||||
-rw-r--r-- | fw/esp32/components/eos/include/cell.h | 9 | ||||
-rw-r--r-- | fw/esp32/components/eos/include/gsm.h | 18 |
3 files changed, 29 insertions, 1 deletions
diff --git a/fw/esp32/components/eos/include/at_cmd.h b/fw/esp32/components/eos/include/at_cmd.h index 2fdd159..2d0813e 100644 --- a/fw/esp32/components/eos/include/at_cmd.h +++ b/fw/esp32/components/eos/include/at_cmd.h @@ -5,7 +5,7 @@ #define AT_SIZE_NMATCH 4 #define AT_SIZE_PATTERN 64 -#define AT_SIZE_URC_LIST 16 +#define AT_SIZE_URC_LIST 32 typedef void (*at_urc_cb_t) (char *, regmatch_t[]); @@ -15,3 +15,4 @@ int at_urc_insert(char *pattern, at_urc_cb_t cb, int flags); int at_urc_delete(char *pattern); void at_cmd(char *cmd); int at_expect(char *str_ok, char *str_err, uint32_t timeout); +int at_expect_match(char *str_ok, char *str_err, char **buf, regmatch_t match[], size_t match_size, int flags, uint32_t timeout); diff --git a/fw/esp32/components/eos/include/cell.h b/fw/esp32/components/eos/include/cell.h index abba977..65b4b1a 100644 --- a/fw/esp32/components/eos/include/cell.h +++ b/fw/esp32/components/eos/include/cell.h @@ -27,6 +27,11 @@ #define EOS_CELL_MTYPE_VOICE_END 6 #define EOS_CELL_MTYPE_VOICE_MISSED 7 +#define EOS_CELL_MTYPE_SMS_LIST 1 +#define EOS_CELL_MTYPE_SMS_SEND 2 +#define EOS_CELL_MTYPE_SMS_MSG_NEW 3 +#define EOS_CELL_MTYPE_SMS_MSG_ITEM 4 + #define EOS_CELL_MTYPE_USSD_REQUEST 1 #define EOS_CELL_MTYPE_USSD_REPLY 2 @@ -34,6 +39,10 @@ #define EOS_CELL_MTYPE_DATA_CONNECT 2 #define EOS_CELL_MTYPE_DATA_DISCONNECT 3 +#define EOS_CELL_SMS_ADDRTYPE_INTL 1 +#define EOS_CELL_SMS_ADDRTYPE_ALPHA 2 +#define EOS_CELL_SMS_ADDRTYPE_OTHER 3 + #define EOS_CELL_UART_MODE_NONE 0 #define EOS_CELL_UART_MODE_ATCMD 1 #define EOS_CELL_UART_MODE_PPP 2 diff --git a/fw/esp32/components/eos/include/gsm.h b/fw/esp32/components/eos/include/gsm.h index 2c4f7b4..8f7b75f 100644 --- a/fw/esp32/components/eos/include/gsm.h +++ b/fw/esp32/components/eos/include/gsm.h @@ -1,5 +1,12 @@ #define GSM_OK 0 #define GSM_ERR -1 +#define GSM_ERR_SIZE -10 + +#define GSM_TS_SIZE 25 +#define GSM_UD_SIZE 160 +#define GSM_UDH_SIZE 140 +#define GSM_MSG_SIZE GSM_UD_SIZE +#define GSM_ADDR_SIZE 20 /* Message-Type-Indicator */ #define GSM_MTI 0x03 @@ -113,5 +120,16 @@ #define GSM_FLAG_MWI_OTHER 0x3000 #define GSM_FLAG_MWI_MASK 0xf000 +uint8_t pdu_getc(char *pdu); +void pdu_putc(uint8_t ch, char *pdu); +void pdu_gets(char *pdu, uint8_t *s, int s_len); +void pdu_puts(uint8_t *s, int s_len, char *pdu); +int gsm_ucs2_to_7bit(uint16_t ucs2, char *gsm7, int gsm7_size); +int gsm_7bit_to_ucs2(char *gsm7, int gsm7_len, uint16_t *ucs2); + int gsm_7bit_enc(char *text, int text_len, char *pdu, int padb); int gsm_7bit_dec(char *pdu, char *text, int text_len, int padb); +int gsm_addr_enc(char *addr, int addr_len, uint8_t addr_type, char *pdu, int pdu_size); +int gsm_addr_dec(char *pdu, int pdu_len, char *addr, int *addr_len, uint8_t *addr_type); +int gsm_sms_enc(uint8_t pid, char *addr, int addr_len, uint8_t addr_type, uint8_t *udh, int udh_len, uint8_t *msg, int msg_len, uint8_t enc, uint16_t flags, char *pdu, int pdu_size); +int gsm_sms_dec(char *pdu, int pdu_len, uint8_t *pid, char *addr, int *addr_len, uint8_t *addr_type, uint8_t *udh, int *udh_len, uint8_t *msg, int *msg_len, char *ts, uint8_t *enc, uint16_t *flags); |