17 #ifndef CELLULAR_NETWORK_H_ 18 #define CELLULAR_NETWORK_H_ 20 #include "CellularList.h" 22 #include "nsapi_types.h" 27 const int MAX_IPV6_ADDR_IN_IPV4LIKE_DOTTED_FORMAT = 63;
29 const int MAX_ACCESSPOINT_NAME_LENGTH = 100;
30 const int MAX_OPERATOR_NAME_LONG = 16;
31 const 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 RegistrationType _type;
167 RegistrationStatus _status;
168 RadioAccessTechnology _act;
177 _status = StatusNotAvailable;
268 CIoT_Preferred_UE_Opt preferred_opt,
269 Callback<
void(CIoT_Supported_Opt)> network_support_cb) = 0;
279 CIoT_Preferred_UE_Opt &preferred_opt) = 0;
298 SignalQualityUnknown = 99
300 virtual nsapi_error_t get_signal_quality(
int &rssi,
int *ber = NULL) = 0;
346 virtual bool is_active_context(
int *number_of_active_contexts = NULL,
int cid = -1) = 0;
380 EDRXGSM_EC_GSM_IoT_mode = 1,
383 EDRXEUTRAN_WB_S1_mode,
384 EDRXEUTRAN_NB_S1_mode
409 #endif // CELLULAR_NETWORK_H_ 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_ciot_ue_optimization_config(CIoT_Supported_Opt &supported_opt, CIoT_Preferred_UE_Opt &preferred_opt)=0
Get UE CIoT optimizations.
virtual int get_3gpp_error()=0
Get the last 3GPP error code.
virtual nsapi_error_t get_network_registering_mode(NWRegisteringMode &mode)=0
Get the current network registering mode.
virtual nsapi_error_t set_attach()=0
Request attach to network.
virtual nsapi_error_t set_registration(const char *plmn=0)=0
Request registering to network.
NWRegisteringMode
Network registering mode.
SignalQuality
Get signal quality parameters.
signed int nsapi_error_t
Type used to represent error codes.
virtual nsapi_error_t scan_plmn(operList_t &operators, int &ops_count)=0
Scans for operators module can reach.
virtual void attach(mbed::Callback< void(nsapi_event_t, intptr_t)> status_cb)=0
Register callback for status reporting.
virtual nsapi_error_t get_operator_names(operator_names_list &op_names)=0
Read operator names.
Cellular operator names in numeric and alpha format.
Network registration information.
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_operator_params(int &format, operator_t &operator_params)=0
Get the operator parameters.
An abstract interface for connecting to a network and getting information from it.
virtual nsapi_error_t detach()=0
Request detach and deregister from a network.
virtual nsapi_error_t set_access_technology(RadioAccessTechnology rat)=0
Sets radio access technology.
EDRXAccessTechnology
Set discontinuous reception time on cellular device.
virtual nsapi_error_t set_packet_domain_event_reporting(bool on)
Sets the packet domain network reporting.
3GPP TS 27.007 - 7.3 PLMN selection +COPS
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 set_registration_urc(RegistrationType type, bool on)=0
Activate/deactivate listening of network events for the given RegistrationType.
Callback class based on template specialization.
virtual nsapi_error_t get_attach(AttachStatus &status)=0
Request attach status from network.