SPSP
Simple publish-subscribe protocol. Connects low power IoT clients to MQTT.
All Classes Files Functions Variables Typedefs Enumerations
Public Member Functions | List of all members
SPSP::WiFi::Station Class Reference

WiFi station for ESP platform. More...

#include <wifi_station.hpp>

Inheritance diagram for SPSP::WiFi::Station:
Inheritance graph
[legend]
Collaboration diagram for SPSP::WiFi::Station:
Collaboration graph
[legend]

Public Member Functions

 Station (const StationConfig &config)
 Constructs new WiFi station object and initializes connection. More...
 
virtual ~Station ()
 Disconnects from AP and destroys WiFi station. More...
 
uint8_t getChannel ()
 Gets current WiFi channel. More...
 
void setChannel (uint8_t ch)
 Sets current channel. More...
 
void setChannelRestrictions (const ChannelRestrictions &rest)
 Sets channel restrictions. More...
 
const ChannelRestrictions getChannelRestrictions ()
 Get the Channel Restrictions object. More...
 

Detailed Description

WiFi station for ESP platform.

There may be only one instance at a time (despite of not being implemented as singleton).

If config contains empty SSID, only functions as ESP-NOW transceiver.

All roaming features and WPA3 are enabled by default.

Implements ESP-NOW interface requirements.

Time is synchronized using SNTP server automatically during construction if connection to AP is established successfully (typically on bridge node).

Definition at line 78 of file wifi_station.hpp.

Constructor & Destructor Documentation

◆ Station()

SPSP::WiFi::Station::Station ( const StationConfig config)

Constructs new WiFi station object and initializes connection.

Parameters
configConfiguration
Exceptions
ConnectionErrorwhen connection cannot be established within configured timeout

◆ ~Station()

virtual SPSP::WiFi::Station::~Station ( )
virtual

Disconnects from AP and destroys WiFi station.

Member Function Documentation

◆ getChannel()

uint8_t SPSP::WiFi::Station::getChannel ( )
virtual

Gets current WiFi channel.

Returns
Channel number

Implements SPSP::WiFi::IESPNOW.

◆ getChannelRestrictions()

const ChannelRestrictions SPSP::WiFi::Station::getChannelRestrictions ( )
virtual

Get the Channel Restrictions object.

Returns
const ChannelRestrictions

Implements SPSP::WiFi::IESPNOW.

◆ setChannel()

void SPSP::WiFi::Station::setChannel ( uint8_t  ch)
virtual

Sets current channel.

Parameters
chChannel

Implements SPSP::WiFi::IESPNOW.

◆ setChannelRestrictions()

void SPSP::WiFi::Station::setChannelRestrictions ( const ChannelRestrictions rest)

Sets channel restrictions.

Set lowest and highest usable WiFi channel (legal country restrictions).

Parameters
restRestrictions

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