Wifly Driver
V1.0
|
#include "LPC17xx.h"
#include <stdio.h>
#include <string.h>
#include <stdarg.h>
#include <stdlib.h>
#include "Type.h"
#include "PrintF.h"
#include "WiFly.h"
#include "Config.h"
#include "FreeRTOS.h"
#include "semphr.h"
Go to the source code of this file.
Macros | |
#define | SET_IP_ADDRESS "set ip address %s\r\n" |
#define | SET_IP_BACKUP "set ip backup %s\r\n" |
#define | SET_IP_DHCP "set ip dhcp %d\r\n" |
#define | SET_IP_FLAGS "set ip flags %x\r\n" |
#define | SET_IP_GATEWAY "set ip gateway %s\r\n" |
#define | SET_IP_HOST "set ip host %s\r\n" |
#define | SET_IP_LOCAL_PORT "set ip localport %d\r\n" |
#define | SET_IP_NET "set ip net %s\r\n" |
#define | SET_IP_NETMASK "set ip netmask %s\r\n" |
#define | SET_IP_PROTO "set ip proto %d\r\n" |
#define | SET_IP_REMOTE "set ip remote %d\r\n" |
#define | SET_IP_TCP_MODE "set ip tcp-mode %x\r\n" |
#define | SET_COM_REM "set com remote %s\r\n" |
#define | SET_OP_FORMAT "set option format %d\r\n" |
#define | SET_UART_MD "set uart mode %x \r\n" |
#define | SET_UART_BAUD "set uart baud %d \r\n" |
#define | SET_UART_INST "set uart instant %d \r\n" |
#define | SET_WLAN_TX "set wlan tx %d \r\n" |
#define | SET_WLAN_AUTH "set wlan auth %d\r\n" |
#define | SET_WLAN_KEY "set wlan key %d\r\n" |
#define | SET_WLAN_PHRASE "set wlan phrase %s\r\n" |
#define | SET_WLAN_SSID "set wlan ssid %s\r\n" |
#define | SET_WLAN_JOIN "set wlan join %d\r\n" |
#define | SET_WLAN_CHAN "set wlan chan %d\r\n" |
#define | SET_DNS_NAME "set dns name %s\r\n" |
#define | GET_ADHOC "get adhoc\r\n" |
#define | GET_MAC "get mac\r\n" |
#define | GET_IP "get ip a\r\n" |
#define | GET_WLAN "get wlan\r\n" |
#define | GET_VER "ver\r\n" |
#define | SHOW_RSSI "show rssi\r\n" |
#define | SHOW_TIME "show time\r\n" |
#define | SHOW_CONNECTION "show connection\r\n" |
#define | AP_MODE "apmode %s %d" |
#define | CHG_CMD "$$$" |
#define | CHG_DT "exit\r\n" |
#define | FACTORYRESET "factory RESTORE\r\n" |
#define | CLOSE "close\r\n" |
#define | JOIN "join %s\r\n" |
#define | LEAVE "leave\r\n" |
#define | PING "ping %s\r\n" |
#define | OPEN_CONN "open %s %d\r\n" |
#define | REBOOT "reboot\r\n" |
#define | FACTORY_RESET "factory RESET\r\n" |
#define | SLEEP "sleep\r\n" |
#define | SAVE "save\r\n" |
Functions | |
uint8_t | Wifly_start (uint32_t PortNum, uint32_t baudrate) |
uint8_t | Wifly_logStart (uint32_t PortNum, uint32_t baudrate, uint32_t logSeverity) |
uint8_t | Wifly_ChangeBaudRate (uint32_t baudrate) |
void | Wifly_reset (uint8_t typeReset) |
uint8_t | Wifly_save () |
uint8_t | Wifly_factoryReset () |
uint8_t | Wifly_sleep () |
uint8_t | Wifly_WLANConnect (uint32_t AuthMode, char *ssid, char *passw) |
uint8_t | Wifly_WLANConnectPing (uint32_t AuthMode, char *ssid, char *passw, char *pingIP) |
uint8_t | Wifly_leave () |
uint8_t | Wifly_WLANConfigConnect (uint32_t AuthMode, char *ssid, char *passw) |
uint8_t | Wifly_ping (char *ip) |
uint8_t | Wifly_open (char *dnsAddress, uint32_t port) |
uint8_t | Wifly_close () |
uint8_t | Wifly_setIpAddress (char *address) |
uint8_t | Wifly_setIpDHCP (uint8_t mode) |
uint8_t | Wifly_setIpNET (char *address) |
uint8_t | Wifly_setIpFlags (uint32_t mask) |
uint8_t | Wifly_setIpGateway (char *address) |
uint8_t | Wifly_setIpHost (char *address) |
uint8_t | Wifly_setIpLocalPort (uint32_t value) |
uint8_t | Wifly_setIpnetmask (char *address) |
uint8_t | Wifly_setIpProtocol (uint32_t value) |
uint8_t | Wifly_setIpRemote (uint32_t value) |
uint8_t | Wifly_setIpTcpMode (uint32_t value) |
uint8_t | Wifly_setComRemote (char *value) |
uint8_t | Wifly_setOptionFormat (uint32_t value) |
uint8_t | Wifly_setUartMode (uint32_t value) |
uint8_t | Wifly_setUartInstant (uint32_t value) |
uint8_t | Wifly_setUartBaud (uint32_t value) |
uint8_t | Wifly_setWlanTX (uint32_t tx) |
uint8_t | Wifly_setWlanAuth (uint32_t value) |
uint8_t | Wifly_setWlanChannel (uint8_t value) |
uint8_t | Wifly_setWlanJoin (uint32_t value) |
uint8_t | Wifly_setWlanKey (char *value) |
uint8_t | Wifly_setWlanPhrase (char *password) |
uint8_t | Wifly_setWlanSSID (char *value) |
uint8_t | Wifly_setDNSName (char *name) |
char * | Wifly_getIp () |
uint8_t | Wifly_getChannel () |
uint8_t | Wifly_getTx () |
int32_t | Wifly_getRSSI () |
uint32_t | Wifly_getTime () |
char * | Wifly_getMac () |
char * | Wifly_getWlan () |
double | Wifly_getVer () |
uint32_t | Wifly_showConnection () |
char * | Wifly_HTTPReceive (char *dnsAddress, char *getCommand, uint32_t port, uint8_t proto) |
uint8_t | Wifly_HTTPSend (char *dnsAddress, char *getCommand, uint32_t port, uint8_t proto) |
uint8_t | Wifly_HTTPConfig (char *dnsAddress, char *getCommand, uint32_t port, uint8_t proto) |
char * | Wifly_UDPReceive (char *address, uint32_t localPort, uint32_t remotePort, const char *restrict command,...) |
uint8_t | Wifly_UDPSend (char *address, uint32_t localPort, uint32_t remotePort, char *exResp, const char *restrict command,...) |
uint8_t | Wifly_UDPConfig (char *address, uint32_t localPort, uint32_t remotePort) |
char * | Wifly_TCPReceive (char *address, uint32_t remotePort, const char *restrict command,...) |
uint8_t | Wifly_TCPSend (char *address, uint32_t remotePort, char *exResp, const char *restrict command,...) |
void | Wifly_TCPTimeOpen (uint32_t time, char *address, uint32_t remotePort, char *exResp, const char *restrict command,...) |
void | Wifly_TCPTimeOpenDisc () |
uint8_t | Wifly_TCPConfig (char *address, uint32_t port) |
uint8_t | Wifly_APMode (char *ssid, uint8_t channel) |
uint8_t | Wifly_ConfigAPMode (char *ssid, uint8_t channel, char *ipAddress, char *subnetMask, char *gateway) |
Variables | |
xSemaphoreHandle | xMutexWifly |
#define AP_MODE "apmode %s %d" |
Definition at line 70 of file WiFly.c.
Referenced by Wifly_APMode().
#define CLOSE "close\r\n" |
Definition at line 74 of file WiFly.c.
Referenced by Wifly_close().
#define FACTORY_RESET "factory RESET\r\n" |
Definition at line 80 of file WiFly.c.
Referenced by Wifly_factoryReset().
#define GET_IP "get ip a\r\n" |
Definition at line 59 of file WiFly.c.
Referenced by Wifly_getIp().
#define GET_MAC "get mac\r\n" |
Definition at line 58 of file WiFly.c.
Referenced by Wifly_getMac().
#define GET_VER "ver\r\n" |
Definition at line 61 of file WiFly.c.
Referenced by Wifly_getVer().
#define GET_WLAN "get wlan\r\n" |
Definition at line 60 of file WiFly.c.
Referenced by Wifly_getChannel(), Wifly_getTx(), and Wifly_getWlan().
#define JOIN "join %s\r\n" |
Definition at line 75 of file WiFly.c.
Referenced by Wifly_WLANConnect().
#define LEAVE "leave\r\n" |
Definition at line 76 of file WiFly.c.
Referenced by Wifly_leave().
#define OPEN_CONN "open %s %d\r\n" |
Definition at line 78 of file WiFly.c.
Referenced by Wifly_open().
#define PING "ping %s\r\n" |
Definition at line 77 of file WiFly.c.
Referenced by Wifly_ping().
#define REBOOT "reboot\r\n" |
Definition at line 79 of file WiFly.c.
Referenced by Wifly_reset().
#define SAVE "save\r\n" |
Definition at line 84 of file WiFly.c.
Referenced by Wifly_save().
#define SET_COM_REM "set com remote %s\r\n" |
Definition at line 39 of file WiFly.c.
Referenced by Wifly_setComRemote().
#define SET_DNS_NAME "set dns name %s\r\n" |
Definition at line 53 of file WiFly.c.
Referenced by Wifly_setDNSName().
#define SET_IP_ADDRESS "set ip address %s\r\n" |
Definition at line 26 of file WiFly.c.
Referenced by Wifly_setIpAddress().
#define SET_IP_DHCP "set ip dhcp %d\r\n" |
Definition at line 28 of file WiFly.c.
Referenced by Wifly_setIpDHCP().
#define SET_IP_FLAGS "set ip flags %x\r\n" |
Definition at line 29 of file WiFly.c.
Referenced by Wifly_setIpFlags().
#define SET_IP_GATEWAY "set ip gateway %s\r\n" |
Definition at line 30 of file WiFly.c.
Referenced by Wifly_setIpGateway().
#define SET_IP_HOST "set ip host %s\r\n" |
Definition at line 31 of file WiFly.c.
Referenced by Wifly_setIpHost().
#define SET_IP_LOCAL_PORT "set ip localport %d\r\n" |
Definition at line 32 of file WiFly.c.
Referenced by Wifly_setIpLocalPort().
#define SET_IP_NET "set ip net %s\r\n" |
Definition at line 33 of file WiFly.c.
Referenced by Wifly_setIpNET().
#define SET_IP_NETMASK "set ip netmask %s\r\n" |
Definition at line 34 of file WiFly.c.
Referenced by Wifly_setIpnetmask().
#define SET_IP_PROTO "set ip proto %d\r\n" |
Definition at line 35 of file WiFly.c.
Referenced by Wifly_setIpProtocol().
#define SET_IP_REMOTE "set ip remote %d\r\n" |
Definition at line 36 of file WiFly.c.
Referenced by Wifly_setIpRemote().
#define SET_IP_TCP_MODE "set ip tcp-mode %x\r\n" |
Definition at line 37 of file WiFly.c.
Referenced by Wifly_setIpTcpMode().
#define SET_OP_FORMAT "set option format %d\r\n" |
Definition at line 40 of file WiFly.c.
Referenced by Wifly_setOptionFormat().
#define SET_UART_BAUD "set uart baud %d \r\n" |
Definition at line 42 of file WiFly.c.
Referenced by Wifly_setUartBaud().
#define SET_UART_INST "set uart instant %d \r\n" |
Definition at line 43 of file WiFly.c.
Referenced by Wifly_setUartInstant().
#define SET_UART_MD "set uart mode %x \r\n" |
Definition at line 41 of file WiFly.c.
Referenced by Wifly_reset(), and Wifly_setUartMode().
#define SET_WLAN_AUTH "set wlan auth %d\r\n" |
Definition at line 47 of file WiFly.c.
Referenced by Wifly_setWlanAuth().
#define SET_WLAN_CHAN "set wlan chan %d\r\n" |
Definition at line 52 of file WiFly.c.
Referenced by Wifly_setWlanChannel().
#define SET_WLAN_JOIN "set wlan join %d\r\n" |
Definition at line 51 of file WiFly.c.
Referenced by Wifly_setWlanJoin().
#define SET_WLAN_KEY "set wlan key %d\r\n" |
Definition at line 48 of file WiFly.c.
Referenced by Wifly_setWlanKey().
#define SET_WLAN_PHRASE "set wlan phrase %s\r\n" |
Definition at line 49 of file WiFly.c.
Referenced by Wifly_setWlanPhrase().
#define SET_WLAN_SSID "set wlan ssid %s\r\n" |
Definition at line 50 of file WiFly.c.
Referenced by Wifly_setWlanSSID().
#define SET_WLAN_TX "set wlan tx %d \r\n" |
Definition at line 45 of file WiFly.c.
Referenced by Wifly_setWlanTX().
#define SHOW_CONNECTION "show connection\r\n" |
Definition at line 66 of file WiFly.c.
Referenced by Wifly_showConnection().
#define SHOW_RSSI "show rssi\r\n" |
Definition at line 64 of file WiFly.c.
Referenced by Wifly_getRSSI().
#define SHOW_TIME "show time\r\n" |
Definition at line 65 of file WiFly.c.
Referenced by Wifly_getTime().
#define SLEEP "sleep\r\n" |
Definition at line 81 of file WiFly.c.
Referenced by Wifly_sleep().
uint8_t Wifly_APMode | ( | char * | ssid, |
uint8_t | channel | ||
) |
uint8_t Wifly_ChangeBaudRate | ( | uint32_t | baudrate | ) |
Change the UART and wifly baud rate communication
baudrate | UART port baud rate. |
Definition at line 274 of file WiFly.c.
References FALSE, Log_log(), LV_ERR, LV_INFO, PrintF_delayMs(), PrintF_start(), RESET_SOFTWARE, TRUE, Wifly_reset(), Wifly_save(), and Wifly_setUartBaud().
uint8_t Wifly_close | ( | ) |
Close a TCP connection.
Definition at line 493 of file WiFly.c.
References CLOSE, CLOSE_CON, CMD_DELAY, FALSE, Log_log(), LV_INFO, and TRUE.
Referenced by Wifly_TCPReceive(), and Wifly_TCPSend().
uint8_t Wifly_ConfigAPMode | ( | char * | ssid, |
uint8_t | channel, | ||
char * | ipAddress, | ||
char * | subnetMask, | ||
char * | gateway | ||
) |
Sending the command settings necessary to AP mode.
ssid | SSID name. |
channel | Connection channel number. |
ipAddress | Local IP address |
subnetMask | Local IP subnet mask. |
gateway | Local gateway address. |
Definition at line 1144 of file WiFly.c.
References FALSE, Log_log(), LV_ERR, RESET_SOFTWARE, TRUE, Wifly_getVer(), Wifly_reset(), Wifly_save(), Wifly_setIpAddress(), Wifly_setIpDHCP(), Wifly_setIpGateway(), Wifly_setIpNET(), Wifly_setWlanChannel(), Wifly_setWlanJoin(), Wifly_setWlanSSID(), WLAN_APCON, and xMutexWifly.
uint8_t Wifly_factoryReset | ( | ) |
uint8_t Wifly_getChannel | ( | ) |
char* Wifly_getIp | ( | ) |
char* Wifly_getMac | ( | ) |
int32_t Wifly_getRSSI | ( | ) |
uint32_t Wifly_getTime | ( | ) |
uint8_t Wifly_getTx | ( | ) |
double Wifly_getVer | ( | ) |
char* Wifly_getWlan | ( | ) |
uint8_t Wifly_HTTPConfig | ( | char * | dnsAddress, |
char * | getCommand, | ||
uint32_t | port, | ||
uint8_t | proto | ||
) |
Sending the command settings necessary to HTTP connection.
dnsAddress | web page DNS address. |
getCommand | get command string format. |
port | Web server port connection. |
proto | Ip protocol configuration number. |
Definition at line 932 of file WiFly.c.
References FALSE, MODE_HTTP, TRUE, Wifly_setComRemote(), Wifly_setDNSName(), Wifly_setIpProtocol(), Wifly_setIpRemote(), and Wifly_setOptionFormat().
Referenced by Wifly_HTTPReceive(), and Wifly_HTTPSend().
char* Wifly_HTTPReceive | ( | char * | dnsAddress, |
char * | getCommand, | ||
uint32_t | port, | ||
uint8_t | proto | ||
) |
Send a HTTP command and receive the server response.
dnsAddress | web page DNS address. |
getCommand | get command string format. |
port | Web server port connection. |
proto | Ip protocol configuration number. |
Definition at line 891 of file WiFly.c.
References DATA_M, HTTP_HEAD, TRUE, Wifly_HTTPConfig(), Wifly_open(), and xMutexWifly.
Referenced by Arpalab_receiveValue().
uint8_t Wifly_HTTPSend | ( | char * | dnsAddress, |
char * | getCommand, | ||
uint32_t | port, | ||
uint8_t | proto | ||
) |
Send a HTTP command to send values.
dnsAddress | web page DNS address. |
getCommand | get command string format. |
port | Web server port connection. |
proto | Ip protocol configuration number. |
Definition at line 912 of file WiFly.c.
References DATA_M, FALSE, TRUE, Wifly_HTTPConfig(), Wifly_open(), and xMutexWifly.
Referenced by Arpalab_sendValue().
uint8_t Wifly_leave | ( | ) |
uint8_t Wifly_logStart | ( | uint32_t | PortNum, |
uint32_t | baudrate, | ||
uint32_t | logSeverity | ||
) |
Wifly start Log module to send log information
PortNum | |
baudrate | UART port baud rate. |
logSeverity |
Definition at line 249 of file WiFly.c.
References FALSE, Log_log(), Log_start(), LV_ERR, NULL, and xMutexWifly.
uint8_t Wifly_open | ( | char * | dnsAddress, |
uint32_t | port | ||
) |
Open a TCP connection.
dnsAddress | destination DNS or IP address. |
port | remote port number. |
Definition at line 478 of file WiFly.c.
References FALSE, Log_log(), LV_INFO, OPEN_CON, OPEN_CONN, OPEN_DELAY, and TRUE.
Referenced by Wifly_HTTPReceive(), Wifly_HTTPSend(), Wifly_TCPReceive(), and Wifly_TCPSend().
uint8_t Wifly_ping | ( | char * | ip | ) |
Ping an IP address
ip | IP address |
Definition at line 465 of file WiFly.c.
References FALSE, Log_log(), LV_INFO, PING, PING_DELAY, PING_OK, and TRUE.
Referenced by Wifly_WLANConnect().
void Wifly_reset | ( | uint8_t | typeReset | ) |
Reset wifly device to ensure to start from know state
typeReset | Reset type: HARDWARE=0, SOFTWARE=1 |
Definition at line 299 of file WiFly.c.
References AOK, DATA_M, ECHO_DELAY, FALSE, Log_log(), LV_INFO, MODE_DISCON, PrintF_ChkScan(), PrintF_delayMs(), READY, REBOOT, RST_DELAY, RST_WIFLY_PIN, SET_UART_MD, TRUE, UART_MD, and WLAN_DISCON.
Referenced by Wifly_ChangeBaudRate(), Wifly_ConfigAPMode(), Wifly_start(), Wifly_WLANConfigConnect(), and Wifly_WLANConnect().
uint8_t Wifly_save | ( | ) |
Save the configuration settings.
Definition at line 340 of file WiFly.c.
References CMD_DELAY, FALSE, SAVE, SAVE_OK, and TRUE.
Referenced by Wifly_ChangeBaudRate(), Wifly_ConfigAPMode(), and Wifly_WLANConfigConnect().
uint8_t Wifly_setComRemote | ( | char * | value | ) |
Sets the ASCI string that is sent to the remote TCP client when the TCP port is opened.
value | String to send to the remote TCP client. |
Definition at line 618 of file WiFly.c.
References AOK, FALSE, SET_COM_REM, SET_DELAY, and TRUE.
Referenced by Wifly_HTTPConfig(), and Wifly_TCPConfig().
uint8_t Wifly_setDNSName | ( | char * | value | ) |
sets the name of the host for TCP/IP connections
value | DNS Name max 32 charecters. |
Definition at line 742 of file WiFly.c.
References AOK, FALSE, SET_DELAY, SET_DNS_NAME, and TRUE.
Referenced by Wifly_HTTPConfig().
uint8_t Wifly_setIpAddress | ( | char * | address | ) |
Sets the WiFly module's IP address.
address | IP address |
Definition at line 508 of file WiFly.c.
References AOK, FALSE, SET_DELAY, SET_IP_ADDRESS, and TRUE.
Referenced by Wifly_ConfigAPMode().
uint8_t Wifly_setIpDHCP | ( | uint8_t | value | ) |
Enables/disables DHCP mode.
value | Disabled=0, enabled=1 |
Definition at line 518 of file WiFly.c.
References AOK, FALSE, SET_DELAY, SET_IP_DHCP, and TRUE.
Referenced by Wifly_ConfigAPMode(), and Wifly_WLANConfigConnect().
uint8_t Wifly_setIpFlags | ( | uint32_t | mask | ) |
Sets the TCP/IP functions
mask | is a hex number referring to a bit-mapped register. see Figure 2-1 Wifly manual. |
Definition at line 538 of file WiFly.c.
References AOK, FALSE, SET_DELAY, SET_IP_FLAGS, and TRUE.
uint8_t Wifly_setIpGateway | ( | char * | address | ) |
Sets the gateway IP address
address | IP gateway address. |
Definition at line 548 of file WiFly.c.
References AOK, FALSE, SET_DELAY, SET_IP_GATEWAY, and TRUE.
Referenced by Wifly_ConfigAPMode().
uint8_t Wifly_setIpHost | ( | char * | address | ) |
Sets the remote host's IP address
address | remote host's IP address |
Definition at line 558 of file WiFly.c.
References AOK, FALSE, SET_DELAY, SET_IP_HOST, and TRUE.
Referenced by Wifly_TCPConfig(), and Wifly_UDPConfig().
uint8_t Wifly_setIpLocalPort | ( | uint32_t | value | ) |
Sets the local port number
value | is a decimal number representing the port. |
Definition at line 568 of file WiFly.c.
References AOK, FALSE, SET_DELAY, SET_IP_LOCAL_PORT, and TRUE.
Referenced by Wifly_UDPConfig().
uint8_t Wifly_setIpNET | ( | char * | address | ) |
Sets the network mask.
address | IP subnet address. |
Definition at line 528 of file WiFly.c.
References AOK, FALSE, SET_DELAY, SET_IP_NET, and TRUE.
Referenced by Wifly_ConfigAPMode().
uint8_t Wifly_setIpnetmask | ( | char * | address | ) |
uint8_t Wifly_setIpProtocol | ( | uint32_t | value | ) |
Sets the IP protocol.
value | is a bit-mapped register. UDP=0, TCP=2, HTTP... See Figure 2-2 Wifly manual. |
Definition at line 588 of file WiFly.c.
References AOK, FALSE, SET_DELAY, SET_IP_PROTO, and TRUE.
Referenced by Wifly_HTTPConfig(), Wifly_TCPConfig(), and Wifly_UDPConfig().
uint8_t Wifly_setIpRemote | ( | uint32_t | value | ) |
Sets the remote host port number.
value | port number |
Definition at line 598 of file WiFly.c.
References AOK, FALSE, SET_DELAY, SET_IP_REMOTE, and TRUE.
Referenced by Wifly_HTTPConfig(), Wifly_TCPConfig(), and Wifly_UDPConfig().
uint8_t Wifly_setIpTcpMode | ( | uint32_t | value | ) |
uint8_t Wifly_setOptionFormat | ( | uint32_t | value | ) |
Sets the HTTP client/web server information.
value | is a bitmapped register as shown in Figure 2-4 of wifly manual. |
Definition at line 628 of file WiFly.c.
References AOK, FALSE, SET_DELAY, SET_OP_FORMAT, and TRUE.
Referenced by Wifly_HTTPConfig(), Wifly_TCPConfig(), and Wifly_UDPConfig().
uint8_t Wifly_setUartBaud | ( | uint32_t | value | ) |
Change the baud rate
value | is 2400, 4800, 9600, 19200, 38400, 57600, 115200, 230400, 460800, or 921600 |
Definition at line 660 of file WiFly.c.
References AOK, DATA_M, FALSE, SET_DELAY, SET_UART_BAUD, and TRUE.
Referenced by Wifly_ChangeBaudRate().
uint8_t Wifly_setUartInstant | ( | uint32_t | value | ) |
Immediately changes the baud rate
value | is 2400, 4800, 9600, 19200, 38400, 57600, 115200, 230400, 460800, or 921600 |
Definition at line 648 of file WiFly.c.
References DATA_M, FALSE, SET_DELAY, SET_UART_INST, and TRUE.
uint8_t Wifly_setUartMode | ( | uint32_t | value | ) |
uint8_t Wifly_setWlanAuth | ( | uint32_t | value | ) |
Sets the authentication mode.
value | is a decimal value as shown in Figure 2-13 Wifly manual |
Definition at line 682 of file WiFly.c.
References AOK, FALSE, SET_DELAY, SET_WLAN_AUTH, and TRUE.
Referenced by Wifly_WLANConfigConnect().
uint8_t Wifly_setWlanChannel | ( | uint8_t | value | ) |
Sets the WLAN channel.
value | is a decimal number from 1 to 13 representing a fixed channel |
Definition at line 692 of file WiFly.c.
References AOK, FALSE, SET_DELAY, SET_WLAN_CHAN, and TRUE.
Referenced by Wifly_ConfigAPMode().
uint8_t Wifly_setWlanJoin | ( | uint32_t | value | ) |
Sets the policy for automatically associating with network access points,where
is one of the options.
value | 0= Manual, 1= Associate with the access point that matches the stored SSID, 2= Associated with any, 4= Create an ad hoc network, 5=Associaed an Soft AP. |
Definition at line 702 of file WiFly.c.
References AOK, FALSE, SET_DELAY, SET_WLAN_JOIN, and TRUE.
Referenced by Wifly_ConfigAPMode(), and Wifly_WLANConfigConnect().
uint8_t Wifly_setWlanKey | ( | char * | password | ) |
sets the WEP-64 or WEP-128 key
password | is 26 ASCII chars in hex without the preceding 0x. |
Definition at line 712 of file WiFly.c.
References AOK, FALSE, SET_DELAY, SET_WLAN_KEY, and TRUE.
Referenced by Wifly_WLANConfigConnect().
uint8_t Wifly_setWlanPhrase | ( | char * | password | ) |
sets the passphrase for WPA and WPA2 security modes
password | is an alphanumeric pass phrase. |
Definition at line 722 of file WiFly.c.
References AOK, FALSE, SET_DELAY, SET_WLAN_PHRASE, and TRUE.
Referenced by Wifly_WLANConfigConnect().
uint8_t Wifly_setWlanSSID | ( | char * | value | ) |
sets the SSID with which the module associates.
value | is 1 to 32 characters that represents SSID name. |
Definition at line 732 of file WiFly.c.
References AOK, FALSE, SET_DELAY, SET_WLAN_SSID, and TRUE.
Referenced by Wifly_ConfigAPMode(), and Wifly_WLANConfigConnect().
uint8_t Wifly_setWlanTX | ( | uint32_t | tx | ) |
uint32_t Wifly_showConnection | ( | ) |
uint8_t Wifly_sleep | ( | ) |
uint8_t Wifly_start | ( | uint32_t | portNum, |
uint32_t | baudrate | ||
) |
Wifly start Printf module and connection parameters
portNum | UART id |
baudrate | UART baudrate |
Definition at line 224 of file WiFly.c.
References FALSE, Log_log(), LV_ERR, NULL, PrintF_start(), RESET_HARDWARE, Wifly_reset(), and xMutexWifly.
uint8_t Wifly_TCPConfig | ( | char * | address, |
uint32_t | port | ||
) |
Sending the command settings necessary to UDP connection.
address | destination IP address. |
port | remote port number. |
Definition at line 1109 of file WiFly.c.
References FALSE, HELLO_CON, MODE_TCP, TRUE, Wifly_setComRemote(), Wifly_setIpHost(), Wifly_setIpProtocol(), Wifly_setIpRemote(), and Wifly_setOptionFormat().
Referenced by Wifly_TCPReceive(), and Wifly_TCPSend().
char* Wifly_TCPReceive | ( | char * | address, |
uint32_t | remotePort, | ||
const char *restrict | command, | ||
... | |||
) |
Send a TCP command and receive the server response.
address | remote IP address. |
remotePort | remote port number connection. |
command | string to send. |
Definition at line 1026 of file WiFly.c.
References DATA_M, TCP_DELAY, TRUE, Wifly_close(), Wifly_open(), Wifly_TCPConfig(), and xMutexWifly.
Referenced by Tcp_receiveValue().
uint8_t Wifly_TCPSend | ( | char * | address, |
uint32_t | remotePort, | ||
char * | exResp, | ||
const char *restrict | command, | ||
... | |||
) |
Send a TCP command to send values.
address | IP address. |
remotePort | remote port number. |
exResp | expected string response. |
command | string to send. |
Definition at line 1053 of file WiFly.c.
References DATA_M, FALSE, TCP_DELAY, TRUE, Wifly_close(), Wifly_open(), Wifly_TCPConfig(), and xMutexWifly.
Referenced by Tcp_sendValue(), and Wifly_TCPTimeOpen().
void Wifly_TCPTimeOpen | ( | uint32_t | time, |
char * | address, | ||
uint32_t | remotePort, | ||
char * | exResp, | ||
const char *restrict | command, | ||
... | |||
) |
Send every time interval a TCP command to send values.
/attention To disable Wifly_TCPTimeOpen you should to call Wifly_TCPTimeOpenDisc in a different task.
time | time interval in seconds |
address | IP address. |
remotePort | remote port number. |
exResp | expected string response. |
command | string to send. |
Definition at line 1081 of file WiFly.c.
References FALSE, PrintF_delayMs(), TRUE, and Wifly_TCPSend().
void Wifly_TCPTimeOpenDisc | ( | ) |
uint8_t Wifly_UDPConfig | ( | char * | address, |
uint32_t | localPort, | ||
uint32_t | remotePort | ||
) |
Sending the command settings necessary to UDP connection
address | Remote IP address. |
localPort | Local port number. |
remotePort | Remote port number connection. |
Definition at line 1002 of file WiFly.c.
References FALSE, MODE_UDP, TRUE, Wifly_setIpHost(), Wifly_setIpLocalPort(), Wifly_setIpProtocol(), Wifly_setIpRemote(), and Wifly_setOptionFormat().
Referenced by Wifly_UDPReceive(), and Wifly_UDPSend().
char* Wifly_UDPReceive | ( | char * | address, |
uint32_t | localPort, | ||
uint32_t | remotePort, | ||
const char *restrict | command, | ||
... | |||
) |
Send a UDP command and receive the server response.
address | remote IP address. |
localPort | local port number. |
remotePort | remote port number connection. |
command | Command string to send. |
Definition at line 955 of file WiFly.c.
References PrintF_delayMs(), TRUE, UDP_DELAY, Wifly_UDPConfig(), WIFLYBUFSIZE, and xMutexWifly.
Referenced by Udp_receiveValue().
uint8_t Wifly_UDPSend | ( | char * | address, |
uint32_t | localPort, | ||
uint32_t | remotePort, | ||
char * | exResp, | ||
const char *restrict | command, | ||
... | |||
) |
Send a UDP command to send values.
address | Remote IP address. |
localPort | Local port number. |
remotePort | Remote port number connection. |
exResp | Expected string response. |
command | Command string to send. |
Definition at line 978 of file WiFly.c.
References FALSE, PrintF_delayMs(), TRUE, UDP_DELAY, Wifly_UDPConfig(), and xMutexWifly.
Referenced by Udp_sendValue().
uint8_t Wifly_WLANConfigConnect | ( | uint32_t | AuthMode, |
char * | ssid, | ||
char * | passw | ||
) |
Sending the command settings necessary to establish WLAN connection.
AuthMode | is a decimal that represents the authentication mode. |
ssid | SSID name. |
passw | password of the SSID connection. |
Definition at line 428 of file WiFly.c.
References FALSE, Log_log(), LV_INFO, MIXED, RESET_SOFTWARE, TRUE, WEP, Wifly_reset(), Wifly_save(), Wifly_setIpDHCP(), Wifly_setWlanAuth(), Wifly_setWlanJoin(), Wifly_setWlanKey(), Wifly_setWlanPhrase(), Wifly_setWlanSSID(), WLAN_CON, WPA1, and WPA2.
Referenced by Wifly_WLANConnect().
uint8_t Wifly_WLANConnect | ( | uint32_t | AuthMode, |
char * | ssid, | ||
char * | passw | ||
) |
Connect to WLAN ssid
AuthMode | WLAN auth mode |
ssid | Name of WLAN connection |
passw | WLAN Password |
Definition at line 367 of file WiFly.c.
References FALSE, JOIN, JOIN_DELAY, JOIN_OK, Log_log(), LV_ERR, RESET_HARDWARE, TRUE, Wifly_ping(), Wifly_reset(), Wifly_WLANConfigConnect(), and xMutexWifly.
Referenced by Wifly_WLANConnectPing().
uint8_t Wifly_WLANConnectPing | ( | uint32_t | AuthMode, |
char * | ssid, | ||
char * | passw, | ||
char * | pingIP | ||
) |
Connect to WLAN ssid and change IP Ping used to check connection
AuthMode | WLAN auth mode |
ssid | Name of WLAN connection |
passw | WLAN Password |
pingIP | Ping address |
Definition at line 408 of file WiFly.c.
References Wifly_WLANConnect().
Referenced by Arpalab_receiveValue(), Arpalab_sendValue(), Tcp_receiveValue(), Tcp_sendValue(), Udp_receiveValue(), and Udp_sendValue().
xSemaphoreHandle xMutexWifly |
Definition at line 87 of file WiFly.c.
Referenced by Wifly_ConfigAPMode(), Wifly_HTTPReceive(), Wifly_HTTPSend(), Wifly_logStart(), Wifly_start(), Wifly_TCPReceive(), Wifly_TCPSend(), Wifly_UDPReceive(), Wifly_UDPSend(), and Wifly_WLANConnect().