diff options
Diffstat (limited to 'fw/esp32/components/eos/include/cell.h')
-rw-r--r-- | fw/esp32/components/eos/include/cell.h | 66 |
1 files changed, 38 insertions, 28 deletions
diff --git a/fw/esp32/components/eos/include/cell.h b/fw/esp32/components/eos/include/cell.h index 3bf6b32..abba977 100644 --- a/fw/esp32/components/eos/include/cell.h +++ b/fw/esp32/components/eos/include/cell.h @@ -1,38 +1,44 @@ #include <sys/types.h> #include <stdint.h> -#define EOS_CELL_MTYPE_DEV 0x00 -#define EOS_CELL_MTYPE_VOICE 0x10 -#define EOS_CELL_MTYPE_SMS 0x20 -#define EOS_CELL_MTYPE_CBS 0x30 -#define EOS_CELL_MTYPE_USSD 0x40 -#define EOS_CELL_MTYPE_DATA 0x70 +#define EOS_CELL_MTYPE_DEV 0x00 +#define EOS_CELL_MTYPE_VOICE 0x10 +#define EOS_CELL_MTYPE_SMS 0x20 +#define EOS_CELL_MTYPE_CBS 0x30 +#define EOS_CELL_MTYPE_USSD 0x40 +#define EOS_CELL_MTYPE_DATA 0x70 -#define EOS_CELL_MTYPE_MASK 0xf0 -#define EOS_CELL_MAX_MTYPE 8 +#define EOS_CELL_MTYPE_MASK 0xf0 +#define EOS_CELL_MAX_MTYPE 8 -#define EOS_CELL_MTYPE_READY 0 -#define EOS_CELL_MTYPE_UART_DATA 1 -#define EOS_CELL_MTYPE_UART_TAKE 2 -#define EOS_CELL_MTYPE_UART_GIVE 3 -#define EOS_CELL_MTYPE_PCM_DATA 4 -#define EOS_CELL_MTYPE_PCM_START 5 -#define EOS_CELL_MTYPE_PCM_STOP 6 +#define EOS_CELL_MTYPE_READY 0 +#define EOS_CELL_MTYPE_UART_DATA 1 +#define EOS_CELL_MTYPE_UART_TAKE 2 +#define EOS_CELL_MTYPE_UART_GIVE 3 +#define EOS_CELL_MTYPE_PCM_DATA 4 +#define EOS_CELL_MTYPE_PCM_START 5 +#define EOS_CELL_MTYPE_PCM_STOP 6 -#define EOS_CELL_MTYPE_VOICE_DIAL 1 -#define EOS_CELL_MTYPE_VOICE_RING 2 -#define EOS_CELL_MTYPE_VOICE_ANSWER 3 -#define EOS_CELL_MTYPE_VOICE_HANGUP 4 -#define EOS_CELL_MTYPE_VOICE_BEGIN 5 -#define EOS_CELL_MTYPE_VOICE_END 6 +#define EOS_CELL_MTYPE_VOICE_DIAL 1 +#define EOS_CELL_MTYPE_VOICE_RING 2 +#define EOS_CELL_MTYPE_VOICE_ANSWER 3 +#define EOS_CELL_MTYPE_VOICE_HANGUP 4 +#define EOS_CELL_MTYPE_VOICE_BEGIN 5 +#define EOS_CELL_MTYPE_VOICE_END 6 +#define EOS_CELL_MTYPE_VOICE_MISSED 7 -#define EOS_CELL_MTYPE_USSD_REQUEST 1 -#define EOS_CELL_MTYPE_USSD_REPLY 2 +#define EOS_CELL_MTYPE_USSD_REQUEST 1 +#define EOS_CELL_MTYPE_USSD_REPLY 2 -#define EOS_CELL_UART_MODE_NONE 0 -#define EOS_CELL_UART_MODE_ATCMD 1 -#define EOS_CELL_UART_MODE_PPP 2 -#define EOS_CELL_UART_MODE_RELAY 3 +#define EOS_CELL_MTYPE_DATA_CONFIGURE 1 +#define EOS_CELL_MTYPE_DATA_CONNECT 2 +#define EOS_CELL_MTYPE_DATA_DISCONNECT 3 + +#define EOS_CELL_UART_MODE_NONE 0 +#define EOS_CELL_UART_MODE_ATCMD 1 +#define EOS_CELL_UART_MODE_PPP 2 +#define EOS_CELL_UART_MODE_RELAY 3 +#define EOS_CELL_UART_MODE_UNDEF 0xff #define EOS_CELL_UART_SIZE_BUF 128 @@ -54,7 +60,7 @@ void eos_modem_wake(uint8_t source, uint8_t mode); void eos_ppp_set_apn(char *apn); void eos_ppp_set_auth(char *user, char *pass); int eos_ppp_connect(void); -int eos_ppp_disconnect(void); +void eos_ppp_disconnect(void); void eos_cell_pcm_init(void); ssize_t eos_cell_pcm_read(unsigned char *data, size_t size); @@ -66,3 +72,7 @@ void eos_cell_voice_handler(unsigned char mtype, unsigned char *buffer, uint16_t void eos_cell_sms_handler(unsigned char mtype, unsigned char *buffer, uint16_t size); void eos_cell_ussd_handler(unsigned char mtype, unsigned char *buffer, uint16_t size); void eos_cell_data_handler(unsigned char mtype, unsigned char *buffer, uint16_t size); + +void eos_cell_voice_init(void); +void eos_cell_sms_init(void); +void eos_cell_ussd_init(void); |