mirror of
https://github.com/0xFEEDC0DE64/arduino-esp32.git
synced 2025-07-05 06:46:31 +02:00
Update IDF to aaf1239 (#1539)
* fix sdmmc config * Fix warnings in EEPROM from @Curclamas * remove leftover TAG in EEPROM * Initial add of @stickbreaker i2c * Add log_n * fix warnings when log is off * i2c code clean up and reorganization * add flags to interrupt allocator * fix sdmmc config * Fix warnings in EEPROM from @Curclamas * remove leftover TAG in EEPROM * fix errors with latest IDF * fix debug optimization (#1365) incorrect optimization for debugging tick markers. * Fix some missing BT header * Change BTSerial log calls * Update BLE lib * Arduino-ESP32 release management scripted (#1515) * Calculate an absolute path for a custom partitions table (#1452) * * Arduino-ESP32 release management scripted (ready-to-merge) * * secure env for espressif/arduino-esp32 * * build tests enabled * gitter webhook enabled * * gitter room link fixed * better comment * * filepaths fixed * BT Serial adjustments * * don't run sketch builds & tests for tagged builds * Return false from WiFi.hostByName() if hostname is not resolved * Free BT Memory when BT is not used * WIFI_MODE_NULL is not supported anymore * Select some key examples to build with PlatformIO to save some time * Update BLE lib * Fixed BLE lib * Major WiFi overhaul - auto reconnect on connection loss now works - moved to event groups - some code clean up and procedure optimizations - new methods to get a more elaborate system ststus * Add cmake tests to travis * Add initial AsyncUDP * Add NetBIOS lib and fix CMake includes * Add Initial WebServer * Fix WebServer and examples * travis not quiting on build fail * Try different travis build * Update IDF to aaf1239 * Fix WPS Example * fix script permission and add some fail tests to sketch builder * Add missing space in WiFiClient::write(Stream &stream)
This commit is contained in:
@ -42,8 +42,6 @@ extern "C" {
|
||||
}
|
||||
|
||||
bool WiFiScanClass::_scanAsync = false;
|
||||
bool WiFiScanClass::_scanStarted = false;
|
||||
bool WiFiScanClass::_scanComplete = false;
|
||||
|
||||
uint16_t WiFiScanClass::_scanCount = 0;
|
||||
void* WiFiScanClass::_scanResult = 0;
|
||||
@ -56,7 +54,7 @@ void* WiFiScanClass::_scanResult = 0;
|
||||
*/
|
||||
int16_t WiFiScanClass::scanNetworks(bool async, bool show_hidden, bool passive, uint32_t max_ms_per_chan)
|
||||
{
|
||||
if(WiFiScanClass::_scanStarted) {
|
||||
if(WiFiGenericClass::getStatusBits() & WIFI_SCANNING_BIT) {
|
||||
return WIFI_SCAN_RUNNING;
|
||||
}
|
||||
|
||||
@ -80,20 +78,17 @@ int16_t WiFiScanClass::scanNetworks(bool async, bool show_hidden, bool passive,
|
||||
config.scan_time.active.max = max_ms_per_chan;
|
||||
}
|
||||
if(esp_wifi_scan_start(&config, false) == ESP_OK) {
|
||||
WiFiScanClass::_scanComplete = false;
|
||||
WiFiScanClass::_scanStarted = true;
|
||||
WiFiGenericClass::clearStatusBits(WIFI_SCAN_DONE_BIT);
|
||||
WiFiGenericClass::setStatusBits(WIFI_SCANNING_BIT);
|
||||
|
||||
if(WiFiScanClass::_scanAsync) {
|
||||
return WIFI_SCAN_RUNNING;
|
||||
}
|
||||
while(!(WiFiScanClass::_scanComplete)) {
|
||||
delay(10);
|
||||
if(WiFiGenericClass::waitStatusBits(WIFI_SCAN_DONE_BIT, 10000)){
|
||||
return (int16_t) WiFiScanClass::_scanCount;
|
||||
}
|
||||
return (int16_t) WiFiScanClass::_scanCount;
|
||||
} else {
|
||||
return WIFI_SCAN_FAILED;
|
||||
}
|
||||
|
||||
return WIFI_SCAN_FAILED;
|
||||
}
|
||||
|
||||
|
||||
@ -105,18 +100,15 @@ int16_t WiFiScanClass::scanNetworks(bool async, bool show_hidden, bool passive,
|
||||
*/
|
||||
void WiFiScanClass::_scanDone()
|
||||
{
|
||||
WiFiScanClass::_scanComplete = true;
|
||||
WiFiScanClass::_scanStarted = false;
|
||||
esp_wifi_scan_get_ap_num(&(WiFiScanClass::_scanCount));
|
||||
if(WiFiScanClass::_scanCount) {
|
||||
WiFiScanClass::_scanResult = new wifi_ap_record_t[WiFiScanClass::_scanCount];
|
||||
if(WiFiScanClass::_scanResult) {
|
||||
esp_wifi_scan_get_ap_records(&(WiFiScanClass::_scanCount), (wifi_ap_record_t*)_scanResult);
|
||||
} else {
|
||||
//no memory
|
||||
if(!WiFiScanClass::_scanResult || esp_wifi_scan_get_ap_records(&(WiFiScanClass::_scanCount), (wifi_ap_record_t*)_scanResult) != ESP_OK) {
|
||||
WiFiScanClass::_scanCount = 0;
|
||||
}
|
||||
}
|
||||
WiFiGenericClass::setStatusBits(WIFI_SCAN_DONE_BIT);
|
||||
WiFiGenericClass::clearStatusBits(WIFI_SCANNING_BIT);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -126,7 +118,7 @@ void WiFiScanClass::_scanDone()
|
||||
*/
|
||||
void * WiFiScanClass::_getScanInfoByIndex(int i)
|
||||
{
|
||||
if(!WiFiScanClass::_scanResult || (size_t) i > WiFiScanClass::_scanCount) {
|
||||
if(!WiFiScanClass::_scanResult || (size_t) i >= WiFiScanClass::_scanCount) {
|
||||
return 0;
|
||||
}
|
||||
return reinterpret_cast<wifi_ap_record_t*>(WiFiScanClass::_scanResult) + i;
|
||||
@ -138,15 +130,14 @@ void * WiFiScanClass::_getScanInfoByIndex(int i)
|
||||
* -1 if scan not fin
|
||||
* -2 if scan not triggered
|
||||
*/
|
||||
int8_t WiFiScanClass::scanComplete()
|
||||
int16_t WiFiScanClass::scanComplete()
|
||||
{
|
||||
|
||||
if(_scanStarted) {
|
||||
return WIFI_SCAN_RUNNING;
|
||||
if(WiFiGenericClass::getStatusBits() & WIFI_SCAN_DONE_BIT) {
|
||||
return WiFiScanClass::_scanCount;
|
||||
}
|
||||
|
||||
if(_scanComplete) {
|
||||
return WiFiScanClass::_scanCount;
|
||||
if(WiFiGenericClass::getStatusBits() & WIFI_SCANNING_BIT) {
|
||||
return WIFI_SCAN_RUNNING;
|
||||
}
|
||||
|
||||
return WIFI_SCAN_FAILED;
|
||||
@ -157,12 +148,12 @@ int8_t WiFiScanClass::scanComplete()
|
||||
*/
|
||||
void WiFiScanClass::scanDelete()
|
||||
{
|
||||
WiFiGenericClass::clearStatusBits(WIFI_SCAN_DONE_BIT);
|
||||
if(WiFiScanClass::_scanResult) {
|
||||
delete[] reinterpret_cast<wifi_ap_record_t*>(WiFiScanClass::_scanResult);
|
||||
WiFiScanClass::_scanResult = 0;
|
||||
WiFiScanClass::_scanCount = 0;
|
||||
}
|
||||
_scanComplete = false;
|
||||
}
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user