Sming Framework API
Sming - Open Source framework for high efficiency WiFi SoC ESP8266 native development with C++ language.
WiFi Station Interface

Control and monitoring of WiFi station interface. More...

Functions

void StationClass::enable (bool enabled, bool save=false)
 Enable / disable WiFi station. More...
 
bool StationClass::isEnabled ()
 Get WiFi station enable status. More...
 
bool StationClass::config (const String &ssid, const String &password, bool autoConnectOnStartup=true, bool save=true)
 Configure WiFi station. More...
 
bool StationClass::connect ()
 Connect WiFi station to network. More...
 
bool StationClass::disconnect ()
 Disconnect WiFi station from network. More...
 
bool StationClass::isConnected ()
 Get WiFi station connectoin status. More...
 
bool StationClass::isConnectionFailed ()
 Get WiFi station connection failure status. More...
 
EStationConnectionStatus StationClass::getConnectionStatus ()
 Get WiFi station connection status. More...
 
const char * StationClass::getConnectionStatusName ()
 Get WiFi station connection status name. More...
 
bool StationClass::isEnabledDHCP ()
 Get WiFi station DHCP enabled status. More...
 
void StationClass::enableDHCP (bool enable)
 Enable or disable WiFi station DHCP. More...
 
void StationClass::setHostname (const String &hostname)
 Set WiFi station DHCP hostname. More...
 
String StationClass::getHostname ()
 Set WiFi station DHCP hostname. More...
 
IPAddress StationClass::getIP ()
 Get WiFi station IP address. More...
 
String StationClass::getMAC (char sep= '\0')
 Get WiFi station MAC address. More...
 
IPAddress StationClass::getNetworkMask ()
 Get WiFi station network mask. More...
 
IPAddress StationClass::getNetworkGateway ()
 Get WiFi station default gateway. More...
 
IPAddress StationClass::getNetworkBroadcast ()
 GetWiFi station broadcast address. More...
 
bool StationClass::setIP (IPAddress address)
 Set WiFi station IP address. More...
 
bool StationClass::setIP (IPAddress address, IPAddress netmask, IPAddress gateway)
 Set WiFi station IP parameters. More...
 
String StationClass::getSSID ()
 Get WiFi station SSID. More...
 
String StationClass::getPassword ()
 Get WiFi station password. More...
 
sint8 StationClass::getRssi ()
 
uint8 StationClass::getChannel ()
 
bool StationClass::startScan (ScanCompletedDelegate scanCompleted)
 Start WiFi station network scan. More...
 
void StationClass::smartConfigStart (SmartConfigType sctype, SmartConfigDelegate callback=nullptr)
 Start WiFi station smart configuration. More...
 
void StationClass::smartConfigStop ()
 Stop WiFi station smart configuration. More...
 
void StationClass::onSystemReady () override
 Handle system ready events. More...
 
static void StationClass::staticScanCompleted (void *arg, STATUS status)
 
void StationClass::internalCheckConnection ()
 
static void StationClass::staticCheckConnection ()
 
void StationClass::internalSmartConfig (sc_status status, void *pdata)
 
static void StationClass::staticSmartConfigCallback (sc_status status, void *pdata)
 
 BssInfo::BssInfo (bss_info *info)
 
bool BssInfo::isOpen ()
 Get BSS open status. More...
 
const char * BssInfo::getAuthorizationMethodName ()
 Get BSS authorisation method name. More...
 
uint32_t BssInfo::getHashId ()
 Get BSS hash ID. More...
 

Variables

String BssInfo::ssid
 SSID. More...
 
uint8 BssInfo::bssid [6]
 BSS ID. More...
 
AUTH_MODE BssInfo::authorization
 Authorisation mode. More...
 
uint8 BssInfo::channel
 Channel number. More...
 
sint16 BssInfo::rssi
 RSSI level. More...
 
bool BssInfo::hidden
 True if AP is hidden. More...
 

Detailed Description

Control and monitoring of WiFi station interface.

WiFi station class.

Note
The WiFi station interface provides client access to a WiFi network. Control of WiFi connection including WiFi SSID and password and IP address, DHCP, etc.
See also
WiFi Access Point

Function Documentation

bool StationClass::config ( const String ssid,
const String password,
bool  autoConnectOnStartup = true,
bool  save = true 
)

Configure WiFi station.

Parameters
ssidWiFi SSID
passwordWiFi password
autoConnectOnStartupTrue to auto connect. False for manual. (Default: True)
saveTrue to save the SSID and password in Flash. False otherwise. (Default: True)
bool StationClass::connect ( )

Connect WiFi station to network.

bool StationClass::disconnect ( )

Disconnect WiFi station from network.

void StationClass::enable ( bool  enabled,
bool  save = false 
)

Enable / disable WiFi station.

Note
Disabling WiFi station will also disable and clear the handler set with waitConnection.
Parameters
enabledTrue to enable station. False to disable.
saveTrue to save operational mode to flash, False to set current operational mode only
void StationClass::enableDHCP ( bool  enable)

Enable or disable WiFi station DHCP.

Parameters
enableTrue to enable WiFi station DHCP
const char* BssInfo::getAuthorizationMethodName ( )

Get BSS authorisation method name.

Return values
char*Pointer to c string BSS authoristation method name
EStationConnectionStatus StationClass::getConnectionStatus ( )

Get WiFi station connection status.

Return values
EStationConnectionStatusConnection status structure
const char* StationClass::getConnectionStatusName ( )

Get WiFi station connection status name.

Return values
char*Pointer to c string name of connection status
uint32_t BssInfo::getHashId ( )

Get BSS hash ID.

Return values
uint32_tBSS hash ID
String StationClass::getHostname ( )

Set WiFi station DHCP hostname.

Return values
WiFistation DHCP hostname
IPAddress StationClass::getIP ( )

Get WiFi station IP address.

Return values
IPAddressIP address of WiFi station
String StationClass::getMAC ( char  sep = '\0')

Get WiFi station MAC address.

Parameters
optionalseparator between bytes (e.g. ':')
Return values
StringWiFi station MAC address
IPAddress StationClass::getNetworkBroadcast ( )

GetWiFi station broadcast address.

Return values
IPAddressWiFi statoin broadcast address
IPAddress StationClass::getNetworkGateway ( )

Get WiFi station default gateway.

Return values
IPAddressWiFi station default gateway
IPAddress StationClass::getNetworkMask ( )

Get WiFi station network mask.

Return values
IPAddressWiFi station network mask
String StationClass::getPassword ( )

Get WiFi station password.

Return values
StringWiFi station password
String StationClass::getSSID ( )

Get WiFi station SSID.

Return values
StringWiFi station SSID
bool StationClass::isConnected ( )

Get WiFi station connectoin status.

Return values
boolTrue if connected.
bool StationClass::isConnectionFailed ( )

Get WiFi station connection failure status.

Return values
boolTrue if connection failed
bool StationClass::isEnabled ( )

Get WiFi station enable status.

Return values
boolTrue if WiFi station enabled
bool StationClass::isEnabledDHCP ( )

Get WiFi station DHCP enabled status.

Return values
boolTrue if DHCP enabled
bool BssInfo::isOpen ( )
inline

Get BSS open status.

Return values
boolTrue if BSS open
void StationClass::onSystemReady ( )
overrideprotectedvirtual

Handle system ready events.

Implements ISystemReadyHandler.

void StationClass::setHostname ( const String hostname)

Set WiFi station DHCP hostname.

Parameters
hostname- WiFi station DHCP hostname
bool StationClass::setIP ( IPAddress  address)

Set WiFi station IP address.

Parameters
addressIP address
Return values
boolTrue on success
bool StationClass::setIP ( IPAddress  address,
IPAddress  netmask,
IPAddress  gateway 
)

Set WiFi station IP parameters.

Parameters
addressIP address
netmaskNetwork mask
gatewayDefault gatway
Return values
boolTrue on success
void StationClass::smartConfigStart ( SmartConfigType  sctype,
SmartConfigDelegate  callback = nullptr 
)

Start WiFi station smart configuration.

Parameters
sctypeSmart configuration type
callbackFunction to call on WiFi staton smart configuration complete (Default: none)
void StationClass::smartConfigStop ( )

Stop WiFi station smart configuration.

bool StationClass::startScan ( ScanCompletedDelegate  scanCompleted)

Start WiFi station network scan.

Parameters
scanCompletedFunction to call when scan completes
Return values
boolTrue on success

Variable Documentation

AUTH_MODE BssInfo::authorization

Authorisation mode.

uint8 BssInfo::bssid[6]

BSS ID.

uint8 BssInfo::channel

Channel number.

bool BssInfo::hidden

True if AP is hidden.

sint16 BssInfo::rssi

RSSI level.

String BssInfo::ssid

SSID.