Mistake on this page?
Report an issue in GitHub or email us
Data Structures | Functions
Cellular

Data Structures

class  CellularContext
 CellularContext is CellularInterface/NetworkInterface with extensions for cellular connectivity. More...
 
class  CellularDevice
 Class CellularDevice. More...
 
class  CellularInformation
 Class CellularInformation. More...
 
class  CellularNetwork
 An abstract interface for connecting to a network and getting information from it. More...
 
class  CellularSMS
 Class CellularSMS. More...
 
class  ControlPlane_netif
 Implements support for data transfer using Control Plane CIoT EPS optimization specified in 3GPP 23.401(4.10), 3GPP 23.682(4.5.14). More...
 
class  CellularInterface
 Common interface that is shared between cellular interfaces. More...
 

Functions

static CellularInterfaceget_default_instance ()
 Get the default cellular interface. More...
 
virtual void set_credentials (const char *apn, const char *uname=0, const char *pwd=0)=0
 Set the cellular network credentials. More...
 
virtual void set_plmn (const char *plmn)=0
 Set the plmn. More...
 
virtual void set_sim_pin (const char *sim_pin)=0
 Set the PIN code for SIM card. More...
 
virtual nsapi_error_t connect (const char *sim_pin, const char *apn=0, const char *uname=0, const char *pwd=0)=0
 Attempt to connect to a cellular network with a PIN and credentials. More...
 
virtual nsapi_error_t connect ()=0
 Attempt to connect to a cellular network. More...
 
virtual nsapi_error_t disconnect ()=0
 Stop the interface. More...
 
virtual bool is_connected ()=0
 Check if the connection is currently established. More...
 
virtual const char * get_ip_address ()=0
 Get the local IP address. More...
 
virtual const char * get_netmask ()=0
 Get the local network mask. More...
 
virtual const char * get_gateway ()=0
 Get the local gateways. More...
 
virtual CellularInterfacecellularBase ()
 Return pointer to a CellularInterface. More...
 
virtual CellularInterfacecellularInterface ()
 Return pointer to a CellularInterface. More...
 
virtual void set_default_parameters ()
 defined(DOXYGEN_ONLY) More...
 

Detailed Description

Function Documentation

virtual CellularInterface* cellularBase ( )
virtual

Return pointer to a CellularInterface.

Returns
Pointer to requested interface type or NULL if this class doesn't implement the interface.

Reimplemented from NetworkInterface.

Definition at line 122 of file CellularInterface.h.

virtual CellularInterface* cellularInterface ( )
virtual

Return pointer to a CellularInterface.

Returns
Pointer to requested interface type or NULL if this class doesn't implement the interface.

Reimplemented from NetworkInterface.

Definition at line 129 of file CellularInterface.h.

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

Attempt to connect to a cellular network with a PIN and credentials.

Parameters
sim_pinPIN for the SIM card.
apnAccess point name (optional).
unameUsername (optional).
pwdPassword (optional).
Returns
NSAPI_ERROR_OK on success, or negative error code on failure.

Implemented in CellularContext, and AT_CellularContext.

virtual nsapi_error_t connect ( )
pure virtual

Attempt to connect to a cellular network.

If the SIM requires a PIN, and it is invalid or not set, NSAPI_ERROR_AUTH_ERROR is returned.

Returns
NSAPI_ERROR_OK on success, or negative error code on failure.

Implements NetworkInterface.

Implemented in CellularContext, and AT_CellularContext.

virtual nsapi_error_t disconnect ( )
pure virtual

Stop the interface.

Returns
NSAPI_ERROR_OK on success, or error code on failure.

Implements NetworkInterface.

Implemented in CellularContext, and AT_CellularContext.

static CellularInterface* get_default_instance ( )
static

Get the default cellular interface.

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

Returns
pointer to interface, if any.
virtual const char* 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 CellularContext, and AT_CellularContext.

virtual const char* 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 CellularContext, and AT_CellularContext.

virtual const char* 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 CellularContext, and AT_CellularContext.

virtual bool is_connected ( )
pure virtual

Check if the connection is currently established.

Returns
true if the cellular module have successfully acquired a carrier and is connected to an external packet data network using PPP, false otherwise.

Implemented in CellularContext, and AT_CellularContext.

virtual void 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 behavior of APN settings.

Parameters
apnAccess point name.
unameUsername (optional).
pwdPassword (optional).

Implemented in CellularContext, and AT_CellularContext.

virtual void set_default_parameters ( )
virtual

defined(DOXYGEN_ONLY)

Set default parameters on a cellular interface.

A cellular interface instantiated directly or using CellularInterface::get_default_instance() is initially unconfigured. This call can be used to set the default parameters that would have been set if the interface had been requested using NetworkInterface::get_default_instance() (see nsapi JSON configuration).

Reimplemented from NetworkInterface.

virtual void set_plmn ( const char *  plmn)
pure virtual

Set the plmn.

PLMN controls to what network device registers.

Parameters
plmnuser to force what network to register.

Implemented in CellularContext, and AT_CellularContext.

virtual void 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 CellularContext, and AT_CellularContext.

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.