LWIPBP3595Interface library for mbed-os.

Dependents:   LWIPBP3595Interface_STA_for_mbed-os

Fork of LWIPBP3595Interface by Rohm

Embed: (wiki syntax)

« Back to documentation index

LWIPBP3595Interface Class Reference

LWIPBP3595Interface Class Reference

EthernetInterface class Implementation of the NetworkStack for LWIP. More...

#include <LWIPBP3595Interface.h>

Public Member Functions

 LWIPBP3595Interface ()
 LWIPBP3595Interface lifetime.
virtual nsapi_error_t set_network (const char *ip_address, const char *netmask, const char *gateway)
 Set a static IP address.
virtual nsapi_error_t set_dhcp (bool dhcp)
 Enable or disable DHCP on the network.
virtual nsapi_error_t set_credentials (const char *ssid, const char *pass, nsapi_security_t security=NSAPI_SECURITY_WPA_WPA2)
 Set the WiFi network credentials.
virtual nsapi_error_t set_channel (uint8_t channel)
 Set the WiFi network channel.
virtual int8_t get_rssi ()
 Gets the current radio signal strength for active connection.
virtual nsapi_error_t connect (const char *ssid, const char *pass, nsapi_security_t security=NSAPI_SECURITY_WPA2, uint8_t channel=0)
 Start the interface.
virtual nsapi_error_t connect ()
 Start the interface.
virtual nsapi_error_t disconnect ()
 Stop the interface.
virtual nsapi_size_or_error_t scan (WiFiAccessPoint *res, unsigned count)
 Scan for available networks.
virtual const char * get_mac_address ()
 Get the local MAC address.
virtual const char * get_ip_address ()
 Get the local IP address.
virtual const char * get_netmask ()
 Get the local network mask.
virtual const char * get_gateway ()
 Get the local gateways.

Protected Member Functions

virtual NetworkStack * get_stack ()
 Provide access to the underlying stack.

Detailed Description

EthernetInterface class Implementation of the NetworkStack for LWIP.

Definition at line 31 of file LWIPBP3595Interface.h.


Constructor & Destructor Documentation

LWIPBP3595Interface lifetime.

Definition at line 141 of file LWIPBP3595Interface.cpp.


Member Function Documentation

nsapi_error_t connect ( const char *  ssid,
const char *  pass,
nsapi_security_t  security = NSAPI_SECURITY_WPA2,
uint8_t  channel = 0 
) [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

Definition at line 210 of file LWIPBP3595Interface.cpp.

nsapi_error_t connect (  ) [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

Definition at line 217 of file LWIPBP3595Interface.cpp.

nsapi_error_t disconnect (  ) [virtual]

Stop the interface.

Returns:
0 on success, negative on failure

Definition at line 240 of file LWIPBP3595Interface.cpp.

const char * get_gateway (  ) [virtual]

Get the local gateways.

Returns:
Null-terminated representation of the local gateway or null if no network mask has been recieved

Definition at line 346 of file LWIPBP3595Interface.cpp.

const char * get_ip_address (  ) [virtual]

Get the local IP address.

Returns:
Null-terminated representation of the local IP address or null if no IP address has been recieved

Definition at line 328 of file LWIPBP3595Interface.cpp.

const char * get_mac_address (  ) [virtual]

Get the local MAC address.

Provided MAC address is intended for info or debug purposes and may not be provided if the underlying network interface does not provide a MAC address

Returns:
Null-terminated representation of the local MAC address or null if no MAC address is available

Definition at line 323 of file LWIPBP3595Interface.cpp.

const char * get_netmask (  ) [virtual]

Get the local network mask.

Returns:
Null-terminated representation of the local network mask or null if no network mask has been recieved

Definition at line 337 of file LWIPBP3595Interface.cpp.

int8_t get_rssi (  ) [virtual]

Gets the current radio signal strength for active connection.

Returns:
Connection strength in dBm (negative value), or 0 if measurement impossible

Definition at line 194 of file LWIPBP3595Interface.cpp.

NetworkStack * get_stack (  ) [protected, virtual]

Provide access to the underlying stack.

Returns:
The underlying network stack

Definition at line 355 of file LWIPBP3595Interface.cpp.

nsapi_size_or_error_t scan ( WiFiAccessPoint *  res,
unsigned  count 
) [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 is grater than 0 and the ap is not NULL it'll be populated with discovered networks up to value of count.

Parameters:
apPointer to allocated array to store discovered AP
countSize of allocated res array, or 0 to only count available AP
Returns:
Number of entries in , or if count was 0 number of available networks, negative on error see nsapi_error

Definition at line 245 of file LWIPBP3595Interface.cpp.

nsapi_error_t set_channel ( uint8_t  channel ) [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

Definition at line 174 of file LWIPBP3595Interface.cpp.

nsapi_error_t set_credentials ( const char *  ssid,
const char *  pass,
nsapi_security_t  security = NSAPI_SECURITY_WPA_WPA2 
) [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

Definition at line 161 of file LWIPBP3595Interface.cpp.

nsapi_error_t set_dhcp ( bool  dhcp ) [virtual]

Enable or disable DHCP on the network.

Requires that the network is disconnected

Parameters:
dhcpFalse to disable dhcp (defaults to enabled)
Returns:
0 on success, negative error code on failure

Definition at line 155 of file LWIPBP3595Interface.cpp.

nsapi_error_t set_network ( const char *  ip_address,
const char *  netmask,
const char *  gateway 
) [virtual]

Set a static IP address.

Configures this network interface to use a static IP address. Implicitly disables DHCP, which can be enabled in set_dhcp. Requires that the network is disconnected.

Parameters:
addressNull-terminated representation of the local IP address
netmaskNull-terminated representation of the local network mask
gatewayNull-terminated representation of the local gateway
Returns:
0 on success, negative error code on failure

Definition at line 146 of file LWIPBP3595Interface.cpp.