ESP8266
Public Member Functions | Static Protected Member Functions | Static Protected Attributes | List of all members
ESP8266WiFiGenericClass Class Reference
Inheritance diagram for ESP8266WiFiGenericClass:
ESP8266WiFiClass

Public Member Functions

 ESP8266WiFiGenericClass ()
 
void onEvent (WiFiEventCb cbEvent, WiFiEvent_t event=WIFI_EVENT_MAX)
 
void removeEvent (WiFiEventCb cbEvent, WiFiEvent_t event=WIFI_EVENT_MAX)
 
int32_t channel (void)
 
bool setSleepMode (WiFiSleepType_t type)
 
WiFiSleepType_t getSleepMode ()
 
bool setPhyMode (WiFiPhyMode_t mode)
 
WiFiPhyMode_t getPhyMode ()
 
void setOutputPower (float dBm)
 
void persistent (bool persistent)
 
bool mode (WiFiMode_t)
 
WiFiMode_t getMode ()
 
bool enableSTA (bool enable)
 
bool enableAP (bool enable)
 
bool forceSleepBegin (uint32 sleepUs=0)
 
bool forceSleepWake ()
 
int hostByName (const char *aHostname, IPAddress &aResult)
 

Static Protected Member Functions

static void _eventCallback (void *event)
 

Static Protected Attributes

static bool _persistent = true
 
static WiFiMode_t _forceSleepLastMode = WIFI_OFF
 

Constructor & Destructor Documentation

ESP8266WiFiGenericClass::ESP8266WiFiGenericClass ( )

Member Function Documentation

void ESP8266WiFiGenericClass::_eventCallback ( void *  arg)
staticprotected

callback for WiFi events

Parameters
arg
int32_t ESP8266WiFiGenericClass::channel ( void  )

Return the current channel associated with the network

Returns
channel (1-13)
bool ESP8266WiFiGenericClass::enableAP ( bool  enable)

control AP mode

Parameters
enablebool
Returns
ok
bool ESP8266WiFiGenericClass::enableSTA ( bool  enable)

control STA mode

Parameters
enablebool
Returns
ok
bool ESP8266WiFiGenericClass::forceSleepBegin ( uint32  sleepUs = 0)

Disable WiFi for x us when value is not 0

Parameters
sleep_time_in_us
Returns
ok
bool ESP8266WiFiGenericClass::forceSleepWake ( )

wake up WiFi Modem

Returns
ok
WiFiMode_t ESP8266WiFiGenericClass::getMode ( )

get WiFi mode

Returns
WiFiMode
WiFiPhyMode_t ESP8266WiFiGenericClass::getPhyMode ( )

get phy Mode

Returns
phy_mode_t
WiFiSleepType_t ESP8266WiFiGenericClass::getSleepMode ( )

get Sleep mode

Returns
sleep_type_t
int ESP8266WiFiGenericClass::hostByName ( const char *  aHostname,
IPAddress aResult 
)

Resolve the given hostname to an IP address.

Parameters
aHostnameName to be resolved
aResultIPAddress structure to store the returned IP address
Returns
1 if aIPAddrString was successfully converted to an IP address, else error code
bool ESP8266WiFiGenericClass::mode ( WiFiMode_t  m)

set new mode

Parameters
mWiFiMode_t
void ESP8266WiFiGenericClass::onEvent ( WiFiEventCb  cbEvent,
WiFiEvent_t  event = WIFI_EVENT_MAX 
)

set callback function

Parameters
cbEventWiFiEventCb
eventoptional filter (WIFI_EVENT_MAX is all events)
void ESP8266WiFiGenericClass::persistent ( bool  persistent)

store WiFi config in SDK flash area

Parameters
persistent
void ESP8266WiFiGenericClass::removeEvent ( WiFiEventCb  cbEvent,
WiFiEvent_t  event = WIFI_EVENT_MAX 
)

removes a callback form event handler

Parameters
cbEventWiFiEventCb
eventoptional filter (WIFI_EVENT_MAX is all events)
void ESP8266WiFiGenericClass::setOutputPower ( float  dBm)

set the output power of WiFi

Parameters
dBmmax: +20.5dBm min: 0dBm
bool ESP8266WiFiGenericClass::setPhyMode ( WiFiPhyMode_t  mode)

set phy Mode

Parameters
modephy_mode_t
Returns
bool
bool ESP8266WiFiGenericClass::setSleepMode ( WiFiSleepType_t  type)

set Sleep mode

Parameters
typesleep_type_t
Returns
bool

Member Data Documentation

WiFiMode_t ESP8266WiFiGenericClass::_forceSleepLastMode = WIFI_OFF
staticprotected
bool ESP8266WiFiGenericClass::_persistent = true
staticprotected