52 lines
1.7 KiB
C++
52 lines
1.7 KiB
C++
#pragma once
|
|
|
|
#include "board.h"
|
|
#include <wifi_station.h>
|
|
#include <wifi_configuration_ap.h>
|
|
#include <ssid_manager.h>
|
|
#include <esp_network.h>
|
|
|
|
#include <string>
|
|
|
|
class WifiBoard : public Board {
|
|
public:
|
|
WifiBoard();
|
|
|
|
// When true, WiFi timeout returns instead of entering BLE config.
|
|
// Used by DualNetworkBoard to fall through to 4G.
|
|
void SetSkipBleOnTimeout(bool skip) { skip_ble_on_timeout_ = skip; }
|
|
|
|
std::string GetBoardType() const override { return "wifi"; }
|
|
|
|
// True if this boot was triggered by force_ap (e.g. double-click WiFi config).
|
|
// Application uses this to skip the boot prompt and avoid overlapping with
|
|
// the wifi_config prompt played by EnterBleConfigMode.
|
|
bool IsWifiConfigMode() const { return wifi_config_mode_; }
|
|
|
|
AudioCodec* GetAudioCodec() override { return nullptr; }
|
|
Led* GetLed() override { return nullptr; }
|
|
NetworkInterface* GetNetwork() override;
|
|
void StartNetwork() override;
|
|
bool IsNetworkConnected() const override;
|
|
//2026-6-24 ckkj debug
|
|
void StopNetwork() override;
|
|
void SetPowerSaveMode(bool enabled) override;
|
|
|
|
protected:
|
|
// BLE provisioning (replaces WiFi AP mode)
|
|
void EnterBleConfigMode();
|
|
|
|
// Scan WiFi networks BEFORE BLE starts and cache the results into BleProv.
|
|
// ESP32-S3 BLE/WiFi coexistence prevents notifications from delivering
|
|
// when esp_wifi_scan_start runs during an active BLE connection, so the
|
|
// scan must happen while BLE is still inactive.
|
|
void PreScanWifiForBleProv();
|
|
|
|
// Legacy WiFi AP provisioning (kept for fallback, not used by default)
|
|
void EnterWifiConfigMode();
|
|
|
|
bool wifi_config_mode_ = false;
|
|
bool wifi_initialized_ = false;
|
|
bool skip_ble_on_timeout_ = false;
|
|
};
|