Mistake on this page?
Report an issue in GitHub or email us
Public Member Functions | Static Public Member Functions | Static Protected Member Functions
CellularBase Class Referenceabstract

#include <CellularBase.h>

Inheritance diagram for CellularBase:
NetworkInterface DNS mbed::EasyCellularConnection

Public Member Functions

virtual void set_credentials (const char *apn, const char *uname=0, const char *pwd=0)=0
 
virtual void set_sim_pin (const char *sim_pin)=0
 
virtual nsapi_error_t connect (const char *sim_pin, const char *apn=0, const char *uname=0, const char *pwd=0)=0
 
virtual nsapi_error_t connect ()=0
 
virtual nsapi_error_t disconnect ()=0
 
virtual bool is_connected ()=0
 
virtual const char * get_ip_address ()=0
 
virtual const char * get_netmask ()=0
 
virtual const char * get_gateway ()=0
 
virtual CellularBasecellularBase ()
 
- Public Member Functions inherited from NetworkInterface
virtual const char * get_mac_address ()
 
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 WiFiInterfacewifiInterface ()
 
virtual MeshInterfacemeshInterface ()
 
virtual EMACInterfaceemacInterface ()
 

Static Public Member Functions

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

Static Protected Member Functions

static CellularBaseget_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
 

Detailed Description

CellularBase class

Common interface that is shared between Cellular interfaces

Member Function Documentation

virtual CellularBase* CellularBase::cellularBase ( )
inlinevirtual

Dynamic downcast to a CellularBase

Reimplemented from NetworkInterface.

virtual nsapi_error_t CellularBase::connect ( const char *  sim_pin,
const char *  apn = 0,
const char *  uname = 0,
const char *  pwd = 0 
)
pure virtual

Start the interface

Attempts to connect to a Cellular network.

Parameters
sim_pinPIN for the SIM card
apnoptionally, access point name
unameoptionally, Username
pwdoptionally, password
Returns
NSAPI_ERROR_OK on success, or negative error code on failure

Implemented in mbed::EasyCellularConnection.

virtual nsapi_error_t CellularBase::connect ( )
pure virtual

Start the interface

Attempts to connect to a Cellular network. If the SIM requires a PIN, and it is not set/invalid, NSAPI_ERROR_AUTH_ERROR is returned.

Returns
NSAPI_ERROR_OK on success, or negative error code on failure

Implements NetworkInterface.

Implemented in mbed::EasyCellularConnection.

virtual nsapi_error_t CellularBase::disconnect ( )
pure virtual

Stop the interface

Returns
0 on success, or error code on failure

Implements NetworkInterface.

Implemented in mbed::EasyCellularConnection.

MBED_WEAK CellularBase * CellularBase::get_default_instance ( )
static

Get the default Cellular 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 const char* CellularBase::get_gateway ( )
pure virtual

Get the local gateways

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

Reimplemented from NetworkInterface.

Implemented in mbed::EasyCellularConnection.

virtual const char* CellularBase::get_ip_address ( )
pure virtual

Get the local IP address

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

Reimplemented from NetworkInterface.

Implemented in mbed::EasyCellularConnection.

virtual const char* CellularBase::get_netmask ( )
pure virtual

Get the local network mask

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

Reimplemented from NetworkInterface.

Implemented in mbed::EasyCellularConnection.

MBED_WEAK CellularBase * CellularBase::get_target_default_instance ( )
staticprotected

Get the target's default Cellular interface.

This is provided as a weak method so targets can override. The default implementation configures and returns the OnBoardModemInterface if available.

Returns
pointer to interface, if any
virtual bool CellularBase::is_connected ( )
pure virtual

Check if the connection is currently established or not

Returns
true/false If the cellular module have successfully acquired a carrier and is connected to an external packet data network using PPP, isConnected() API returns true and false otherwise.

Implemented in mbed::EasyCellularConnection.

virtual void CellularBase::set_credentials ( const char *  apn,
const char *  uname = 0,
const char *  pwd = 0 
)
pure virtual

Set the Cellular network credentials

Please check documentation of connect() for default behaviour of APN settings.

Parameters
apnAccess point name
unameoptionally, Username
pwdoptionally, password

Implemented in mbed::EasyCellularConnection.

virtual void CellularBase::set_sim_pin ( const char *  sim_pin)
pure virtual

Set the pin code for SIM card

Parameters
sim_pinPIN for the SIM card

Implemented in mbed::EasyCellularConnection.


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.