User Tools

Site Tools


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

void toggleEcho() E

String getWifiMode() WMODE AP STA APSTA

void setWifiMode(char *mode)

void setTransparent() ENTM

String getTMode() TMODE throughput cmd

void setTMode(char *mode)

String getModId() MID

String version() VER

void factoryRestore() RELD rebooting…

void reset() Z (No return)

String help()H

Configure Parameters Instruction Set

int readConfig(byte* buffer) CFGRD

void writeConfig(byte* config, int len) CFGWR

int readFactoryDef(byte* buffer)CFGFR

void makeFactory() CFGTF

UART Instruction Set

String getUart() UART baudrate,data_bits,stop_bit,parity

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 String getAutoFrame() UARTF

void setAutoFrame(char *para)

int getAutoFrmTrigTime() UARTFT

void setAutoFrmTrigTime(int ms)

int getAutoFrmTrigLength() UARTFL

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)''
      ''String getTCPLnk()''
        TCPLK on|off 
      ''int getTCPTimeout()''
        TCPTO 0 <= int <= 600 (Def 300)
      ''String getTCPConn()''
        TCPDIS On|off
      ''void setTCPConn(char *sta)''

Wi-Fi STA Instruction Set

Effective when module works as STA (station)

      ''String getWSSSID()''
      ''void setWSSSID(char *ssid)''
      ''String getSTAKey()''
      void setSTAKey(char* auth,char *encry,char *key);
      String getSTANetwork();//WANN (static|DHCP),ip,subnet,gateway
      void setSTANetwork(char *mode, char *ip, char *subnet, char *gateway);
      String getSTAMac();//WSMAC returns MAC
      void setSTAMac(int code, char *mac);//Code default is 8888, no idea what its for
      String STALinkStatus();//WSLK (Disconnected|AP SSID (AP MAC)|RF Off)
      String STASignalStrength();//WSLQ (Disconnected|Value)
      String scan();//WSCAN returns list
      String getSTADNS()
        WSDNS address
      void setSTADNS(char *dns);

Wi-Fi AP Instruction Set

Effective when module works as AP (access point)

      String getAPNetwork()
       LANN ip,subnet
      void setAPNetwork(char *ip, char *subnet)
      String getAPParams();
        WAP (11B|11BG|11BGN),SSID,(AUTO|C1...C11)
      void setAPParams(char *mode, char *ssid, char *channel)
      String getAPKey();//WAKEY (OPEN|WPA2PSK),(NONE|AES),key
      void setAPKey(char* auth,char *encry,char *key)
      String getAPMac();//WAMAC returns MAC
      String getAPDHCP();//WADHCP (on|off)
      void setAPDHCP(char *status)
      String getAPPageDomain();//WADMN domain
      void setAPPageDomain(char *domain)

Webpage Management Instruction Set

      ''void setPageDisplayMode(char *mode)'' WEBSWITCH (iw|ew)
      ''void setPageLanguage(char *lang)'' PLANG CN|EN
      ''String getWebAuth()'' WEBU user,pass
      ''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.1378962918.txt.gz · Last modified: 2013/09/11 22:15 by Eje_G