Ersa Wearable Platform
Embedded smartwatch firmware and application framework
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | Private Attributes | List of all members
ersa::test::MockWifi Class Referencefinal

#include <mock_wifi.h>

Inheritance diagram for ersa::test::MockWifi:
Inheritance graph
[legend]
Collaboration diagram for ersa::test::MockWifi:
Collaboration graph
[legend]

Public Member Functions

Result< void > init () override
 
void enableStation () override
 
void connectStation (const char *, const char *, bool) override
 
hal::WifiState state () const override
 Return the current station/radio state.
 
bool copyLocalAddress (char *output, size_t capacity) const override
 
Result< void > startAccessPoint (const char *, const char *) override
 
void stopAccessPoint () override
 Stop access point mode.
 
bool copyAccessPointAddress (char *output, size_t capacity) const override
 Copy the access point address into a caller-owned buffer.
 
void disconnect (bool powerOff) override
 
- Public Member Functions inherited from ersa::hal::IWifiRadio
virtual ~IWifiRadio ()=default
 

Public Attributes

uint32_t enableCalls {0}
 
uint32_t disconnectCalls {0}
 

Private Attributes

hal::WifiState state_ {hal::WifiState::Off}
 

Member Function Documentation

◆ connectStation()

void ersa::test::MockWifi::connectStation ( const char *  ssid,
const char *  password,
bool  powerSave 
)
inlineoverridevirtual

Start station association with provided credentials.

Parameters
ssidNull-terminated network name.
passwordNull-terminated passphrase, or empty for an open network.
powerSaveKeep radio modem sleep enabled when coexisting with BLE. Completion is asynchronous; poll state() instead of blocking this call.

Implements ersa::hal::IWifiRadio.

◆ copyAccessPointAddress()

bool ersa::test::MockWifi::copyAccessPointAddress ( char *  output,
size_t  capacity 
) const
inlineoverridevirtual

Copy the access point address into a caller-owned buffer.

Implements ersa::hal::IWifiRadio.

◆ copyLocalAddress()

bool ersa::test::MockWifi::copyLocalAddress ( char *  output,
size_t  capacity 
) const
inlineoverridevirtual

Copy the station IPv4 address to caller storage; false means unavailable or truncated.

Implements ersa::hal::IWifiRadio.

◆ disconnect()

void ersa::test::MockWifi::disconnect ( bool  powerOff)
inlineoverridevirtual

Disconnect the active mode and optionally turn the radio off to save power.

Implements ersa::hal::IWifiRadio.

◆ enableStation()

void ersa::test::MockWifi::enableStation ( )
inlineoverridevirtual

Configure station mode before issuing a connection request.

Implements ersa::hal::IWifiRadio.

◆ init()

Result< void > ersa::test::MockWifi::init ( )
inlineoverridevirtual

Initialize the controller and release it to a known Off/Disconnected state.

Implements ersa::hal::IWifiRadio.

◆ startAccessPoint()

Result< void > ersa::test::MockWifi::startAccessPoint ( const char *  ssid,
const char *  password 
)
inlineoverridevirtual

Start a local configuration AP.

Returns
Error when credentials, radio state, or driver setup prevents AP startup.

Implements ersa::hal::IWifiRadio.

◆ state()

hal::WifiState ersa::test::MockWifi::state ( ) const
inlineoverridevirtual

Return the current station/radio state.

Implements ersa::hal::IWifiRadio.

◆ stopAccessPoint()

void ersa::test::MockWifi::stopAccessPoint ( )
inlineoverridevirtual

Stop access point mode.

Implements ersa::hal::IWifiRadio.

Member Data Documentation

◆ disconnectCalls

uint32_t ersa::test::MockWifi::disconnectCalls {0}

◆ enableCalls

uint32_t ersa::test::MockWifi::enableCalls {0}

◆ state_

hal::WifiState ersa::test::MockWifi::state_ {hal::WifiState::Off}
private

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