mirror of
https://github.com/MrUnknownDE/OpenIris-ESPIDF.git
synced 2026-04-18 22:13:45 +02:00
30 lines
572 B
C++
30 lines
572 B
C++
#pragma once
|
|
#ifndef WIFI_SCANNER_HPP
|
|
#define WIFI_SCANNER_HPP
|
|
|
|
#include <string>
|
|
#include <vector>
|
|
#include "esp_log.h"
|
|
#include "esp_wifi.h"
|
|
|
|
struct WiFiNetwork
|
|
{
|
|
std::string ssid;
|
|
uint8_t channel;
|
|
int8_t rssi;
|
|
uint8_t mac[6];
|
|
wifi_auth_mode_t auth_mode;
|
|
};
|
|
|
|
class WiFiScanner
|
|
{
|
|
public:
|
|
WiFiScanner();
|
|
std::vector<WiFiNetwork> scanNetworks(int timeout_ms = 15000);
|
|
static void scanResultCallback(void* arg, esp_event_base_t event_base, int32_t event_id, void* event_data);
|
|
|
|
private:
|
|
std::vector<WiFiNetwork> networks;
|
|
};
|
|
|
|
#endif |