Wi-Fi SoftAP Interface

[中文]

Public header: #include "brookesia/hal_interface/interfaces/wifi/softap.hpp"

Class: WifiSoftApIface

WifiSoftApIface defines SoftAP parameter access, SoftAP start/stop, provisioning start/stop, and callbacks for SoftAP events and explicit station actions requested by the provisioning page.

API Reference

Header File

Classes

class SoftApIface : public esp_brookesia::hal::Interface

Wi-Fi SoftAP interface for AP mode and provisioning.

Public Functions

inline SoftApIface()

Construct a SoftAP Wi-Fi interface.

virtual ~SoftApIface() = default

Virtual destructor for polymorphic interfaces.

virtual bool configure(Callbacks callbacks) = 0

Configure SoftAP callbacks.

Parameters

callbacks -- [in] Callback hooks used to report SoftAP state and requests.

Returns

true on success; otherwise false.

virtual void clear_callbacks() = 0

Clear all configured callbacks.

virtual bool set_params(const SoftApParams &params) = 0

Set SoftAP runtime parameters.

Parameters

params -- [in] SoftAP parameters.

Returns

true on success; otherwise false.

virtual const SoftApParams &get_params() const = 0

Get SoftAP runtime parameters.

Returns

SoftAP parameters.

virtual bool start() = 0

Start SoftAP mode.

Returns

true on success; otherwise false.

virtual void stop() = 0

Stop SoftAP mode.

virtual bool start_provision() = 0

Start SoftAP provisioning.

Returns

true on success; otherwise false.

virtual bool stop_provision() = 0

Stop SoftAP provisioning.

Returns

true on success; otherwise false.

Public Static Attributes

static constexpr const char *NAME = "WifiSoftAp"

Interface registry name.

struct Callbacks

Public Members

std::function<void(SoftApEvent)> on_event

Called when a SoftAP event happens.

std::function<void(const SoftApParams&)> on_params_updated

Persist backend-updated params.

std::function<bool(StationAction)> on_station_action_requested

Called when SoftAP needs station action.