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.
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:
|
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 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. | |
|
Struct, Record, Enum |
Description |
|
LWiFiLoginInfo enum | |
|
LWiFiLoginInfo enum |
|
Variable |
Description |
|
Use this LWiFi singleton to access the Wi-Fi functionality. |