Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ruanhaishen
Nodemcu Firmware
Commits
b03a6696
Commit
b03a6696
authored
Jan 15, 2016
by
Marcel Stör
Browse files
Add documentation for new wifi functions
parent
6cc5af2f
Changes
1
Hide whitespace changes
Inline
Side-by-side
docs/en/modules/wifi.md
View file @
b03a6696
...
@@ -275,7 +275,7 @@ wifi.sta.disconnect()
...
@@ -275,7 +275,7 @@ wifi.sta.disconnect()
-
[
`wifi.sta.disconnect()`
](
#wifistadisconnect
)
-
[
`wifi.sta.disconnect()`
](
#wifistadisconnect
)
## wifi.sta.connect()
## wifi.sta.connect()
#### Description
Connects to AP in station mode.
Connects to AP in station mode.
#### Syntax
#### Syntax
...
@@ -558,6 +558,24 @@ ssid, password, bssid_set, bssid=nil, nil, nil, nil
...
@@ -558,6 +558,24 @@ ssid, password, bssid_set, bssid=nil, nil, nil, nil
-
[
`wifi.sta.connect()`
](
#wifistaconnect
)
-
[
`wifi.sta.connect()`
](
#wifistaconnect
)
-
[
`wifi.sta.disconnect()`
](
#wifistadisconnect
)
-
[
`wifi.sta.disconnect()`
](
#wifistadisconnect
)
## wifi.sta.gethostname()
Gets current station hostname.
#### Syntax
`wifi.sta.gethostname()`
#### Parameters
none
#### Returns
currently configured hostname
#### Example
```
lua
print
(
"Current hostname is: \""..wifi.sta.gethostname().."
\
""
)
```
## wifi.sta.getip()
## wifi.sta.getip()
Gets IP address, netmask, and gateway address in station mode.
Gets IP address, netmask, and gateway address in station mode.
...
@@ -603,6 +621,28 @@ MAC address as string e.g. "18-33-44-FE-55-BB"
...
@@ -603,6 +621,28 @@ MAC address as string e.g. "18-33-44-FE-55-BB"
#### See also
#### See also
[
`wifi.sta.getip()`
](
#wifistagetip
)
[
`wifi.sta.getip()`
](
#wifistagetip
)
## wifi.sta.sethostname()
Sets station hostname.
#### Syntax
`wifi.sta.sethostname(hostname)`
#### Parameters
`hostname`
must only contain letters, numbers and hyphens('-') and be 32 characters or less with first and last character being alphanumeric
#### Returns
true if hostname was successfully set, false otherwise
#### Example
```
lua
if
(
wifi
.
sta
.
sethostname
(
"NodeMCU"
)
==
true
)
then
print
(
"hostname was successfully changed"
)
else
print
(
"hostname was not changed"
)
end
```
## wifi.sta.setip()
## wifi.sta.setip()
Sets IP address, netmask, gateway address in station mode.
Sets IP address, netmask, gateway address in station mode.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment