Skip to content

Commit

Permalink
Added the channel parameter to the scan fucntion in order to select w…
Browse files Browse the repository at this point in the history
…hich channel to scan. (#3638)

The default value is 0 (= all channels) to preserve backward compatibility.
  • Loading branch information
ingframin authored and me-no-dev committed Jan 20, 2020
1 parent 8d938c8 commit 2195109
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions libraries/WiFi/src/WiFiScan.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ void* WiFiScanClass::_scanResult = 0;
* @param show_hidden show hidden networks
* @return Number of discovered networks
*/
int16_t WiFiScanClass::scanNetworks(bool async, bool show_hidden, bool passive, uint32_t max_ms_per_chan)
int16_t WiFiScanClass::scanNetworks(bool async, bool show_hidden, bool passive, uint32_t max_ms_per_chan, uint8_t channel)
{
if(WiFiGenericClass::getStatusBits() & WIFI_SCANNING_BIT) {
return WIFI_SCAN_RUNNING;
Expand All @@ -70,7 +70,7 @@ int16_t WiFiScanClass::scanNetworks(bool async, bool show_hidden, bool passive,
wifi_scan_config_t config;
config.ssid = 0;
config.bssid = 0;
config.channel = 0;
config.channel = channel;
config.show_hidden = show_hidden;
if(passive){
config.scan_type = WIFI_SCAN_TYPE_PASSIVE;
Expand Down
2 changes: 1 addition & 1 deletion libraries/WiFi/src/WiFiScan.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ class WiFiScanClass

public:

int16_t scanNetworks(bool async = false, bool show_hidden = false, bool passive = false, uint32_t max_ms_per_chan = 300);
int16_t scanNetworks(bool async = false, bool show_hidden = false, bool passive = false, uint32_t max_ms_per_chan = 300, uint8_t channel = 0);

int16_t scanComplete();
void scanDelete();
Expand Down

0 comments on commit 2195109

Please sign in to comment.