17#ifndef CELLULAR_NETWORK_H_
18#define CELLULAR_NETWORK_H_
20#include "CellularList.h"
22#include "netsocket/nsapi_types.h"
27const int MAX_IPV6_ADDR_IN_IPV4LIKE_DOTTED_FORMAT = 63;
29const int MAX_ACCESSPOINT_NAME_LENGTH = 100;
30const int MAX_OPERATOR_NAME_LONG = 16;
31const int MAX_OPERATOR_NAME_SHORT = 8;
48 enum CIoT_Supported_Opt {
49 CIOT_OPT_NO_SUPPORT = 0,
50 CIOT_OPT_CONTROL_PLANE,
58 enum CIoT_Preferred_UE_Opt {
59 PREFERRED_UE_OPT_NO_PREFERENCE = 0,
60 PREFERRED_UE_OPT_CONTROL_PLANE,
61 PREFERRED_UE_OPT_USER_PLANE,
66 enum RegistrationStatus {
67 StatusNotAvailable = -1,
69 RegisteredHomeNetwork,
74 RegisteredSMSOnlyHome,
75 RegisteredSMSOnlyRoaming,
76 AttachedEmergencyOnly,
77 RegisteredCSFBNotPreferredHome,
78 RegisteredCSFBNotPreferredRoaming,
79 AlreadyRegistered = 11,
84 enum RegistrationType {
97 enum RadioAccessTechnology {
122 char op_long[MAX_OPERATOR_NAME_LONG + 1];
123 char op_short[MAX_OPERATOR_NAME_SHORT + 1];
124 char op_num[MAX_OPERATOR_NAME_SHORT + 1];
125 RadioAccessTechnology op_rat;
131 op_rat = RAT_UNKNOWN;
143 char numeric[MAX_OPERATOR_NAME_SHORT + 1];
144 char alpha[MAX_OPERATOR_NAME_LONG + 1];
161 NWModeManualAutomatic
166 OperatorNameAlphaLong = 0,
167 OperatorNameAlphaShort,
173 RegistrationType _type;
174 RegistrationStatus _status;
175 RadioAccessTechnology _act;
184 _status = StatusNotAvailable;
275 CIoT_Preferred_UE_Opt preferred_opt,
276 Callback<
void(CIoT_Supported_Opt)> network_support_cb) = 0;
286 CIoT_Preferred_UE_Opt &preferred_opt) = 0;
298 SignalQualityUnknown = 99
376 enum EDRXAccessTechnology {
377 EDRXGSM_EC_GSM_IoT_mode = 1,
380 EDRXEUTRAN_WB_S1_mode,
381 EDRXEUTRAN_NB_S1_mode
Callback class based on template specialization.
An abstract interface for connecting to a network and getting information from it.
OperatorNameFormat
Operator name format.
NWRegisteringMode
Network registering mode.
virtual nsapi_error_t set_packet_domain_event_reporting(bool on)
Sets the packet domain network reporting.
virtual nsapi_error_t get_network_registering_mode(NWRegisteringMode &mode)=0
Get the current network registering mode.
virtual nsapi_error_t get_signal_quality(int &rssi, int *ber=NULL)=0
Get signal quality parameters.
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.
virtual nsapi_error_t get_ciot_network_optimization_config(CIoT_Supported_Opt &supported_network_opt)=0
Get Network CIoT optimizations.
virtual nsapi_error_t get_attach(AttachStatus &status)=0
Request attach status from network.
virtual nsapi_error_t get_operator_names(operator_names_list &op_names)=0
Read operator names.
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.
virtual nsapi_error_t set_receive_period(int mode, EDRXAccessTechnology act_type, uint8_t edrx_value)=0
Set discontinuous reception time on cellular device.
virtual nsapi_error_t set_registration_urc(RegistrationType type, bool on)=0
Activate/deactivate listening of network events for the given RegistrationType.
virtual nsapi_error_t set_attach()=0
Request attach to network.
virtual nsapi_error_t get_operator_params(int &format, operator_t&operator_params)=0
Get the operator parameters.
virtual nsapi_error_t set_access_technology(RadioAccessTechnology rat)=0
Sets radio access technology.
virtual bool is_active_context(int *number_of_active_contexts=NULL, int cid=-1)=0
Check if there is any PDP context active.
virtual nsapi_error_t get_registration_params(registration_params_t ®_params)=0
Gets the latest received registration parameters from the network: type, status, access technology,...
virtual nsapi_error_t detach()=0
Request detach and deregister from a network.
virtual nsapi_error_t set_registration(const char *plmn=0)=0
Request registering to network.
virtual nsapi_error_t scan_plmn(operList_t &operators, int &ops_count)=0
Scans for operators module can reach.
virtual nsapi_error_t get_registration_params(RegistrationType type, registration_params_t ®_params)=0
Gets the current network registration parameters from the network with type: status,...
virtual void attach(mbed::Callback< void(nsapi_event_t, intptr_t)> status_cb)=0
Register callback for status reporting.
virtual int get_3gpp_error()=0
Get the last 3GPP error code.
signed int nsapi_error_t
Type used to represent error codes.
@ NSAPI_ERROR_UNSUPPORTED
Cellular operator names in numeric and alpha format.
3GPP TS 27.007 - 7.3 PLMN selection +COPS
Network registration information.