From d06fa8ee70dd2541aada77007fb08bedc941323e Mon Sep 17 00:00:00 2001 From: Alan Date: Tue, 19 Jun 2018 03:32:12 -0500 Subject: [PATCH] Make scanNetworks return int16 (#1496) (#1514) --- libraries/WiFi/src/WiFiScan.cpp | 4 ++-- libraries/WiFi/src/WiFiScan.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/libraries/WiFi/src/WiFiScan.cpp b/libraries/WiFi/src/WiFiScan.cpp index 55c54a26..d5c0d690 100644 --- a/libraries/WiFi/src/WiFiScan.cpp +++ b/libraries/WiFi/src/WiFiScan.cpp @@ -54,7 +54,7 @@ void* WiFiScanClass::_scanResult = 0; * @param show_hidden show hidden networks * @return Number of discovered networks */ -int8_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) { if(WiFiScanClass::_scanStarted) { return WIFI_SCAN_RUNNING; @@ -89,7 +89,7 @@ int8_t WiFiScanClass::scanNetworks(bool async, bool show_hidden, bool passive, u while(!(WiFiScanClass::_scanComplete)) { delay(10); } - return WiFiScanClass::_scanCount; + return (int16_t) WiFiScanClass::_scanCount; } else { return WIFI_SCAN_FAILED; } diff --git a/libraries/WiFi/src/WiFiScan.h b/libraries/WiFi/src/WiFiScan.h index 6d26f0a7..d5788e4c 100644 --- a/libraries/WiFi/src/WiFiScan.h +++ b/libraries/WiFi/src/WiFiScan.h @@ -31,7 +31,7 @@ class WiFiScanClass public: - int8_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); int8_t scanComplete(); void scanDelete();