8000 ESP8266WiFiScan::scanNetworks signature and capabilities enhancement for ESP32 compatibility by dok-net · Pull Request #8073 · esp8266/Arduino · GitHub
[go: up one dir, main page]

Skip to content

Conversation

@dok-net
Copy link
Contributor
@dok-net dok-net commented May 23, 2021

Fixes #8053

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a breaking change.
What about leaving the former API without the default values ?

+ int8_t scanNetworks(bool async = false, bool show_hidden = false, uint8 channel, uint8* ssid);

Copy link
Contributor Author
@dok-net dok-net May 24, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks fishy, and indeed, it leads to an ambiguity error for the case of default ssid argument, because the compiler cannot distiguish the actual parameter for bool passive from uint8_t channel. Better break once, for good, in the breaking 3.0 release.

        //scanResult = WiFi.scanNetworks(/*async=*/false, /*hidden=*/true, /*passive=*/ false);
        scanResult = WiFi.scanNetworks(/*async=*/false, /*hidden=*/true, /*channel=*/0);
WiFiScan.ino: 25:54: error: call of overloaded 'scanNetworks(bool, bool, int)' is ambiguous
   25 |         scanResult = WiFi.scanNetworks(/*async=*/false, /*hidden=*/true, /*channel=*/0)
   |                                                      ^
 
ESP8266WiFi.h:36: In file included from
WiFiScan.ino:7: from
ESP8266WiFiScan.h:37: note  candidate  int8_t ESP8266WiFiScanClass  scanNetworks(bool, bool, uint8, uint8*)
   37 |         int8_t scanNetworks(bool async, bool show_hidden, uint8 channel, uint8* ssid = NULL) __attribute__((deprecated)) {
   |                ^~~~~~~~~~~~
ESP8266WiFiScan.h:40: note  candidate  int8_t ESP8266WiFiScanClass  scanNetworks(bool, bool, bool, uint32_t, uint8_t, uint8*)
   40 |         int8_t scanNetworks(bool async = false, bool show_hidden = false, bool passive = false, uint32_t max_ms_per_chan = 300, uint8_t channel = 0, uint8* ssid = NULL)
   |                ^~~~~~~~~~~~

< 82A2 batch-deferred-content class="d-inline-block" data-url="/commits/badges">
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

suggestion to change parameters of scanNetworks() to match the ones of ESP32

2 participants

0