ContentsIndex
PreviousUpNext
WIFI
Classes | Structs, Records, Enums | Variables

 

The WiFi API provides features to enable LinkIt ONE to scan and connect to Wi-Fi APs using its built-in Wi-Fi module. With this WiFi connection ability, LinkIt ONE is able to access various resources on the Internet, including all kinds of web services. 

 

Wi-Fi functions are provided by three classes. 

  • LWiFi provides for scanning and connecting to WiFi APs, including:
    • begin() to enable the Wi-Fi module
    • connect() to connect to an un-encrypted WiFi AP.
    • connectWEP() and connectWPA() to connect to encrypted APs.
 

  • LWiFiClient provides for connecting to an Internet service using the TCP protocol, including:
    • connect() to open a TCP/IP connection to the web server and read the content.
    • Your application can include up to 7 clients.
 

  • LWiFiServer provides for setting up TCP ports and listening to remote TCP clients, including:
    • available() to check the incoming connections. This API returns an LWiFiClient() instance representing the connection.
    • client.read() and client.write() to exchange data with the remote client.
 

For both LWiFiClient and LWiFiServer, the print() and write() methods are available to implement Stream interfaces. It is easier to transmit ASCII strings or convert numerical values into strings with the print() methods. However, you may use write() to send low-level raw buffer content. The print() methods are implemented by write() methods. 

 

Currently there are some limitations to the WiFi API:

  1. You cannot designate the group ID of the password when connecting to WEP encrypted APs.
  2. Querying the encryption protocol of an AP is not supported.
  3. There is no support for static network settings; that is static IP, DNS servers or subnet masks. Instead, DHCP is used to provide network settings.

Classes
Class 
Description 
LTcpClient Class
LTcpClient is the base implementation of LWiFiClient and LGPRSClient. You should not use LTcpClient instances directly. Instead, declare instances of LWiFiClient or LGPRSClient and use them to connect TCP socket through Wi-Fi and GPRS. 
LTcpServer Class
LTcpServer is the base implementation of LWiFiServer and LGPRSServer. You should not use LTcpServer instances directly. Instead, declare instances of LWiFiServer or LGPRSServer and use them to host TCP port through Wi-Fi and GPRS. 
LUDP 
LUDP Class
LUDP is the base implementation of LWiFiUDP and LGPRSUDP. You should not use LUDP instances directly. Instead, declare instances of LWiFiUDP or LGPRSUDP and use them to perform UDP socket operations.
Unlike LTcpClient and LTcpServer, a LUDP instance can send to and receive from multiple addresses. To achieve this, beginPacket() should be called first to assign remote address and port, followed by write() and finally endPacket(). Receiving packets works in a similar way. parsePacket() should be called first. After parsePacket() returns non-zero value, methods read(), available(), remoteIP() and... more 
LWifiClass Class
LWifiClass exposes the Wi-Fi AP scan and connect function of the LinkIt ONE board. Use LWiFi singleton object to access the actual functions. Do not declare LWiFiClass instances. After a connection to an Wi-Fi access point is established, use LWiFiClient object to create a TCP socket; or use LWiFiUDP object to create a UDP socket. 
LWiFiClient Class
Please see the method description of LTcpClient class. 
LWiFiLoginInfo Class
This class is used as a parameter for LWiFiClass.connect. Please see the description of LWiFiClass.connect for details. 
LWiFiServer Class
Please see the method description of LTcpServer class. 
LGPRSUDP Class
Use this class to manipulate UDP datagrams after connecting to a Wi-Fi AP with LWiFi. Please see the method description of LUDP class. 
Structs, Records, Enums
Struct, Record, Enum 
Description 
Variables
Variable 
Description 
Use this LWiFi singleton to access the Wi-Fi functionality. 
Links