WiFi station class. More...
#include <Station.h>
Public Member Functions | |
virtual | ~StationClass () |
virtual void | enable (bool enabled, bool save=false)=0 |
Enable / disable WiFi station. More... | |
virtual bool | isEnabled () const =0 |
Get WiFi station enable status. More... | |
virtual bool | config (const String &ssid, const String &password, bool autoConnectOnStartup=true, bool save=true)=0 |
Configure WiFi station. More... | |
virtual bool | connect ()=0 |
Connect WiFi station to network. More... | |
virtual bool | disconnect ()=0 |
Disconnect WiFi station from network. More... | |
bool | isConnected () const |
Get WiFi station connectoin status. More... | |
bool | isConnectionFailed () const |
Get WiFi station connection failure status. More... | |
virtual StationConnectionStatus | getConnectionStatus () const =0 |
Get WiFi station connection status. More... | |
String | getConnectionStatusName () const |
Get WiFi station connection status name. More... | |
virtual bool | isEnabledDHCP () const =0 |
Get WiFi station DHCP enabled status. More... | |
virtual void | enableDHCP (bool enable)=0 |
Enable or disable WiFi station DHCP. More... | |
virtual void | setHostname (const String &hostname)=0 |
Set WiFi station DHCP hostname. More... | |
virtual String | getHostname () const =0 |
Set WiFi station DHCP hostname. More... | |
virtual IpAddress | getIP () const =0 |
Get WiFi station IP address. More... | |
virtual MacAddress | getMacAddress () const =0 |
Get WiFi station MAC address. More... | |
String | getMAC (char sep='\0') const |
Get WiFi station MAC address. More... | |
virtual bool | setMacAddress (const MacAddress &addr) const =0 |
Set WiFi station MAC address. More... | |
virtual IpAddress | getNetworkMask () const =0 |
Get WiFi station network mask. More... | |
virtual IpAddress | getNetworkGateway () const =0 |
Get WiFi station default gateway. More... | |
virtual IpAddress | getNetworkBroadcast () const =0 |
GetWiFi station broadcast address. More... | |
bool | isLocal (IpAddress address) |
Determine if the given address is on the same subnet. More... | |
bool | setIP (IpAddress address) |
Set WiFi station IP address. More... | |
virtual bool | setIP (IpAddress address, IpAddress netmask, IpAddress gateway)=0 |
Set WiFi station IP parameters. More... | |
virtual String | getSSID () const =0 |
Get WiFi station SSID. More... | |
virtual String | getPassword () const =0 |
Get WiFi station password. More... | |
virtual int8_t | getRssi () const =0 |
Get WiFi signal strength. More... | |
virtual uint8_t | getChannel () const =0 |
Get active WiFi channel. More... | |
virtual bool | startScan (ScanCompletedDelegate scanCompleted)=0 |
Start WiFi station network scan. More... | |
Protected Attributes | |
ScanCompletedDelegate | scanCompletedCallback = nullptr |
Detailed Description
WiFi station class.
Constructor & Destructor Documentation
◆ ~StationClass()
|
inlinevirtual |
Member Function Documentation
◆ config()
|
pure virtual |
Configure WiFi station.
- Parameters
-
ssid WiFi SSID password WiFi password autoConnectOnStartup True to auto connect. False for manual. (Default: True) save True to save the SSID and password in Flash. False otherwise. (Default: True)
◆ connect()
|
pure virtual |
Connect WiFi station to network.
◆ disconnect()
|
pure virtual |
Disconnect WiFi station from network.
◆ enable()
Enable / disable WiFi station.
- Note
- Disabling WiFi station will also disable and clear the handler set with waitConnection.
- Parameters
-
enabled True to enable station. False to disable. save True to save operational mode to flash, False to set current operational mode only
◆ enableDHCP()
|
pure virtual |
Enable or disable WiFi station DHCP.
- Parameters
-
enable True to enable WiFi station DHCP
◆ getChannel()
|
pure virtual |
Get active WiFi channel.
- Return values
-
uint8_t channel number
◆ getConnectionStatus()
|
pure virtual |
Get WiFi station connection status.
- Return values
-
StationConnectionStatus Connection status structure
◆ getConnectionStatusName()
String StationClass::getConnectionStatusName | ( | ) | const |
◆ getHostname()
|
pure virtual |
Set WiFi station DHCP hostname.
- Return values
-
WiFi station DHCP hostname
◆ getIP()
|
pure virtual |
Get WiFi station IP address.
- Return values
-
IpAddress IP address of WiFi station
◆ getMAC()
String StationClass::getMAC | ( | char | sep = '\0' | ) | const |
Get WiFi station MAC address.
- Parameters
-
sep Optional separator between bytes (e.g. ':')
- Return values
-
String WiFi station MAC address
◆ getMacAddress()
|
pure virtual |
Get WiFi station MAC address.
- Return values
-
MacAddress
◆ getNetworkBroadcast()
|
pure virtual |
GetWiFi station broadcast address.
- Return values
-
IpAddress WiFi station broadcast address
◆ getNetworkGateway()
|
pure virtual |
Get WiFi station default gateway.
- Return values
-
IpAddress WiFi station default gateway
◆ getNetworkMask()
|
pure virtual |
Get WiFi station network mask.
- Return values
-
IpAddress WiFi station network mask
◆ getPassword()
|
pure virtual |
Get WiFi station password.
- Return values
-
String WiFi station password
◆ getRssi()
|
pure virtual |
Get WiFi signal strength.
- Return values
-
int8_t Value in dBm
◆ getSSID()
|
pure virtual |
Get WiFi station SSID.
- Return values
-
String WiFi station SSID
◆ isConnected()
bool StationClass::isConnected | ( | ) | const |
Get WiFi station connectoin status.
- Return values
-
bool True if connected.
◆ isConnectionFailed()
bool StationClass::isConnectionFailed | ( | ) | const |
Get WiFi station connection failure status.
- Return values
-
bool True if connection failed
◆ isEnabled()
|
pure virtual |
Get WiFi station enable status.
- Return values
-
bool True if WiFi station enabled
◆ isEnabledDHCP()
|
pure virtual |
Get WiFi station DHCP enabled status.
- Return values
-
bool True if DHCP enabled
◆ isLocal()
Determine if the given address is on the same subnet.
- Parameters
-
address
- Return values
-
bool true if address is local
- Note
- Use to prevent external access to services
◆ setHostname()
|
pure virtual |
Set WiFi station DHCP hostname.
- Parameters
-
hostname - WiFi station DHCP hostname
◆ setIP() [1/2]
Set WiFi station IP address.
- Parameters
-
address IP address
- Return values
-
bool True on success
◆ setIP() [2/2]
|
pure virtual |
Set WiFi station IP parameters.
- Parameters
-
address IP address netmask Network mask gateway Default gatway
- Return values
-
bool True on success
◆ setMacAddress()
|
pure virtual |
Set WiFi station MAC address.
- Parameters
-
addr The new MAC address
- Return values
-
bool true on success
Must be called from init()
before activating station. Espressif place certain limitations on MAC addresses:
Bit 0 of the first byte of the MAC address can not be 1. For example:
OK: "1a:XX:XX:XX:XX:XX" NOT OK: "15:XX:XX:XX:XX:XX"
◆ startScan()
|
pure virtual |
Start WiFi station network scan.
- Parameters
-
scanCompleted Function to call when scan completes
- Return values
-
bool True on success
Member Data Documentation
◆ scanCompletedCallback
|
protected |
The documentation for this class was generated from the following file: