“ESP8266 WiFi”的版本间的差异
第1行: | 第1行: | ||
− | + | ||
− | + | ||
<font color="orange" size="+2">'''WiFi类'''</font><br> | <font color="orange" size="+2">'''WiFi类'''</font><br> | ||
第8行: | 第7行: | ||
:设置wifi模块工作模式WIFI_AP,WIFI_STA,WIFI_AP_STA | :设置wifi模块工作模式WIFI_AP,WIFI_STA,WIFI_AP_STA | ||
+ | {| border="0" cellpadding="10" width="100%" | ||
+ | |width="50%" valign="top" align="left"| | ||
---- | ---- | ||
Wifi AP | Wifi AP | ||
第45行: | 第46行: | ||
:获取MAC地址,用于AP模式 | :获取MAC地址,用于AP模式 | ||
:返回:String | :返回:String | ||
− | + | |width="50%" valign="top" align="left"| | |
---- | ---- | ||
Wifi STA | Wifi STA | ||
第92行: | 第93行: | ||
:返回:bool | :返回:bool | ||
− | - <font color="forestgreen">WiFi.waitForConnectResult( | + | - <font color="forestgreen">WiFi.waitForConnectResult()</font> |
− | : Wait for WiFi connection to reach a | + | : Wait for WiFi connection to reach a result returns the status reached or disconnect if STA is off |
:返回:连接状态 | :返回:连接状态 | ||
::WL_CONNECTED | ::WL_CONNECTED | ||
第102行: | 第103行: | ||
- <font color="forestgreen">WiFi.localIP()</font> | - <font color="forestgreen">WiFi.localIP()</font> | ||
− | : | + | : 获取IP 地址,用于STA模式 |
+ | :返回:IPAddress | ||
− | - <font color="forestgreen">WiFi. | + | - <font color="forestgreen">WiFi.macAddress(uint8_t* mac)</font> |
− | : | + | : 获取MAC地址,用于STA模式 |
− | - <font color="forestgreen">WiFi. | + | - <font color="forestgreen">WiFi.macAddress(void)</font> |
− | : | + | : 获取MAC地址,用于STA模式 |
− | - <font color="forestgreen">WiFi. | + | - <font color="forestgreen">WiFi.subnetMask()</font> |
− | : | + | : Get the interface subnet mask address. |
+ | :返回:IPAddress | ||
+ | |||
+ | - <font color="forestgreen">WiFi.gatewayIP()</font> | ||
+ | : Get the gateway ip address. | ||
+ | :返回:IPAddress | ||
:-[[WiFi.begin()| begin()]] | :-[[WiFi.begin()| begin()]] | ||
第137行: | 第144行: | ||
:-[[WiFi.macAddress()| macAddress()]] | :-[[WiFi.macAddress()| macAddress()]] | ||
<br> | <br> | ||
+ | |} | ||
+ | |||
+ | {| border="0" cellpadding="10" width="100%" | ||
+ | |width="100%" valign="top" align="left"| | ||
+ | |||
<font color="orange" size="+2">'''Server 类'''</font><br> | <font color="orange" size="+2">'''Server 类'''</font><br> | ||
2016年3月25日 (五) 11:10的版本
WiFi类
The WiFi class initializes the ethernet library and network settings.
- WiFi.mode()
- 设置wifi模块工作模式WIFI_AP,WIFI_STA,WIFI_AP_STA
Wifi AP - WiFi.softAP(ssid,[password],[channel],[ssid_hidden])
- WiFi.softAPConfig(local_ip,gateway,subnet)
- WiFi.softAPdisconnect(wifioff)
- WiFi.softAPgetStationNum()
- WiFi.softAPIP()
- WiFi.softAPmacAddress(mac)
- WiFi.softAPmacAddress(void)
|
Wifi STA WL_CONNECTED WL_NO_SSID_AVAIL; WL_CONNECT_FAILED; WL_IDLE_STATUS; WL_DISCONNECTED; - WiFi.begin()
- WiFi.config(local_ip, gateway, subnet, dns1, dns2)
- WiFi.reconnect()
- WiFi.disconnect(bool wifioff)
- WiFi.isConnected()
- WiFi.setAutoConnect(bool autoConnect)
- WiFi.setAutoConnect()
- WiFi.setAutoReconnect(bool autoReconnect)
- WiFi.waitForConnectResult()
- WiFi.localIP()
- WiFi.macAddress(uint8_t* mac)
- WiFi.macAddress(void)
- WiFi.subnetMask()
- WiFi.gatewayIP()
|
Server 类 The Server class creates servers which can send data to and receive data from connected clients (programs running on other computers or devices).
The client class creates clients that can connect to servers and send and receive data.
The UDP class enables UDP message to be sent and received. |
更多建议和问题欢迎反馈至 YFRobot论坛