From eb79f1e79ac2a921ac013dccb6137e45c6a452cb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcel=20St=C3=B6r?= Date: Sun, 5 Aug 2018 17:58:04 +0200 Subject: [PATCH] Improve documentation for wifi.monitor Fixes #2433, #2434 --- docs/en/modules/wifi_monitor.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/docs/en/modules/wifi_monitor.md b/docs/en/modules/wifi_monitor.md index 8257dc42..c7ea1d90 100644 --- a/docs/en/modules/wifi_monitor.md +++ b/docs/en/modules/wifi_monitor.md @@ -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 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 `wifi.monitor.start([filter parameters,] mgmt_frame_callback)` @@ -29,10 +29,10 @@ nothing. #### Example ``` -wifi.monitor.channel(6) wifi.monitor.start(13, 0x80, function(pkt) print ('Beacon: ' .. pkt.bssid_hex .. " '" .. pkt[0] .. "' ch " .. pkt[3]:byte(1)) end) +wifi.monitor.channel(6) ``` ## wifi.monitor.stop() @@ -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 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 `wifi.monitor.channel(channel)`