Mistake on this page?
Report an issue in GitHub or email us
Public Member Functions | Static Public Member Functions | Static Protected Member Functions
WiFiInterface Class Referenceabstract
Inheritance diagram for WiFiInterface:
NetworkInterface DNS

Public Member Functions

virtual nsapi_error_t set_credentials (const char *ssid, const char *pass, nsapi_security_t security=NSAPI_SECURITY_NONE)=0
 
virtual nsapi_error_t set_channel (uint8_t channel)=0
 
virtual int8_t get_rssi ()=0
 
virtual nsapi_error_t connect (const char *ssid, const char *pass, nsapi_security_t security=NSAPI_SECURITY_NONE, uint8_t channel=0)=0
 
virtual nsapi_error_t connect ()=0
 
virtual nsapi_error_t disconnect ()=0
 
virtual nsapi_size_or_error_t scan (WiFiAccessPoint *res, nsapi_size_t count)=0
 
virtual WiFiInterfacewifiInterface ()
 
- Public Member Functions inherited from NetworkInterface
virtual const char * get_mac_address ()
 
virtual const char * get_ip_address ()
 
virtual const char * get_netmask ()
 
virtual const char * get_gateway ()
 
virtual nsapi_error_t set_network (const char *ip_address, const char *netmask, const char *gateway)
 
virtual nsapi_error_t set_dhcp (bool dhcp)
 
virtual nsapi_error_t gethostbyname (const char *host, SocketAddress *address, nsapi_version_t version=NSAPI_UNSPEC)
 
virtual nsapi_value_or_error_t gethostbyname_async (const char *host, hostbyname_cb_t callback, nsapi_version_t version=NSAPI_UNSPEC)
 
virtual nsapi_error_t gethostbyname_async_cancel (int id)
 
virtual nsapi_error_t add_dns_server (const SocketAddress &address)
 
virtual void attach (mbed::Callback< void(nsapi_event_t, intptr_t)> status_cb)
 
virtual nsapi_connection_status_t get_connection_status () const
 
virtual nsapi_error_t set_blocking (bool blocking)
 
virtual EthInterfaceethInterface ()
 
virtual MeshInterfacemeshInterface ()
 
virtual CellularBasecellularBase ()
 
virtual EMACInterfaceemacInterface ()
 

Static Public Member Functions

static WiFiInterfaceget_default_instance ()
 
- Static Public Member Functions inherited from NetworkInterface
static NetworkInterfaceget_default_instance ()
 

Static Protected Member Functions

static WiFiInterfaceget_target_default_instance ()
 
- Static Protected Member Functions inherited from NetworkInterface
static NetworkInterfaceget_target_default_instance ()
 

Additional Inherited Members

- Public Types inherited from NetworkInterface
typedef mbed::Callback< void(nsapi_error_t result, SocketAddress *address)> hostbyname_cb_t
 
- Public Types inherited from DNS
typedef mbed::Callback< void(nsapi_error_t result, SocketAddress *address)> hostbyname_cb_t
 
- Protected Member Functions inherited from NetworkInterface
virtual NetworkStackget_stack ()=0
 

Member Function Documentation

virtual nsapi_error_t WiFiInterface::connect ( const char *  ssid,
const char *  pass,
nsapi_security_t  security = NSAPI_SECURITY_NONE,
uint8_t  channel = 0 
)
pure virtual

Start the interface

Attempts to connect to a WiFi network.

Parameters
ssidName of the network to connect to
passSecurity passphrase to connect to the network
securityType of encryption for connection (Default: NSAPI_SECURITY_NONE)
channelChannel on which the connection is to be made, or 0 for any (Default: 0)
Returns
0 on success, or error code on failure
virtual nsapi_error_t WiFiInterface::connect ( )
pure virtual

Start the interface

Attempts to connect to a WiFi network. Requires ssid and passphrase to be set. If passphrase is invalid, NSAPI_ERROR_AUTH_ERROR is returned.

Returns
0 on success, negative error code on failure

Implements NetworkInterface.

virtual nsapi_error_t WiFiInterface::disconnect ( )
pure virtual

Stop the interface

Returns
0 on success, or error code on failure

Implements NetworkInterface.

MBED_WEAK WiFiInterface * WiFiInterface::get_default_instance ( )
static

Get the default WiFi interface.

This is provided as a weak method so applications can override. Default behaviour is to get the target's default interface, if any.

Returns
pointer to interface, if any
virtual int8_t WiFiInterface::get_rssi ( )
pure virtual

Gets the current radio signal strength for active connection

Returns
Connection strength in dBm (negative value), or 0 if measurement impossible
MBED_WEAK WiFiInterface * WiFiInterface::get_target_default_instance ( )
staticprotected

Get the target's default WiFi interface.

This is provided as a weak method so targets can override. The default implementation returns NULL.

Returns
pointer to interface, if any
virtual nsapi_size_or_error_t WiFiInterface::scan ( WiFiAccessPoint res,
nsapi_size_t  count 
)
pure virtual

Scan for available networks

This function will block. If the count is 0, function will only return count of available networks, so that user can allocated necessary memory. If the count is grater than 0 and the a res is not NULL it'll be populated with discovered networks up to value of count.

Parameters
resPointer to allocated array to store discovered AP
countSize of allocated res array, or 0 to only count available AP
Returns
Number of entries in count, or if count was 0 number of available networks, negative on error see nsapi_error
virtual nsapi_error_t WiFiInterface::set_channel ( uint8_t  channel)
pure virtual

Set the WiFi network channel

Parameters
channelChannel on which the connection is to be made, or 0 for any (Default: 0)
Returns
0 on success, or error code on failure
virtual nsapi_error_t WiFiInterface::set_credentials ( const char *  ssid,
const char *  pass,
nsapi_security_t  security = NSAPI_SECURITY_NONE 
)
pure virtual

Set the WiFi network credentials

Parameters
ssidName of the network to connect to
passSecurity passphrase to connect to the network
securityType of encryption for connection (defaults to NSAPI_SECURITY_NONE)
Returns
0 on success, or error code on failure
virtual WiFiInterface* WiFiInterface::wifiInterface ( )
inlinevirtual

Dynamic downcast to a WiFiInterface

Reimplemented from NetworkInterface.


The documentation for this class was generated from the following files:
Important Information for this Arm website

This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies. If you are not happy with the use of these cookies, please review our Cookie Policy to learn how they can be disabled. By disabling cookies, some features of the site will not work.