Uniot Core
0.8.1
Loading...
Searching...
No Matches
uniot::ESP32WifiScan Class Reference

WiFi network scanner implementation for ESP32. More...

#include <WiFiNetworkScan.h>

Public Member Functions

 ESP32WifiScan ()
 Construct a new ESP32 WiFi scanner.
 
TaskScheduler::TaskPtr getTask ()
 Get the scan completion monitoring task.
 
void scanNetworksAsync (std::function< void(int)> onComplete, bool showHidden=false)
 Start asynchronous WiFi network scan.
 

Static Public Member Functions

static int isSecured (int encryptionType)
 Check if a network uses encryption.
 

Detailed Description

WiFi network scanner implementation for ESP32.

This class provides WiFi network scanning functionality specifically for ESP32 microcontrollers. Since ESP32's WiFi library doesn't provide native callback support for scan completion, this implementation uses a scheduled task to poll for scan completion and trigger the callback.

Constructor & Destructor Documentation

◆ ESP32WifiScan()

uniot::ESP32WifiScan::ESP32WifiScan ( )
inline

Construct a new ESP32 WiFi scanner.

Initializes the scanner and creates a scheduled task for monitoring scan completion status.

Member Function Documentation

◆ getTask()

TaskScheduler::TaskPtr uniot::ESP32WifiScan::getTask ( )
inline

Get the scan completion monitoring task.

Return values
TaskScheduler::TaskPtrPointer to the task that monitors scan completion
Note
This task must be added to a TaskScheduler for the scanner to work properly

◆ isSecured()

static int uniot::ESP32WifiScan::isSecured ( int encryptionType)
inlinestatic

Check if a network uses encryption.

Parameters
encryptionTypeThe encryption type returned by WiFi scan
Return values
int1 if network is secured, 0 if open

◆ scanNetworksAsync()

void uniot::ESP32WifiScan::scanNetworksAsync ( std::function< void(int)> onComplete,
bool showHidden = false )
inline

Start asynchronous WiFi network scan.

Parameters
onCompleteCallback function called when scan completes with network count
showHiddenWhether to include hidden networks in scan results
Note
The scan completion task will be automatically attached with 500ms interval

The documentation for this class was generated from the following file: