Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependents: TYBLE16_simple_data_logger TYBLE16_MP3_Air
AT_CellularNetwork Class Reference
Class AT_CellularNetwork. More...
#include <AT_CellularNetwork.h>
Inherits mbed::CellularNetwork.
Inherited by QUECTEL_BC95_CellularNetwork, QUECTEL_BG96_CellularNetwork, RM1000_AT_CellularNetwork, SARA4_PPP_CellularNetwork, and UBLOX_AT_CellularNetwork.
Public Types | |
enum | NWRegisteringMode |
Network registering mode. More... | |
enum | SignalQuality |
Get signal quality parameters. More... | |
enum | EDRXAccessTechnology |
Set discontinuous reception time on cellular device. More... | |
Public Member Functions | |
virtual nsapi_error_t | set_registration (const char *plmn=0) |
Request registering to network. | |
virtual nsapi_error_t | get_network_registering_mode (NWRegisteringMode &mode) |
Get the current network registering mode. | |
virtual nsapi_error_t | set_attach () |
Request attach to network. | |
virtual nsapi_error_t | get_attach (AttachStatus &status) |
Request attach status from network. | |
virtual nsapi_error_t | detach () |
Request detach and deregister from a network. | |
virtual nsapi_error_t | scan_plmn (operList_t &operators, int &ops_count) |
Scans for operators module can reach. | |
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) |
Set CIoT optimizations. | |
virtual nsapi_error_t | get_ciot_ue_optimization_config (CIoT_Supported_Opt &supported_opt, CIoT_Preferred_UE_Opt &preferred_opt) |
Get UE CIoT optimizations. | |
virtual nsapi_error_t | get_ciot_network_optimization_config (CIoT_Supported_Opt &supported_network_opt) |
Get Network CIoT optimizations. | |
virtual int | get_3gpp_error () |
Get the last 3GPP error code. | |
virtual nsapi_error_t | get_operator_params (int &format, operator_t &operator_params) |
Get the operator parameters. | |
virtual nsapi_error_t | set_registration_urc (RegistrationType type, bool on) |
Activate/deactivate listening of network events for the given RegistrationType. | |
virtual nsapi_error_t | get_operator_names (operator_names_list &op_names) |
Read operator names. | |
virtual bool | is_active_context (int *number_of_active_contexts=NULL, int cid=-1) |
Check if there is any PDP context active. | |
virtual nsapi_error_t | get_registration_params (registration_params_t ®_params) |
Gets the latest received registration parameters from the network: type, status, access technology, cell_id, lac, active_time, periodic_tau. | |
virtual nsapi_error_t | get_registration_params (RegistrationType type, registration_params_t ®_params) |
Gets the current network registration parameters from the network with type: status, access technology, cell_id, lac, active_time, periodic_tau. | |
virtual nsapi_error_t | set_packet_domain_event_reporting (bool on) |
Sets the packet domain network reporting. | |
virtual nsapi_error_t | set_access_technology (RadioAccessTechnology rat)=0 |
Sets radio access technology. | |
virtual void | attach (mbed::Callback< void(nsapi_event_t, intptr_t)> status_cb)=0 |
Register callback for status reporting. | |
Protected Member Functions | |
virtual nsapi_error_t | set_access_technology_impl (RadioAccessTechnology op_rat) |
Sets access technology to be scanned. | |
virtual void | get_context_state_command () |
Sends a command to query the active state of the PDP contexts. | |
nsapi_error_t | clear () |
Clear the network and contexts to a known default state. |
Detailed Description
Class AT_CellularNetwork.
Class for attaching to a network and getting information from it.
Definition at line 38 of file AT_CellularNetwork.h.
Member Enumeration Documentation
enum EDRXAccessTechnology [inherited] |
Set discontinuous reception time on cellular device.
- Remarks:
- See 3GPP TS 27.007 eDRX for details.
- Parameters:
-
mode disable or enable the use of eDRX act_type type of access technology edrx_value requested edxr value. Extended DRX parameters information element.
- Returns:
- NSAPI_ERROR_OK on success NSAPI_ERROR_DEVICE_ERROR on failure
Definition at line 379 of file CellularNetwork.h.
enum NWRegisteringMode [inherited] |
Network registering mode.
Definition at line 156 of file CellularNetwork.h.
enum SignalQuality [inherited] |
Get signal quality parameters.
- Parameters:
-
rssi signal strength level as defined in 3GPP TS 27.007, range -113..-51 dBm or SignalQualityUnknown ber bit 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
Definition at line 297 of file CellularNetwork.h.
Member Function Documentation
virtual void attach | ( | mbed::Callback< void(nsapi_event_t, intptr_t)> | status_cb ) | [pure virtual, inherited] |
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_cb The callback for status changes
nsapi_error_t clear | ( | ) | [protected] |
Clear the network and contexts to a known default state.
- Returns:
- NSAPI_ERROR_OK on success
Definition at line 636 of file AT_CellularNetwork.cpp.
nsapi_error_t detach | ( | ) | [virtual] |
Request detach and deregister from a network.
- Returns:
- NSAPI_ERROR_OK on success NSAPI_ERROR_DEVICE_ERROR on failure
Implements CellularNetwork.
Definition at line 296 of file AT_CellularNetwork.cpp.
int get_3gpp_error | ( | ) | [virtual] |
Get the last 3GPP error code.
- Returns:
- see 3GPP TS 27.007 error codes
Implements CellularNetwork.
Definition at line 443 of file AT_CellularNetwork.cpp.
nsapi_error_t get_attach | ( | AttachStatus & | status ) | [virtual] |
Request attach status from network.
- Parameters:
-
status see AttachStatus values
- Returns:
- NSAPI_ERROR_OK on success NSAPI_ERROR_DEVICE_ERROR on failure
Implements CellularNetwork.
Definition at line 287 of file AT_CellularNetwork.cpp.
nsapi_error_t get_ciot_network_optimization_config | ( | CIoT_Supported_Opt & | supported_network_opt ) | [virtual] |
Get Network CIoT optimizations.
- Parameters:
-
supported_network_opt Supported 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
Implements CellularNetwork.
Definition at line 401 of file AT_CellularNetwork.cpp.
nsapi_error_t get_ciot_ue_optimization_config | ( | CIoT_Supported_Opt & | supported_opt, |
CIoT_Preferred_UE_Opt & | preferred_opt | ||
) | [virtual] |
Get UE CIoT optimizations.
- Parameters:
-
supported_opt Supported CIoT EPS optimizations. preferred_opt Preferred CIoT EPS optimizations.
- Returns:
- NSAPI_ERROR_OK on success NSAPI_ERROR_DEVICE_ERROR on failure
Implements CellularNetwork.
Definition at line 382 of file AT_CellularNetwork.cpp.
void get_context_state_command | ( | ) | [protected, virtual] |
Sends a command to query the active state of the PDP contexts.
Can be overridden by the target class.
Definition at line 496 of file AT_CellularNetwork.cpp.
nsapi_error_t get_network_registering_mode | ( | NWRegisteringMode & | mode ) | [virtual] |
Get the current network registering mode.
- Parameters:
-
mode on successful return contains the current network registering mode
- Returns:
- NSAPI_ERROR_OK on success NSAPI_ERROR_DEVICE_ERROR on failure
Implements CellularNetwork.
Definition at line 201 of file AT_CellularNetwork.cpp.
nsapi_error_t get_operator_names | ( | operator_names_list & | op_names ) | [virtual] |
Read operator names.
- Parameters:
-
op_names on 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
Implements CellularNetwork.
Definition at line 478 of file AT_CellularNetwork.cpp.
nsapi_error_t get_operator_params | ( | int & | format, |
operator_t & | operator_params | ||
) | [virtual] |
Get the operator parameters.
- Parameters:
-
format format of the operator field operator_params applicable operator param fields filled
- Returns:
- NSAPI_ERROR_OK on success NSAPI_ERROR_DEVICE_ERROR on case of other failures
Implements CellularNetwork.
Definition at line 448 of file AT_CellularNetwork.cpp.
nsapi_error_t get_registration_params | ( | registration_params_t & | reg_params ) | [virtual] |
Gets the latest received registration parameters from the network: type, status, access technology, cell_id, lac, active_time, periodic_tau.
- Parameters:
-
reg_params see registration_params_t
- Returns:
- NSAPI_ERROR_OK on success NSAPI_ERROR_DEVICE_ERROR on failure
Implements CellularNetwork.
Definition at line 537 of file AT_CellularNetwork.cpp.
nsapi_error_t get_registration_params | ( | RegistrationType | type, |
registration_params_t & | reg_params | ||
) | [virtual] |
Gets the current network registration parameters from the network with type: status, access technology, cell_id, lac, active_time, periodic_tau.
- Parameters:
-
type see RegistrationType values reg_params see 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
Implements CellularNetwork.
Definition at line 543 of file AT_CellularNetwork.cpp.
bool is_active_context | ( | int * | number_of_active_contexts = NULL , |
int | cid = -1 |
||
) | [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_contexts If given then in return contains the number of all active contexts cid If 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
Implements CellularNetwork.
Definition at line 502 of file AT_CellularNetwork.cpp.
nsapi_error_t scan_plmn | ( | operList_t & | operators, |
int & | ops_count | ||
) | [virtual] |
Scans for operators module can reach.
- Parameters:
-
operators Container of reachable operators and their access technologies ops_count Number of found operators
- Returns:
- NSAPI_ERROR_OK on success NSAPI_ERROR_NO_MEMORY on memory failure NSAPI_ERROR_DEVICE_ERROR on other failures
Implements CellularNetwork.
Definition at line 326 of file AT_CellularNetwork.cpp.
virtual nsapi_error_t set_access_technology | ( | RadioAccessTechnology | rat ) | [pure virtual, inherited] |
Sets radio access technology.
- Parameters:
-
rat Radio 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(...)
virtual nsapi_error_t set_access_technology_impl | ( | RadioAccessTechnology | op_rat ) | [protected, virtual] |
Sets access technology to be scanned.
Modem specific implementation.
- Parameters:
-
op_rat Access technology
- Returns:
- zero on success
nsapi_error_t set_attach | ( | ) | [virtual] |
Request attach to network.
- Returns:
- NSAPI_ERROR_OK on success NSAPI_ERROR_DEVICE_ERROR on failure
Implements CellularNetwork.
Definition at line 273 of file AT_CellularNetwork.cpp.
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 | ||
) | [virtual] |
Set CIoT optimizations.
- Parameters:
-
supported_opt Supported CIoT EPS optimizations (the HW support can be checked with get_ciot_ue_optimization_config). preferred_opt Preferred CIoT EPS optimizations. network_support_cb This callback will be called when CIoT network optimization support is known
- Returns:
- NSAPI_ERROR_OK on success NSAPI_ERROR_DEVICE_ERROR on failure
Implements CellularNetwork.
Definition at line 365 of file AT_CellularNetwork.cpp.
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:
-
on true 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 from CellularNetwork.
Definition at line 627 of file AT_CellularNetwork.cpp.
nsapi_error_t set_registration | ( | const char * | plmn = 0 ) |
[virtual] |
Request registering to network.
- Parameters:
-
plmn format is in numeric format or 0 for automatic network registration
- Returns:
- NSAPI_ERROR_OK on success NSAPI_ERROR_DEVICE_ERROR on failure
Implements CellularNetwork.
Definition at line 209 of file AT_CellularNetwork.cpp.
nsapi_error_t set_registration_urc | ( | RegistrationType | type, |
bool | on | ||
) | [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:
-
type RegistrationType to set urc on/off on Controls 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
Implements CellularNetwork.
Definition at line 184 of file AT_CellularNetwork.cpp.
Generated on Tue Jul 12 2022 13:55:43 by
