Mbed OS Reference
Loading...
Searching...
No Matches
CellularNetwork Class Referenceabstract

An abstract interface for connecting to a network and getting information from it. More...

#include <CellularNetwork.h>

Inheritance diagram for CellularNetwork:
AT_CellularNetwork ALT1250_PPP_CellularNetwork RM1000_AT_CellularNetwork SARA4_PPP_CellularNetwork TELIT_ME310_CellularNetwork TELIT_ME910_CellularNetwork

Data Structures

struct  operator_names_t
 Cellular operator names in numeric and alpha format. More...
 
struct  operator_t
 3GPP TS 27.007 - 7.3 PLMN selection +COPS More...
 
struct  registration_params_t
 Network registration information. More...
 

Public Types

enum  NWRegisteringMode
 Network registering mode. More...
 
enum  OperatorNameFormat
 Operator name format. More...
 

Public Member Functions

virtual nsapi_error_t set_registration (const char *plmn=0)=0
 Request registering to network. More...
 
virtual nsapi_error_t get_network_registering_mode (NWRegisteringMode &mode)=0
 Get the current network registering mode. More...
 
virtual nsapi_error_t set_registration_urc (RegistrationType type, bool on)=0
 Activate/deactivate listening of network events for the given RegistrationType. More...
 
virtual nsapi_error_t set_attach ()=0
 Request attach to network. More...
 
virtual nsapi_error_t get_attach (AttachStatus &status)=0
 Request attach status from network. More...
 
virtual nsapi_error_t detach ()=0
 Request detach and deregister from a network. More...
 
virtual nsapi_error_t set_access_technology (RadioAccessTechnology rat)=0
 Sets radio access technology. More...
 
virtual nsapi_error_t scan_plmn (operList_t &operators, int &ops_count)=0
 Scans for operators module can reach. More...
 
virtual nsapi_error_t set_ciot_optimization_config (CIoT_Supported_Opt supported_opt, CIoT_Preferred_UE_Opt preferred_opt, Callback< void(CIoT_Supported_Opt)> network_support_cb)=0
 Set CIoT optimizations. More...
 
virtual nsapi_error_t get_ciot_ue_optimization_config (CIoT_Supported_Opt &supported_opt, CIoT_Preferred_UE_Opt &preferred_opt)=0
 Get UE CIoT optimizations. More...
 
virtual nsapi_error_t get_ciot_network_optimization_config (CIoT_Supported_Opt &supported_network_opt)=0
 Get Network CIoT optimizations. More...
 
virtual nsapi_error_t get_signal_quality (int &rssi, int *ber=NULL)=0
 Get signal quality parameters. More...
 
virtual int get_3gpp_error ()=0
 Get the last 3GPP error code. More...
 
virtual nsapi_error_t get_operator_params (int &format, operator_t&operator_params)=0
 Get the operator parameters. More...
 
virtual void attach (mbed::Callback< void(nsapi_event_t, intptr_t)> status_cb)=0
 Register callback for status reporting. More...
 
virtual nsapi_error_t get_operator_names (operator_names_list &op_names)=0
 Read operator names. More...
 
virtual bool is_active_context (int *number_of_active_contexts=NULL, int cid=-1)=0
 Check if there is any PDP context active. More...
 
virtual nsapi_error_t get_registration_params (registration_params_t &reg_params)=0
 Gets the latest received registration parameters from the network: type, status, access technology, cell_id, lac, active_time, periodic_tau. More...
 
virtual nsapi_error_t get_registration_params (RegistrationType type, registration_params_t &reg_params)=0
 Gets the current network registration parameters from the network with type: status, access technology, cell_id, lac, active_time, periodic_tau. More...
 
virtual nsapi_error_t set_receive_period (int mode, EDRXAccessTechnology act_type, uint8_t edrx_value)=0
 Set discontinuous reception time on cellular device. More...
 
virtual nsapi_error_t set_packet_domain_event_reporting (bool on)
 Sets the packet domain network reporting. More...
 

Detailed Description

An abstract interface for connecting to a network and getting information from it.

Definition at line 39 of file CellularNetwork.h.

Member Enumeration Documentation

◆ NWRegisteringMode

Network registering mode.

Definition at line 156 of file CellularNetwork.h.

◆ OperatorNameFormat

Operator name format.

Definition at line 165 of file CellularNetwork.h.

Member Function Documentation

◆ set_registration()

virtual nsapi_error_t set_registration ( const char *  plmn = 0)
pure virtual

Request registering to network.

Parameters
plmnformat is in numeric format or 0 for automatic network registration
Returns
NSAPI_ERROR_OK on success NSAPI_ERROR_DEVICE_ERROR on failure

Implemented in AT_CellularNetwork.

◆ get_network_registering_mode()

virtual nsapi_error_t get_network_registering_mode ( NWRegisteringMode mode)
pure virtual

Get the current network registering mode.

Parameters
modeon success the current network registering mode, otherwise unchanged
Returns
NSAPI_ERROR_OK on success NSAPI_ERROR_DEVICE_ERROR on failure

Implemented in AT_CellularNetwork.

◆ set_registration_urc()

virtual nsapi_error_t set_registration_urc ( RegistrationType  type,
bool  on 
)
pure virtual

Activate/deactivate listening of network events for the given RegistrationType.

This should be called after network class is created and ready to receive AT commands. After successful call network class starts to get information about network changes like registration statue, access technology, cell id...

Parameters
typeRegistrationType to set urc on/off
onControls are urc active or not
Returns
NSAPI_ERROR_OK on success NSAPI_ERROR_UNSUPPORTED if the modem does not support RegistrationType NSAPI_ERROR_DEVICE_ERROR on failure

Implemented in AT_CellularNetwork, and RM1000_AT_CellularNetwork.

◆ set_attach()

virtual nsapi_error_t set_attach ( )
pure virtual

Request attach to network.

Returns
NSAPI_ERROR_OK on success NSAPI_ERROR_DEVICE_ERROR on failure

Implemented in AT_CellularNetwork.

◆ get_attach()

virtual nsapi_error_t get_attach ( AttachStatus &  status)
pure virtual

Request attach status from network.

Parameters
statussee AttachStatus values
Returns
NSAPI_ERROR_OK on success NSAPI_ERROR_DEVICE_ERROR on failure

Implemented in AT_CellularNetwork.

◆ detach()

virtual nsapi_error_t detach ( )
pure virtual

Request detach and deregister from a network.

Returns
NSAPI_ERROR_OK on success NSAPI_ERROR_DEVICE_ERROR on failure

Implemented in AT_CellularNetwork.

◆ set_access_technology()

virtual nsapi_error_t set_access_technology ( RadioAccessTechnology  rat)
pure virtual

Sets radio access technology.

Parameters
ratRadio access technology
Returns
NSAPI_ERROR_OK on success NSAPI_ERROR_UNSUPPORTED if the given rat is RAT_UNKNOWN or inheriting target class has not implemented method set_access_technology_impl(...) OR return value of the inheriting target class set_access_technology_impl(...)

Implemented in AT_CellularNetwork.

◆ scan_plmn()

virtual nsapi_error_t scan_plmn ( operList_t operators,
int &  ops_count 
)
pure virtual

Scans for operators module can reach.

Parameters
operatorsContainer of reachable operators and their access technologies
ops_countNumber of found operators
Returns
NSAPI_ERROR_OK on success NSAPI_ERROR_NO_MEMORY on memory failure NSAPI_ERROR_DEVICE_ERROR on other failures

Implemented in AT_CellularNetwork.

◆ set_ciot_optimization_config()

virtual nsapi_error_t set_ciot_optimization_config ( CIoT_Supported_Opt  supported_opt,
CIoT_Preferred_UE_Opt  preferred_opt,
Callback< void(CIoT_Supported_Opt)>  network_support_cb 
)
pure virtual

Set CIoT optimizations.

Parameters
supported_optSupported CIoT EPS optimizations (the HW support can be checked with get_ciot_ue_optimization_config).
preferred_optPreferred CIoT EPS optimizations.
network_support_cbThis callback will be called when CIoT network optimization support is known
Returns
NSAPI_ERROR_OK on success NSAPI_ERROR_DEVICE_ERROR on failure

Implemented in AT_CellularNetwork.

◆ get_ciot_ue_optimization_config()

virtual nsapi_error_t get_ciot_ue_optimization_config ( CIoT_Supported_Opt &  supported_opt,
CIoT_Preferred_UE_Opt &  preferred_opt 
)
pure virtual

Get UE CIoT optimizations.

Parameters
supported_optSupported CIoT EPS optimizations.
preferred_optPreferred CIoT EPS optimizations.
Returns
NSAPI_ERROR_OK on success NSAPI_ERROR_DEVICE_ERROR on failure

Implemented in AT_CellularNetwork.

◆ get_ciot_network_optimization_config()

virtual nsapi_error_t get_ciot_network_optimization_config ( CIoT_Supported_Opt &  supported_network_opt)
pure virtual

Get Network CIoT optimizations.

Parameters
supported_network_optSupported CIoT EPS optimizations. CIOT_OPT_MAX will be returned, if the support is not known
Returns
NSAPI_ERROR_OK on success NSAPI_ERROR_DEVICE_ERROR on failure

Implemented in AT_CellularNetwork.

◆ get_signal_quality()

virtual nsapi_error_t get_signal_quality ( int &  rssi,
int *  ber = NULL 
)
pure virtual

Get signal quality parameters.

Parameters
rssisignal strength level as defined in 3GPP TS 27.007, range -113..-51 dBm or SignalQualityUnknown
berbit error rate as RXQUAL as defined in 3GPP TS 45.008, range 0..7 or SignalQualityUnknown
Returns
NSAPI_ERROR_OK on success NSAPI_ERROR_DEVICE_ERROR on other failures

Implemented in AT_CellularNetwork.

◆ get_3gpp_error()

virtual int get_3gpp_error ( )
pure virtual

Get the last 3GPP error code.

Returns
see 3GPP TS 27.007 error codes

Implemented in AT_CellularNetwork.

◆ get_operator_params()

virtual nsapi_error_t get_operator_params ( int &  format,
operator_t operator_params 
)
pure virtual

Get the operator parameters.

Parameters
formatformat of the operator field
operator_paramsapplicable operator param fields filled
Returns
NSAPI_ERROR_OK on success NSAPI_ERROR_DEVICE_ERROR on case of other failures

Implemented in AT_CellularNetwork.

◆ attach()

virtual void attach ( mbed::Callback< void(nsapi_event_t, intptr_t)>  status_cb)
pure virtual

Register callback for status reporting.

The specified status callback function will be called on status changes on the network. The parameters on the callback are the event type and event-type dependent reason parameter.

Remarks
Application should not call attach if using CellularContext class. Call instead CellularContext::attach as CellularDevice is dependent of this attach if CellularContext/CellularDevice is used to get device/sim ready, registered, attached, connected.
Parameters
status_cbThe callback for status changes

Implemented in AT_CellularNetwork.

◆ get_operator_names()

virtual nsapi_error_t get_operator_names ( operator_names_list op_names)
pure virtual

Read operator names.

Parameters
op_nameson successful return contains linked list of operator names.
Returns
NSAPI_ERROR_OK on success NSAPI_ERROR_NO_MEMORY on memory failure NSAPI_ERROR_DEVICE_ERROR on other failures

Implemented in AT_CellularNetwork.

◆ is_active_context()

virtual bool is_active_context ( int *  number_of_active_contexts = NULL,
int  cid = -1 
)
pure virtual

Check if there is any PDP context active.

If cid is given, then check is done only for that cid.

Parameters
number_of_active_contextsIf given then in return contains the number of all active contexts
cidIf given then check if the context with this cid is active
Returns
true if any (or the given cid) context is active, false otherwise or in case of error

Implemented in AT_CellularNetwork.

◆ get_registration_params() [1/2]

virtual nsapi_error_t get_registration_params ( registration_params_t reg_params)
pure virtual

Gets the latest received registration parameters from the network: type, status, access technology, cell_id, lac, active_time, periodic_tau.

Parameters
reg_paramssee registration_params_t
Returns
NSAPI_ERROR_OK on success NSAPI_ERROR_DEVICE_ERROR on failure

Implemented in AT_CellularNetwork.

◆ get_registration_params() [2/2]

virtual nsapi_error_t get_registration_params ( RegistrationType  type,
registration_params_t reg_params 
)
pure virtual

Gets the current network registration parameters from the network with type: status, access technology, cell_id, lac, active_time, periodic_tau.

Parameters
typesee RegistrationType values
reg_paramssee registration_params_t
Returns
NSAPI_ERROR_OK on success NSAPI_ERROR_UNSUPPORTED if the modem does not support RegistrationType NSAPI_ERROR_DEVICE_ERROR on failure

Implemented in AT_CellularNetwork.

◆ set_receive_period()

virtual nsapi_error_t set_receive_period ( int  mode,
EDRXAccessTechnology  act_type,
uint8_t  edrx_value 
)
pure virtual

Set discontinuous reception time on cellular device.

Remarks
See 3GPP TS 27.007 eDRX for details.
Parameters
modedisable or enable the use of eDRX
act_typetype of access technology
edrx_valuerequested edxr value. Extended DRX parameters information element.
Returns
NSAPI_ERROR_OK on success NSAPI_ERROR_DEVICE_ERROR on failure

Implemented in AT_CellularNetwork.

◆ set_packet_domain_event_reporting()

virtual nsapi_error_t set_packet_domain_event_reporting ( bool  on)
virtual

Sets the packet domain network reporting.

Useful for getting events when detached from the network. When detach event arrives it is propagated as NSAPI_STATUS_DISCONNECTED to callback set with attach(...).

Parameters
ontrue for enabling event reporting, false for disabling
Returns
NSAPI_ERROR_OK on success NSAPI_ERROR_UNSUPPORTED is command is not supported by the modem NSAPI_ERROR_DEVICE_ERROR on failure

Reimplemented in AT_CellularNetwork.

Definition at line 406 of file CellularNetwork.h.