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)
 Enable / disable WiFi station. More...
 
bool StationClass::isEnabled ()
 Get WiFi station enable status. More...
 
bool StationClass::config (String ssid, String password, bool autoConnectOnStartup=true)
 Configure WiFi station. More...
 
void StationClass::disconnect ()
 Disconnect WiFi station from network.
 
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...
 
IPAddress StationClass::getIP ()
 Get WiFi station IP address. More...
 
String StationClass::getMAC ()
 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...
 
bool StationClass::startScan (ScanCompletedDelegate scanCompleted)
 Start WiFi station network scan. More...
 
void StationClass::waitConnection (ConnectionDelegate successfulConnected)
 Assign handler for WiFi station connection. More...
 
void StationClass::waitConnection (ConnectionDelegate successfulConnected, int secondsTimeOut, ConnectionDelegate connectionNotEstablished)
 Assign handler for WiFi station connection with timeout. More...
 
void StationClass::smartConfigStart (SmartConfigType sctype, SmartConfigDelegate callback=NULL)
 Start WiFi station smart configuration. More...
 
void StationClass::smartConfigStop ()
 Stop WiFi station smart configuration.
 
virtual void StationClass::onSystemReady ()
 Handle system ready events.
 
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.
 
uint8 BssInfo::bssid [6]
 BSS ID.
 
AUTH_MODE BssInfo::authorization
 Authorisation mode.
 
uint8 BssInfo::channel
 Channel number.
 
sint16 BssInfo::rssi
 RSSI level.
 
bool BssInfo::hidden
 True if AP is hidden.
 

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 ( String  ssid,
String  password,
bool  autoConnectOnStartup = true 
)

Configure WiFi station.

Parameters
ssidWiFi SSID
passwordWiFi password
autoConnectOnStartupTrue to auto connect. False for manual. (Default: True)
void StationClass::enable ( bool  enabled)

Enable / disable WiFi station.

Parameters
enabledTrue to enable station. False to disable.
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
IPAddress StationClass::getIP ( )

Get WiFi station IP address.

Return values
IPAddressIP address of WiFi station
String StationClass::getMAC ( )

Get WiFi station MAC address.

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 ( )

Get BSS open status.

Return values
boolTrue if BSS open
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 = NULL 
)

Start WiFi station smart configuration.

Parameters
sctypeSmart configuration type
callbackFunction to call on WiFi staton smart configuration complete (Default: none)
bool StationClass::startScan ( ScanCompletedDelegate  scanCompleted)

Start WiFi station network scan.

Parameters
scanCompletedFunction to call when scan completes
Return values
boolTrue on success
void StationClass::waitConnection ( ConnectionDelegate  successfulConnected)

Assign handler for WiFi station connection.

Parameters
successfulConnectedFunction to call when WiFi station connects to network
void StationClass::waitConnection ( ConnectionDelegate  successfulConnected,
int  secondsTimeOut,
ConnectionDelegate  connectionNotEstablished 
)

Assign handler for WiFi station connection with timeout.

Parameters
successfulConnectedFunction to call when WiFi station connects to network
secondsTimeOutQuantity of seconds to wait for connection
connectionNotEstablishedFunction to call if WiFi station fails to connect to network