diff options
Diffstat (limited to 'fw/fe310/eos')
-rw-r--r-- | fw/fe310/eos/cell.h | 34 | ||||
-rw-r--r-- | fw/fe310/eos/wifi.c | 25 | ||||
-rw-r--r-- | fw/fe310/eos/wifi.h | 11 |
3 files changed, 20 insertions, 50 deletions
diff --git a/fw/fe310/eos/cell.h b/fw/fe310/eos/cell.h index 90bb349..0fc2052 100644 --- a/fw/fe310/eos/cell.h +++ b/fw/fe310/eos/cell.h @@ -6,7 +6,7 @@ #define EOS_CELL_MTYPE_SMS 0x30 #define EOS_CELL_MTYPE_CBS 0x40 #define EOS_CELL_MTYPE_USSD 0x50 -#define EOS_CELL_MTYPE_DATA 0x70 +#define EOS_CELL_MTYPE_PDP 0x60 #define EOS_CELL_MTYPE_MASK 0xf0 #define EOS_CELL_MAX_MTYPE 8 @@ -16,20 +16,18 @@ #define EOS_CELL_MTYPE_UART_DATA 2 #define EOS_CELL_MTYPE_UART_TAKE 3 #define EOS_CELL_MTYPE_UART_GIVE 4 -#define EOS_CELL_MTYPE_PCM_DATA 5 -#define EOS_CELL_MTYPE_PCM_START 6 -#define EOS_CELL_MTYPE_PCM_STOP 7 -#define EOS_CELL_MTYPE_RESET 8 - -#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_MISS 7 -#define EOS_CELL_MTYPE_VOICE_BUSY 8 -#define EOS_CELL_MTYPE_VOICE_ERR 9 +#define EOS_CELL_MTYPE_RESET 5 + +#define EOS_CELL_MTYPE_VOICE_PCM 1 +#define EOS_CELL_MTYPE_VOICE_DIAL 2 +#define EOS_CELL_MTYPE_VOICE_RING 3 +#define EOS_CELL_MTYPE_VOICE_ANSWER 4 +#define EOS_CELL_MTYPE_VOICE_HANGUP 5 +#define EOS_CELL_MTYPE_VOICE_BEGIN 6 +#define EOS_CELL_MTYPE_VOICE_END 7 +#define EOS_CELL_MTYPE_VOICE_MISS 8 +#define EOS_CELL_MTYPE_VOICE_BUSY 9 +#define EOS_CELL_MTYPE_VOICE_ERR 10 #define EOS_CELL_MTYPE_SMS_LIST 1 #define EOS_CELL_MTYPE_SMS_SEND 2 @@ -40,9 +38,9 @@ #define EOS_CELL_MTYPE_USSD_REPLY 2 #define EOS_CELL_MTYPE_USSD_CANCEL 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_MTYPE_PDP_CONFIG 1 +#define EOS_CELL_MTYPE_PDP_CONNECT 2 +#define EOS_CELL_MTYPE_PDP_DISCONNECT 3 #define EOS_CELL_SMS_ADDRTYPE_INTL 1 #define EOS_CELL_SMS_ADDRTYPE_ALPHA 2 diff --git a/fw/fe310/eos/wifi.c b/fw/fe310/eos/wifi.c index c3449e8..ca29a95 100644 --- a/fw/fe310/eos/wifi.c +++ b/fw/fe310/eos/wifi.c @@ -43,28 +43,3 @@ eos_evt_handler_t eos_wifi_get_handler(unsigned char mtype) { if (mtype < EOS_WIFI_MAX_MTYPE) return evt_handler[mtype]; return NULL; } - -void eos_wifi_scan(void) { - unsigned char *buffer = eos_net_alloc(); - buffer[0] = EOS_WIFI_MTYPE_SCAN; - eos_net_send(EOS_NET_MTYPE_WIFI, buffer, 1, 0); -} - -void eos_wifi_connect(const char *ssid, const char *pass) { - int ssid_len = strlen(ssid); - int pass_len = strlen(pass); - unsigned char *buffer = eos_net_alloc(); - - buffer[0] = EOS_WIFI_MTYPE_CONNECT; - strcpy(buffer+1, ssid); - buffer[ssid_len+1] = 0; - strcpy(buffer+ssid_len+2, pass); - buffer[ssid_len+pass_len+2] = 0; - eos_net_send(EOS_NET_MTYPE_WIFI, buffer, ssid_len+pass_len+3, 0); -} - -void eos_wifi_disconnect(void) { - unsigned char *buffer = eos_net_alloc(); - buffer[0] = EOS_WIFI_MTYPE_DISCONNECT; - eos_net_send(EOS_NET_MTYPE_WIFI, buffer, 1, 0); -} diff --git a/fw/fe310/eos/wifi.h b/fw/fe310/eos/wifi.h index 57048af..bb629ed 100644 --- a/fw/fe310/eos/wifi.h +++ b/fw/fe310/eos/wifi.h @@ -2,15 +2,12 @@ #include "event.h" #define EOS_WIFI_MTYPE_SCAN 1 -#define EOS_WIFI_MTYPE_CONNECT 2 -#define EOS_WIFI_MTYPE_DISCONNECT 3 +#define EOS_WIFI_MTYPE_CONFIG 2 +#define EOS_WIFI_MTYPE_CONNECT 3 +#define EOS_WIFI_MTYPE_DISCONNECT 4 -#define EOS_WIFI_MAX_MTYPE 4 +#define EOS_WIFI_MAX_MTYPE 5 void eos_wifi_init(void); void eos_wifi_set_handler(unsigned char mtype, eos_evt_handler_t handler); eos_evt_handler_t eos_wifi_get_handler(unsigned char mtype); - -void eos_wifi_scan(void); -void eos_wifi_connect(const char *ssid, const char *pass); -void eos_wifi_disconnect(void); |