User Tools

Site Tools


digix:tutorials:wifi:library-functions

This is an old revision of the document!


Initialization functions

void begin(int aBaud)

bool ready()

void startATMode()

void endATMode()

void close()

String AT(char *cmd, char *params)

bool connect(char *aHost)

Web page data functions

bool get(char *aHost, char *aPath)

bool post(char *aHost, char *aPath, String postData)

String URLEncode(char *smsg)

String header()

String body()

Debug functions

int lastError()

void debug(String output)

void debugWrite(char output)

Managment Instruction Set

E - toggle AT command result Echo on/off

void toggleEcho() E

WMODE AP STA APSTA

String getWifiMode()

void setWifiMode(char *mode)

ENTM

void setTransparent()

TMODE throughput cmd

String getTMode()

void setTMode(char *mode)

MID

String getModId()

VER

String version()

RELD rebooting…

void factoryRestore()

Z (No return)

void reset()

H

String help()

Configure Parameters Instruction Set

CFGRD

int readConfig(byte* buffer)

CFGWR

void writeConfig(byte* config, int len)

CFGFR

int readFactoryDef(byte* buffer)

CFGTF

void makeFactory()

UART Instruction Set

UART baudrate,data_bits,stop_bit,parity

String getUart()

void setUart(int baudrate,int data_bits,int stop_bit,char *parity)

These are commented out as I'm unsure how they should be named

UARTF

String getAutoFrame()

void setAutoFrame(char *para)

UARTFT

int getAutoFrmTrigTime()

void setAutoFrmTrigTime(int ms)

UARTFL

int getAutoFrmTrigLength()

void setAutoFrmTrigLength(int v)

Command Mode Set

SEND

void sendData(int len, char *data)

RECV len,data (+ok=0 if timeout (3sec))

String recvData(int len)

Network Instruction Set

PING Success Timeout Unknown host

String ping(char *ip)

NETP (TCP|UDP),(SERVER|CLIENT),port,IP

String getNetParams()

void setNetParams(char *proto, char *cs, int port, char *ip)

TCPLK on|off

String getTCPLnk()

TCPTO 0 ⇐ int ⇐ 600 (Def 300)

int getTCPTimeout()

TCPDIS On|off

String getTCPConn()

void setTCPConn(char *sta)

Wi-Fi STA Instruction Set

Effective when module works as STA (station)

WSSSID

String getWSSSID()

void setWSSSID(char *ssid)

WSKEY (OPEN|SHARED|WPAPSK|WPA2PSK),(NONE|WEP|TKIP|AES),key

String getSTAKey()

void setSTAKey(char* auth,char *encry,char *key)

WANN (static|DHCP),ip,subnet,gateway

String getSTANetwork()

void setSTANetwork(char *mode, char *ip, char *subnet, char *gateway)

WSMAC returns MAC

String getSTAMac()

Code default is 8888, no idea what its for

void setSTAMac(int code, char *mac)

WSLK (Disconnected|AP SSID (AP MAC)|RF Off)

String STALinkStatus()

WSLQ (Disconnected|Value)

String STASignalStrength()

WSCAN returns list

String scan()

WSDNS address

String getSTADNS()

void setSTADNS(char *dns)

Wi-Fi AP Instruction Set

Effective when module works as AP (access point)

LANN ip,subnet

String getAPNetwork()

void setAPNetwork(char *ip, char *subnet)

WAP (11B|11BG|11BGN),SSID,(AUTO|C1…C11)

String getAPParams()

void setAPParams(char *mode, char *ssid, char *channel)

WAKEY (OPEN|WPA2PSK),(NONE|AES),key

String getAPKey()

void setAPKey(char* auth,char *encry,char *key)

WAMAC returns MAC

String getAPMac()

WADHCP (on|off)

String getAPDHCP()

void setAPDHCP(char *status)

WADMN domain

String getAPPageDomain()

void setAPPageDomain(char *domain)

Webpage Management Instruction Set

WEBSWITCH (iw|ew)

void setPageDisplayMode(char *mode)

PLANG CN|EN

void setPageLanguage(char *lang)

WEBU user,pass

String getWebAuth()

void setWebAuth(char *user, char *pass)

Remote Upgrade

!!!DANGEROUS!!! Make sure you know what you're doing, could brick your unit.

* UPURL url Set/Query remote upgrade URL address

String getUpgradeUrl()

* url,filename (filename is optional, if provided upgrade is auto started)

void setUpgradeUrl(char *url)

* UPFILE filename Set/Query remote upgrade configure filename !!!DANGEROUS!!!

String getUpgradeFile()

void setUpgradeFile(char *filename)

* UPST Start remote upgrade !!!DANGEROUS!!!

String startUpgrade()

Power Management

MSLP normal|standby

- Set/Query deep sleep/standby mode parameters

String getSleepMode()

void setSleepMode(char *mode)

Others Instruction Set

WRMID - Set module ID

void setModId(char *modid)

SWD aswd Set/Query WiFi configuration code

String getWifiCfgPassword()

void setWifiCfgPassword(char *aswd)

digix/tutorials/wifi/library-functions.1379000110.txt.gz · Last modified: 2013/09/12 08:35 by Eje_G