8000 Added the channel parameter to the scan fucntion in order to select w… · ingframin/arduino-esp32@43c070f · GitHub
[go: up one dir, main page]

Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 43c070f

Browse files
committed
Added the channel parameter to the scan fucntion in order to select which channel to scan.
The default value is 0 (= all channels) to preserve backward compatibility.
1 parent 3fc974f commit 43c070f

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

libraries/WiFi/src/WiFiScan.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ void* WiFiScanClass::_scanResult = 0;
5454
* @param show_hidden show hidden networks
5555
* @return Number of discovered networks
5656
*/
57-
int16_t WiFiScanClass::scanNetworks(bool async, bool show_hidden, bool passive, uint32_t max_ms_per_chan)
57+
int16_t WiFiScanClass::scanNetworks(bool async, bool show_hidden, bool passive, uint32_t max_ms_per_chan, uint8_t channel)
5858
{
5959
if(WiFiGenericClass::getStatusBits() & WIFI_SCANNING_BIT) {
6060
return WIFI_SCAN_RUNNING;
@@ -70,7 +70,7 @@ int16_t WiFiScanClass::scanNetworks(bool async, bool show_hidden, bool passive,
7070
wifi_scan_config_t config;
7171
config.ssid = 0;
7272
config.bssid = 0;
73-
config.channel = 0;
73+
config.channel = channel;
7474
config.show_hidden = show_hidden;
7575
if(passive){
7676
config.scan_type = WIFI_SCAN_TYPE_PASSIVE;

libraries/WiFi/src/WiFiScan.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ class WiFiScanClass
3131

3232
public:
3333

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

3636
int16_t scanComplete();
3737
void scanDelete();

0 commit comments

Comments
 (0)
0