diff options
Diffstat (limited to 'fw/esp32/components/eos/include')
-rw-r--r-- | fw/esp32/components/eos/include/cell.h | 41 | ||||
-rw-r--r-- | fw/esp32/components/eos/include/net.h | 2 | ||||
-rw-r--r-- | fw/esp32/components/eos/include/power.h | 8 | ||||
-rw-r--r-- | fw/esp32/components/eos/include/wifi.h | 21 |
4 files changed, 53 insertions, 19 deletions
diff --git a/fw/esp32/components/eos/include/cell.h b/fw/esp32/components/eos/include/cell.h index 2cbba7e..269615d 100644 --- a/fw/esp32/components/eos/include/cell.h +++ b/fw/esp32/components/eos/include/cell.h @@ -12,7 +12,7 @@ #define EOS_CELL_MAX_MTYPE 8 /* EOS_CELL_MTYPE_DEV subtypes */ -#define EOS_CELL_MTYPE_READY 1 +#define EOS_CELL_MTYPE_STATUS 1 #define EOS_CELL_MTYPE_UART_DATA 2 #define EOS_CELL_MTYPE_UART_TAKE 3 #define EOS_CELL_MTYPE_UART_GIVE 4 @@ -38,43 +38,64 @@ #define EOS_CELL_MTYPE_USSD_REPLY 2 #define EOS_CELL_MTYPE_USSD_CANCEL 3 -#define EOS_CELL_MTYPE_PDP_CONFIG 1 -#define EOS_CELL_MTYPE_PDP_CONNECT 2 -#define EOS_CELL_MTYPE_PDP_DISCONNECT 3 +#define EOS_CELL_MTYPE_PDP_GET_APN 1 +#define EOS_CELL_MTYPE_PDP_GET_USR 2 +#define EOS_CELL_MTYPE_PDP_GET_PWD 3 +#define EOS_CELL_MTYPE_PDP_SET_APN 4 +#define EOS_CELL_MTYPE_PDP_SET_USR 5 +#define EOS_CELL_MTYPE_PDP_SET_PWD 6 +#define EOS_CELL_MTYPE_PDP_CONNECT 7 +#define EOS_CELL_MTYPE_PDP_DISCONNECT 8 + +#define EOS_CELL_STATUS_RESET 0 +#define EOS_CELL_STATUS_IDLE 1 +#define EOS_CELL_STATUS_RELAY 2 +#define EOS_CELL_STATUS_PPP 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_PDP_SIZE_APN 64 +#define EOS_CELL_PDP_SIZE_USR 64 +#define EOS_CELL_PDP_SIZE_PWD 64 +#define EOS_CELL_PDP_SIZE_ARG 64 + #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 1024 +#define EOS_CELL_MAX_USSD_STR 128 +#define EOS_CELL_MAX_DIAL_STR 128 -#define EOS_CELL_MAX_USSD_STR 256 -#define EOS_CELL_MAX_DIAL_STR 256 +#define EOS_CELL_UART_SIZE_BUF 1024 void eos_cell_init(void); void eos_modem_init(void); +int eos_modem_atinit(void); void eos_modem_flush(void); size_t eos_modem_write(void *data, size_t size); size_t eos_modem_read(void *data, size_t size, uint32_t timeout); int eos_modem_readln(char *buf, size_t buf_size, uint32_t timeout); int eos_modem_resp(char *ok_str, char *err_str, uint32_t timeout); uint8_t eos_modem_get_mode(void); +size_t eos_modem_get_status(unsigned char *buffer); int eos_modem_set_mode(uint8_t mode); int eos_modem_take(uint32_t timeout); void eos_modem_give(void); -void eos_modem_sleep(uint8_t mode); +void eos_modem_sleep(void); +void eos_modem_deep_sleep(void); void eos_modem_wake(uint8_t source, uint8_t mode); int eos_modem_reset(void); +void eos_ppp_get_apn(char *apn); void eos_ppp_set_apn(char *apn); -void eos_ppp_set_auth(char *user, char *pass); +void eos_ppp_get_usr(char *usr); +void eos_ppp_set_usr(char *usr); +void eos_ppp_get_pwd(char *pwd); +void eos_ppp_set_pwd(char *pwd); int eos_ppp_connect(void); void eos_ppp_disconnect(void); diff --git a/fw/esp32/components/eos/include/net.h b/fw/esp32/components/eos/include/net.h index 5bccc57..3e9e625 100644 --- a/fw/esp32/components/eos/include/net.h +++ b/fw/esp32/components/eos/include/net.h @@ -32,5 +32,5 @@ void eos_net_free(unsigned char *buf); int eos_net_send(unsigned char mtype, unsigned char *buffer, uint16_t len); void eos_net_reply(unsigned char mtype, unsigned char *buffer, uint16_t len); void eos_net_set_handler(unsigned char mtype, eos_net_fptr_t handler); -void eos_net_sleep_done(uint8_t mode); +void eos_net_sleep(void); void eos_net_wake(uint8_t source, uint8_t mode); diff --git a/fw/esp32/components/eos/include/power.h b/fw/esp32/components/eos/include/power.h index 3d2e0bc..2215907 100644 --- a/fw/esp32/components/eos/include/power.h +++ b/fw/esp32/components/eos/include/power.h @@ -4,9 +4,10 @@ #define EOS_PWR_WAKE_RST 0 #define EOS_PWR_WAKE_BTN 1 -#define EOS_PWR_WAKE_NET 2 -#define EOS_PWR_WAKE_MSG 3 -#define EOS_PWR_WAKE_UART 4 +#define EOS_PWR_WAKE_UART 2 +#define EOS_PWR_WAKE_NET 3 +#define EOS_PWR_WAKE_NETQ 4 +#define EOS_PWR_WAKE_UNDEF 5 #define EOS_PWR_SMODE_LIGHT 1 #define EOS_PWR_SMODE_DEEP 2 @@ -14,6 +15,7 @@ void eos_power_init(void); void eos_power_wait4init(void); +void eos_power_wait4wake(void); uint8_t eos_power_wakeup_cause(void); void eos_power_sleep(void); void eos_power_wake(uint8_t source); diff --git a/fw/esp32/components/eos/include/wifi.h b/fw/esp32/components/eos/include/wifi.h index 5a668fb..c1819e7 100644 --- a/fw/esp32/components/eos/include/wifi.h +++ b/fw/esp32/components/eos/include/wifi.h @@ -1,9 +1,16 @@ -#define EOS_WIFI_MTYPE_SCAN 1 -#define EOS_WIFI_MTYPE_AUTH 2 -#define EOS_WIFI_MTYPE_CONNECT 3 -#define EOS_WIFI_MTYPE_DISCONNECT 4 +#define EOS_WIFI_MTYPE_STATUS 0 +#define EOS_WIFI_MTYPE_SCAN 1 +#define EOS_WIFI_MTYPE_START 2 +#define EOS_WIFI_MTYPE_STOP 3 +#define EOS_WIFI_MTYPE_CONNECT 4 +#define EOS_WIFI_MTYPE_DISCONNECT 5 -#define EOS_WIFI_MAX_MTYPE 5 +#define EOS_WIFI_STATUS_OFF 0 +#define EOS_WIFI_STATUS_DISCONNECTED 1 +#define EOS_WIFI_STATUS_CONNECTED 2 +#define EOS_WIFI_STATUS_GOT_IP 3 + +#define EOS_WIFI_MAX_SCAN_RECORDS 20 void eos_wifi_init(void); @@ -11,3 +18,7 @@ int eos_wifi_scan(void); int eos_wifi_auth(char *ssid, char *pass); int eos_wifi_connect(void); int eos_wifi_disconnect(void); + +ssize_t eos_wifi_get_status(unsigned char *buffer); +void eos_wifi_send_status(void); +void eos_wifi_send_scan(void);
\ No newline at end of file |