esp32_marauder/WiFiScan.cpp
// Function to stop all wifi scans
Function to stop all wifi scans
Function to stop all wifi scans
void WiFiScan::StopScan(uint8_t scan_mode)
{
  if ((currentScanMode == WIFI_SCAN_PROBE) ||
  (currentScanMode == WIFI_SCAN_AP) ||
  (currentScanMode == WIFI_SCAN_PWN) ||
  (currentScanMode == WIFI_SCAN_ESPRESSIF) ||
  (currentScanMode == WIFI_SCAN_EAPOL) ||
  (currentScanMode == WIFI_SCAN_ALL) ||
  (currentScanMode == WIFI_SCAN_DEAUTH) ||
  (currentScanMode == WIFI_ATTACK_BEACON_SPAM) ||
  (currentScanMode == WIFI_ATTACK_RICK_ROLL) ||
  (currentScanMode == WIFI_PACKET_MONITOR))
  {
    Serial.println("Ahhh yes...promiscuity will end");
    esp_wifi_set_promiscuous(false);
    WiFi.mode(WIFI_OFF);
    esp_wifi_set_mode(WIFI_MODE_NULL);
    esp_wifi_stop();
    esp_wifi_deinit();
  }
  else if ((currentScanMode == BT_SCAN_ALL) ||
  (currentScanMode == BT_SCAN_SKIMMERS))
  {
    Serial.println("Stopping BLE scan...");
    pBLEScan->stop();
    Serial.println("BLE Scan Stopped");
    Serial.println("Clearing BLE Results...");
    pBLEScan->clearResults();
    Serial.println("Deinitializing BT Controller...");
    BLEDevice::deinit();
  }
  display_obj.display_buffer->clear();
  Serial.print("display_buffer->size(): ");
  Serial.println(display_obj.display_buffer->size());
  display_obj.tteBar = false;
}
void WiFiScan :: StopScan ( uint8_t scan_mode ) { if ( ( currentScanMode == WIFI_SCAN_PROBE ) || ( currentScanMode == WIFI_SCAN_AP ) || ( currentScanMode == WIFI_SCAN_PWN ) || ( currentScanMode == WIFI_SCAN_ESPRESSIF ) || ( currentScanMode == WIFI_SCAN_EAPOL ) || ( currentScanMode == WIFI_SCAN_ALL ) || ( currentScanMode == WIFI_SCAN_DEAUTH ) || ( currentScanMode == WIFI_ATTACK_BEACON_SPAM ) || ( currentScanMode == WIFI_ATTACK_RICK_ROLL ) || ( currentScanMode == WIFI_PACKET_MONITOR ) ) { Serial . println ( " " ) ; esp_wifi_set_promiscuous ( false ) ; WiFi . mode ( WIFI_OFF ) ; esp_wifi_set_mode ( WIFI_MODE_NULL ) ; esp_wifi_stop ( ) ; esp_wifi_deinit ( ) ; } else if ( ( currentScanMode == BT_SCAN_ALL ) || ( currentScanMode == BT_SCAN_SKIMMERS ) ) { Serial . println ( " " ) ; pBLEScan -> stop ( ) ; Serial . println ( " " ) ; Serial . println ( " " ) ; pBLEScan -> clearResults ( ) ; Serial . println ( " " ) ; BLEDevice :: deinit ( ) ; } display_obj . display_buffer -> clear ( ) ; Serial . print ( " " ) ; Serial . println ( display_obj . display_buffer -> size ( ) ) ; display_obj . tteBar = false ; }
Function to stop all wifi scans
Function to stop all wifi scans
//Serial.println("Disable and Deinit BLE..."); //esp_bt_controller_disable(); //esp_bt_controller_deinit(); //Serial.println("Releasing BLE Memory..."); //esp_bt_controller_mem_release(ESP_BT_MODE_BLE); //Serial.println("BT Controller Status: " + (String)esp_bt_controller_get_status());