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
eb79f1e7
Commit
eb79f1e7
authored
Aug 05, 2018
by
Marcel Stör
Browse files
Improve documentation for wifi.monitor
Fixes #2433, #2434
parent
c75be877
Changes
1
Hide whitespace changes
Inline
Side-by-side
docs/en/modules/wifi_monitor.md
View file @
eb79f1e7
...
@@ -12,7 +12,7 @@ This module is not for casual use -- it requires an understanding of IEEE802.11
...
@@ -12,7 +12,7 @@ This module is not for casual use -- it requires an understanding of IEEE802.11
This registers a callback function to be called whenever a management frame is received. Note that this can be at quite a high rate, so some limited
This registers a callback function to be called whenever a management frame is received. Note that this can be at quite a high rate, so some limited
filtering is provided before the callback is invoked. Only the first 110 bytes or so of the frame are returned -- this is an SDK restriction.
filtering is provided before the callback is invoked. Only the first 110 bytes or so of the frame are returned -- this is an SDK restriction.
Any connected
ap
/station will be disconnected.
Any connected
AP
/station will be disconnected.
Calling this function sets the channel back to 1.
#### Syntax
#### Syntax
`wifi.monitor.start([filter parameters,] mgmt_frame_callback)`
`wifi.monitor.start([filter parameters,] mgmt_frame_callback)`
...
@@ -29,10 +29,10 @@ nothing.
...
@@ -29,10 +29,10 @@ nothing.
#### Example
#### Example
```
```
wifi.monitor.channel(6)
wifi.monitor.start(13, 0x80, function(pkt)
wifi.monitor.start(13, 0x80, function(pkt)
print ('Beacon: ' .. pkt.bssid_hex .. " '" .. pkt[0] .. "' ch " .. pkt[3]:byte(1))
print ('Beacon: ' .. pkt.bssid_hex .. " '" .. pkt[0] .. "' ch " .. pkt[3]:byte(1))
end)
end)
wifi.monitor.channel(6)
```
```
## wifi.monitor.stop()
## wifi.monitor.stop()
...
@@ -46,6 +46,7 @@ This disables the monitor mode and returns to normal operation. There are no par
...
@@ -46,6 +46,7 @@ This disables the monitor mode and returns to normal operation. There are no par
This sets the channel number to monitor. Note that in many applications you will want to step through the channel numbers at regular intervals. Beacon
This sets the channel number to monitor. Note that in many applications you will want to step through the channel numbers at regular intervals. Beacon
frames (in particular) are typically sent every 102 milliseconds, so a switch time of (say) 150 milliseconds seems to work well.
frames (in particular) are typically sent every 102 milliseconds, so a switch time of (say) 150 milliseconds seems to work well.
Note that this function should be called after starting to monitor, since
`wifi.monitor.start`
resets the channel back to 1.
#### Syntax
#### Syntax
`wifi.monitor.channel(channel)`
`wifi.monitor.channel(channel)`
...
...
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