#ifndef WIFI_H #define WIFI_H #include "config.h" #define WIFI_COMMAND_READ_CONFIG 0x40 #define WIFI_COMMAND_WRITE 0x80 #define WIFI_COMMAND_READ 0x00 #define WIFI_MSK_TRANSMIT_BUFFER 0x80 #define WIFI_MSK_RECEIVE_BUFFER 0x40 #define wifi_select() (P2_bit.P2_0 = 0) #define wifi_deselect() (P2_bit.P2_0 = 1) #define wifi_data_ready() (P2_bit.P2_1) void wifi_init(void); Byte wifi_receive_buffer_full(void); Byte wifi_data_available(void); Byte wifi_read_configuration(void); Byte wifi_authenticate(); Byte wifi_connect(Byte* address_a, Byte* port_a); Byte wifi_disconnect(); Byte wifi_send_data(Byte* data_a, Byte length_a); Byte wifi_send_string_code(const char __code* string_a); Byte wifi_send_data_code(const char __code* data_a, Byte length_a); Byte wifi_send_string(Byte* string_a); Byte wifi_recv_ok(); void wifi_empty_buffer(); void wifi_recv_force(Byte* buff_a, Byte length_a); Byte wifi_recv(Byte* buff_a, Byte length_a); /* returns number of bytes actually read */ Int16 wifi_recv_xdata(Byte __xdata * buff_a, Int16 length_a); Byte wifi_recv_byte(); __code const static char WIFI_AUTH_STRING [] = "auth dpac dpac\r"; __code const static char WIFI_ESC_LAN_OFF_STRING [] = "esc-mode-lan off\r"; __code const static char WIFI_ESC_LAN_ON_STRING [] = "esc-mode-lan on\r"; __code const static char WIFI_ESC_SER_OFF_STRING [] = "esc-mode-serial off\r"; __code const static char WIFI_ESC_SER_ON_STRING [] = "esc-mode-serial on\r"; __code const static char WIFI_TIMEOUT_STRING [] = "wl-tcp-timeout 50\r"; __code const static char WIFI_PASS_STRING [] = "pass\r"; __code const static char WIFI_GET_STRING [] = "GET /\r\n\r\n"; __code const static char WIFI_ESC_STRING [] = "~~~ds\r"; __code const static char WIFI_CLOSE_STRING [] = "close\r"; #pragma location=0xF618 __code const static char WIFI_IP1_STRING [] = "wl-tcp-ip 66.250.45.52\r"; // 32 kbps #pragma location=0xF64A __code const static char WIFI_PORT1_STRING [] = "wl-tcp-port 8500\r"; #pragma location=0xF67C __code const static char WIFI_IP2_STRING [] = "wl-tcp-ip 213.251.139.88\r"; // 48 kbps #pragma location=0xF6AE __code const static char WIFI_PORT2_STRING [] = "wl-tcp-port 9000\r"; #pragma location=0xF6E0 __code const static char WIFI_IP3_STRING [] = "wl-tcp-ip 207.210.88.138\r"; // 96 kbps #pragma location=0xF712 __code const static char WIFI_PORT3_STRING [] = "wl-tcp-port 5112\r"; #pragma location=0xF744 __code const static char WIFI_IP4_STRING [] = "wl-tcp-ip 213.251.141.132\r"; // 128 kbps #pragma location=0xF776 __code const static char WIFI_PORT4_STRING [] = "wl-tcp-port 80\r"; #pragma location=0xF7A8 __code const static char WIFI_IP5_STRING [] = "wl-tcp-ip 69.28.128.148\r"; // 64 kbps #pragma location=0xF7DA __code const static char WIFI_PORT5_STRING [] = "wl-tcp-port 80\r"; #pragma location=0xF80C __code const static char WIFI_IP6_STRING [] = "wl-tcp-ip 66.250.45.52\r"; #pragma location=0xF83E __code const static char WIFI_PORT6_STRING [] = "wl-tcp-port 8500\r"; #pragma location=0xF870 __code const static char WIFI_IP7_STRING [] = "wl-tcp-ip 66.250.45.52\r"; #pragma location=0xF8A2 __code const static char WIFI_PORT7_STRING [] = "wl-tcp-port 8500\r"; #pragma location=0xF8D4 __code const static char WIFI_IP8_STRING [] = "wl-tcp-ip 66.250.45.52\r"; #pragma location=0xF906 __code const static char WIFI_PORT8_STRING [] = "wl-tcp-port 8500\r"; #pragma location=0xF938 __code const static char WIFI_IP9_STRING [] = "wl-tcp-ip 66.250.45.52\r"; #pragma location=0xF96A __code const static char WIFI_PORT9_STRING [] = "wl-tcp-port 8500\r"; #pragma location=0xF99C __code const static char WIFI_IP10_STRING [] = "wl-tcp-ip 66.250.45.52\r"; #pragma location=0xF9CE __code const static char WIFI_PORT10_STRING [] = "wl-tcp-port 8500\r"; /* #pragma location=0xF618 __code const static char WIFI_IP1_STRING [] = "wl-tcp-ip \0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"; // 32 kbps #pragma location=0xF64A __code const static char WIFI_PORT1_STRING [] = "wl-tcp-port \0\0\0\0\0\0\0\0"; #pragma location=0xF67C __code const static char WIFI_IP2_STRING [] = "wl-tcp-ip \0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"; // 48 kbps #pragma location=0xF6AE __code const static char WIFI_PORT2_STRING [] = "wl-tcp-port \0\0\0\0\0\0\0\0"; #pragma location=0xF6E0 __code const static char WIFI_IP3_STRING [] = "wl-tcp-ip \0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"; // 96 kbps #pragma location=0xF712 __code const static char WIFI_PORT3_STRING [] = "wl-tcp-port \0\0\0\0\0\0\0\0"; #pragma location=0xF744 __code const static char WIFI_IP4_STRING [] = "wl-tcp-ip \0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"; // 128 kbps #pragma location=0xF776 __code const static char WIFI_PORT4_STRING [] = "wl-tcp-port \0\0\0\0\0\0\0\0"; #pragma location=0xF7A8 __code const static char WIFI_IP5_STRING [] = "wl-tcp-ip \0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"; // 64 kbps #pragma location=0xF7DA __code const static char WIFI_PORT5_STRING [] = "wl-tcp-port \0\0\0\0\0\0\0\0"; #pragma location=0xF80C __code const static char WIFI_IP6_STRING [] = "wl-tcp-ip \0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"; #pragma location=0xF83E __code const static char WIFI_PORT6_STRING [] = "wl-tcp-port \0\0\0\0\0\0\0\0"; #pragma location=0xF870 __code const static char WIFI_IP7_STRING [] = "wl-tcp-ip \0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"; #pragma location=0xF8A2 __code const static char WIFI_PORT7_STRING [] = "wl-tcp-port \0\0\0\0\0\0\0\0"; #pragma location=0xF8D4 __code const static char WIFI_IP8_STRING [] = "wl-tcp-ip \0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"; #pragma location=0xF906 __code const static char WIFI_PORT8_STRING [] = "wl-tcp-port \0\0\0\0\0\0\0\0"; #pragma location=0xF938 __code const static char WIFI_IP9_STRING [] = "wl-tcp-ip \0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"; #pragma location=0xF96A __code const static char WIFI_PORT9_STRING [] = "wl-tcp-port \0\0\0\0\0\0\0\0"; #pragma location=0xF99C __code const static char WIFI_IP10_STRING [] = "wl-tcp-ip \0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"; #pragma location=0xF9CE __code const static char WIFI_PORT10_STRING [] = "wl-tcp-port \0\0\0\0\0\0\0\0"; */ #endif