takashi kadono / Mbed OS Nucleo_446

Dependencies:   ssd1331

Embed: (wiki syntax)

« Back to documentation index

AT_CellularNetwork Class Reference

Class AT_CellularNetwork. More...

#include <AT_CellularNetwork.h>

Inherits mbed::CellularNetwork, and mbed::AT_CellularBase.

Inherited by GEMALTO_CINTERION_CellularNetwork, QUECTEL_BC95_CellularNetwork, QUECTEL_BG96_CellularNetwork, QUECTEL_UG96_CellularNetwork, SARA4_PPP_CellularNetwork, TELIT_HE910_CellularNetwork, UBLOX_AT_CellularNetwork, UBLOX_PPP_CellularNetwork, my_AT_CN, and my_AT_CNipv6.

Public Types

typedef mbed::Callback< void(nsapi_error_t
result, SocketAddress *address) 
hostbyname_cb_t )
 Hostname translation callback (asynchronous)
enum  SupportedFeature
 

Cellular module need to define an array of unsupported features if any, by default all features are supported.

More...

Public Member Functions

virtual nsapi_error_t set_credentials (const char *apn, const char *username=0, const char *password=0)
 Set the cellular network APN and credentials.
virtual nsapi_error_t connect (const char *apn, const char *username=0, const char *password=0)
 Start the interface.
virtual nsapi_error_t connect ()
 Start the interface.
virtual nsapi_error_t disconnect ()
 User initiated disconnect.
virtual nsapi_error_t init ()
 Does all the needed initializations that can fail.
virtual nsapi_error_t activate_context ()
 Finds the correct PDP context and activates it.
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 get_registration_status (RegistrationType type, RegistrationStatus &status)
 Gets the network registration status.
virtual nsapi_error_t get_attach (AttachStatus &status)
 Request attach status from network.
virtual nsapi_error_t detach ()
 Request detach from a network.
virtual nsapi_error_t get_rate_control (CellularNetwork::RateControlExceptionReports &reports, CellularNetwork::RateControlUplinkTimeUnit &time_unit, int &uplink_rate)
 Get APN rate control.
virtual nsapi_error_t get_apn_backoff_timer (int &backoff_timer)
 Get backoff timer value.
virtual nsapi_connection_status_t get_connection_status () const
 Get the connection status.
virtual nsapi_error_t set_blocking (bool blocking)
 Set blocking status of connect() which by default should be blocking.
virtual nsapi_error_t set_access_technology (RadioAccessTechnology rat)
 Sets radio access technology.
virtual nsapi_error_t get_access_technology (RadioAccessTechnology &rat)
 Get current radio access technology.
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 (Supported_UE_Opt supported_opt, Preferred_UE_Opt preferred_opt)
 Set CIoT optimizations.
virtual nsapi_error_t get_ciot_optimization_config (Supported_UE_Opt &supported_opt, Preferred_UE_Opt &preferred_opt)
 Get CIoT optimizations.
virtual nsapi_error_t set_stack_type (nsapi_ip_stack_t stack_type)
 Set the pdn type to be used.
virtual nsapi_ip_stack_t get_stack_type ()
 Get the pdn type in use.
virtual nsapi_error_t get_pdpcontext_params (pdpContextList_t &params_list)
 Get the relevant information for an active non secondary PDP context.
virtual nsapi_error_t get_extended_signal_quality (int &rxlev, int &ber, int &rscp, int &ecno, int &rsrq, int &rsrp)
 Get extended signal quality parameters.
virtual nsapi_error_t get_signal_quality (int &rssi, int &ber)
 Get signal quality parameters.
virtual nsapi_error_t get_cell_id (int &cell_id)
 Get cell id.
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 nsapi_error_t set_credentials (const char *apn, AuthenticationType type, const char *username=0, const char *password=0)=0
 Set the cellular network APN and credentials.
 MBED_DEPRECATED_SINCE ("mbed-os-5.9","Parameter timeout will be deprecated. Use mbed-os/features/cellular/framework/API/CellularDevice.h set_timeout instead.") virtual nsapi_error_t set_attach(int timeout
 Request attach to network.
virtual void attach (mbed::Callback< void(nsapi_event_t, intptr_t)> status_cb)=0
 Register callback for status reporting.
virtual const char * get_mac_address ()
 Get the local MAC address.
virtual const char * get_netmask ()
 Get the local network mask.
virtual const char * get_gateway ()
 Get the local gateway.
virtual nsapi_error_t set_network (const char *ip_address, const char *netmask, const char *gateway)
 Set a static IP address.
virtual nsapi_error_t set_dhcp (bool dhcp)
 Enable or disable DHCP on the network.
virtual nsapi_error_t gethostbyname (const char *host, SocketAddress *address, nsapi_version_t version=NSAPI_UNSPEC)
 Translates a hostname to an IP address with specific version.
virtual nsapi_value_or_error_t gethostbyname_async (const char *host, hostbyname_cb_t callback, nsapi_version_t version=NSAPI_UNSPEC)
 Translates a hostname to an IP address (asynchronous)
virtual nsapi_error_t gethostbyname_async_cancel (int id)
 Cancels asynchronous hostname translation.
virtual nsapi_error_t add_dns_server (const SocketAddress &address)
 Add a domain name server to list of servers to query.
virtual EthInterfaceethInterface ()
 Dynamic downcast to an EthInterface.
virtual WiFiInterface * wifiInterface ()
 Dynamic downcast to a WiFiInterface.
virtual MeshInterfacemeshInterface ()
 Dynamic downcast to a MeshInterface.
virtual CellularBasecellularBase ()
 Dynamic downcast to a CellularBase.
virtual EMACInterfaceemacInterface ()
 Dynamic downcast to an EMACInterface.
ATHandlerget_at_handler ()
 Getter for at handler.
device_err_t get_device_error () const
 Gets the device error that happened when using AT commands/responses.

Static Public Member Functions

static NetworkInterface * get_default_instance ()
 Return the default network interface.

Protected Types

enum  RegistrationMode
 

Check if modem supports given registration type.

More...

Protected Member Functions

virtual bool get_modem_stack_type (nsapi_ip_stack_t requested_stack)
 Check if modem supports the given stack type.
virtual nsapi_error_t set_access_technology_impl (RadioAccessTechnology op_rat)
 Sets access technology to be scanned.
virtual nsapi_error_t do_user_authentication ()
 APN user authentication.

Static Protected Member Functions

static NetworkInterface * get_target_default_instance ()
 Get the target's default network instance.

Static Protected Attributes

static const SupportedFeature_unsupported_features
 Check if some functionality is supported by a cellular module.

Friends

class InternetSocket
class UDPSocket
class TCPSocket

Detailed Description

Class AT_CellularNetwork.

Class for connecting to a network and getting information from it.

Definition at line 34 of file AT_CellularNetwork.h.


Member Typedef Documentation

typedef mbed::Callback<void (nsapi_error_t result, SocketAddress *address) hostbyname_cb_t) [inherited]

Hostname translation callback (asynchronous)

Callback will be called after DNS resolution completes or a failure occurs.

Callback should not take more than 10ms to execute, otherwise it might prevent underlying thread processing. A portable user of the callback should not make calls to network operations due to stack size limitations. The callback should not perform expensive operations such as socket recv/send calls or blocking operations.

Parameters:
status0 on success, negative error code on failure
addressOn success, destination for the host SocketAddress

Definition at line 180 of file NetworkInterface.h.


Member Enumeration Documentation

enum RegistrationMode [protected]

Check if modem supports given registration type.

Parameters:
reg_typeenum RegistrationType
Returns:
mode supported on given reg_type as per 3GPP TS 27.007, 0 when unsupported

Definition at line 134 of file AT_CellularNetwork.h.

enum SupportedFeature [inherited]

Cellular module need to define an array of unsupported features if any, by default all features are supported.

Parameters:
featuresArray of type SupportedFeature with last element FEATURE_END_MARK

Definition at line 50 of file AT_CellularBase.h.


Member Function Documentation

nsapi_error_t activate_context (  ) [virtual]

Finds the correct PDP context and activates it.

If correct PDP context is not found, one is created. Given APN (or not given) and stack type (IPv4/IPv6/dual) are influencing when finding the PDP context.

Returns:
NSAPI_ERROR_OK on success NSAPI_ERROR_NO_CONNECTION if fails to find suitable context to activate or activation failed (if not already activated) NSAPI_ERROR_UNSUPPORTED if NetworkStack was not found NSAPI_ERROR_AUTH_FAILURE if password and username were provided and authentication to network failed

Implements CellularNetwork.

Definition at line 278 of file AT_CellularNetwork.cpp.

nsapi_error_t add_dns_server ( const SocketAddress &  address ) [virtual, inherited]

Add a domain name server to list of servers to query.

Parameters:
addressDestination for the host address
Returns:
0 on success, negative error code on failure

Definition at line 73 of file NetworkInterface.cpp.

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.

Parameters:
status_cbThe callback for status changes
virtual CellularBase* cellularBase (  ) [virtual, inherited]

Dynamic downcast to a CellularBase.

Definition at line 265 of file NetworkInterface.h.

nsapi_error_t connect ( const char *  apn,
const char *  username = 0,
const char *  password = 0 
) [virtual]

Start the interface.

Attempts to connect to a cellular network.

Parameters:
apnOptional name of the network to connect to
usernameOptional username for your APN
passwordOptional password for your APN
Returns:
NSAPI_ERROR_OK on success NSAPI_ERROR_NO_CONNECTION if fails to find suitable context to activate or activation failed (if not already activated) NSAPI_ERROR_UNSUPPORTED if NetworkStack was not found NSAPI_ERROR_AUTH_FAILURE if password and username were provided and authentication to network failed NSAPI_ERROR_NO_MEMORY on memory failure Also if PPP mode NSAPI_ERROR_DEVICE_ERROR on failure and check more error from nsapi_ppp_connect(...)

Implements CellularNetwork.

Definition at line 249 of file AT_CellularNetwork.cpp.

nsapi_error_t connect (  ) [virtual]

Start the interface.

Attempts to connect to a cellular network.

Returns:
NSAPI_ERROR_OK on success NSAPI_ERROR_NO_CONNECTION if fails to find suitable context to activate or activation failed (if not already activated) NSAPI_ERROR_UNSUPPORTED if NetworkStack was not found or cellular device does not support authentication NSAPI_ERROR_AUTH_FAILURE if password and username were provided and authentication to network failed Also if PPP mode NSAPI_ERROR_DEVICE_ERROR on failure and check more error from nsapi_ppp_connect(...)

Implements CellularNetwork.

Definition at line 347 of file AT_CellularNetwork.cpp.

nsapi_error_t detach (  ) [virtual]

Request detach from a network.

Returns:
NSAPI_ERROR_OK on success NSAPI_ERROR_DEVICE_ERROR on failure

Implements CellularNetwork.

Definition at line 901 of file AT_CellularNetwork.cpp.

nsapi_error_t disconnect ( void   ) [virtual]

User initiated disconnect.

Disconnects from PPP connection only and brings down the underlying network interface

Definition at line 425 of file AT_CellularNetwork.cpp.

nsapi_error_t do_user_authentication (  ) [protected, virtual]

APN user authentication.

Returns:
NSAPI_ERROR_OK on success NSAPI_ERROR_UNSUPPORTED on authentication not supported by cellular device NSAPI_ERROR_AUTH_FAILURE on authentication to network failed

Definition at line 515 of file AT_CellularNetwork.cpp.

virtual EMACInterface* emacInterface (  ) [virtual, inherited]

Dynamic downcast to an EMACInterface.

Definition at line 271 of file NetworkInterface.h.

virtual EthInterface* ethInterface (  ) [virtual, inherited]

Dynamic downcast to an EthInterface.

Definition at line 247 of file NetworkInterface.h.

int get_3gpp_error (  ) [virtual]

Get the last 3GPP error code.

Returns:
see 3GPP TS 27.007 error codes

Implements CellularNetwork.

Definition at line 1271 of file AT_CellularNetwork.cpp.

nsapi_error_t get_access_technology ( RadioAccessTechnology &  rat ) [virtual]

Get current radio access technology.

Parameters:
ratRadio access technology
Returns:
NSAPI_ERROR_OK

Implements CellularNetwork.

Definition at line 991 of file AT_CellularNetwork.cpp.

nsapi_error_t get_apn_backoff_timer ( int &  backoff_timer ) [virtual]

Get backoff timer value.

Parameters:
backoff_timerBackoff timer value associated with PDP APN in seconds
Returns:
NSAPI_ERROR_OK on success NSAPI_ERROR_PARAMETER if no access point is set or found when activating context NSAPI_ERROR_DEVICE_ERROR on failure

Implements CellularNetwork.

Definition at line 916 of file AT_CellularNetwork.cpp.

ATHandler & get_at_handler (  ) [inherited]

Getter for at handler.

Common method for all AT-classes.

Returns:
reference to ATHandler

Definition at line 27 of file AT_CellularBase.cpp.

nsapi_error_t get_attach ( AttachStatus &  status ) [virtual]

Request attach status from network.

Parameters:
statussee AttachStatus values
Returns:
NSAPI_ERROR_OK on success NSAPI_ERROR_DEVICE_ERROR on failure

Implements CellularNetwork.

Definition at line 884 of file AT_CellularNetwork.cpp.

nsapi_error_t get_cell_id ( int &  cell_id ) [virtual]

Get cell id.

Parameters:
cell_idcell ID
Returns:
NSAPI_ERROR_OK

Implements CellularNetwork.

Definition at line 852 of file AT_CellularNetwork.cpp.

nsapi_error_t get_ciot_optimization_config ( Supported_UE_Opt &  supported_opt,
Preferred_UE_Opt &  preferred_opt 
) [virtual]

Get 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

Implements CellularNetwork.

Definition at line 1074 of file AT_CellularNetwork.cpp.

nsapi_connection_status_t get_connection_status (  ) const [virtual]

Get the connection status.

Returns:
The connection status according to ConnectionStatusType

Implements CellularNetwork.

Definition at line 490 of file AT_CellularNetwork.cpp.

MBED_WEAK NetworkInterface * get_default_instance (  ) [static, inherited]

Return the default network interface.

Returns the default network interface, as determined by JSON option target.network-default-interface-type or other overrides.

The type of the interface returned can be tested via the ethInterface() etc downcasts.

The default behaviour is to return the default interface for the interface type specified by target.network-default-interface-type. Targets should set this in their targets.json to guide default selection, and applications may override.

The interface returned should be already configured for use such that its connect() method works with no parameters. For connection types needing configuration, settings should normally be obtained from JSON - the settings for the core types are under the "nsapi" JSON config tree.

The list of possible settings for default interface type is open-ended, as is the number of possible providers. Core providers are:

* ETHERNET: EthernetInterface, using default EMAC and OnboardNetworkStack * MESH: ThreadInterface or LoWPANNDInterface, using default NanostackRfPhy * CELLULAR: OnboardModemInterface * WIFI: None - always provided by a specific class

Specific drivers may be activated by other settings of the default-network-interface-type configuration. This will depend on the target and the driver. For example a board may have its default setting as "AUTO" which causes it to autodetect an Ethernet cable. This should be described in the target's documentation.

An application can override all target settings by implementing NetworkInterface::get_default_instance() themselves - the default definition is weak, and calls get_target_default_instance().

Definition at line 60 of file NetworkInterfaceDefaults.cpp.

device_err_t get_device_error (  ) const [inherited]

Gets the device error that happened when using AT commands/responses.

This is at error returned by the device. Returned CME/CMS errors can be found from 3gpp documents 27007 and 27005.

Returns:
at error (CME/CMS) while communicating with the device

Definition at line 32 of file AT_CellularBase.cpp.

nsapi_error_t get_extended_signal_quality ( int &  rxlev,
int &  ber,
int &  rscp,
int &  ecno,
int &  rsrq,
int &  rsrp 
) [virtual]

Get extended signal quality parameters.

Parameters:
rxlevsignal strength level
berbit error rate
rscpsignal code power
ecnoratio of the received energy per PN chip to the total received power spectral density
rsrqsignal received quality
rsrpsignal received power
Returns:
NSAPI_ERROR_OK on success NSAPI_ERROR_DEVICE_ERROR on other failures

Implements CellularNetwork.

Definition at line 1226 of file AT_CellularNetwork.cpp.

const char * get_gateway (  ) [virtual, inherited]

Get the local gateway.

Returns:
Null-terminated representation of the local gateway or null if no network mask has been received

Definition at line 38 of file NetworkInterface.cpp.

const char * get_mac_address (  ) [virtual, inherited]

Get the local MAC address.

Provided MAC address is intended for info or debug purposes and may not be provided if the underlying network interface does not provide a MAC address

Returns:
Null-terminated representation of the local MAC address or null if no MAC address is available

Definition at line 23 of file NetworkInterface.cpp.

bool get_modem_stack_type ( nsapi_ip_stack_t  requested_stack ) [protected, virtual]

Check if modem supports the given stack type.

Returns:
true if supported

Definition at line 977 of file AT_CellularNetwork.cpp.

const char * get_netmask (  ) [virtual, inherited]

Get the local network mask.

Returns:
Null-terminated representation of the local network mask or null if no network mask has been received

Definition at line 33 of file NetworkInterface.cpp.

nsapi_error_t get_network_registering_mode ( NWRegisteringMode &  mode ) [virtual]

Get the current network registering mode.

Parameters:
modeon 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 746 of file AT_CellularNetwork.cpp.

nsapi_error_t get_operator_names ( operator_names_list op_names ) [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

Implements CellularNetwork.

Definition at line 1307 of file AT_CellularNetwork.cpp.

nsapi_error_t get_operator_params ( int &  format,
operator_t &  operator_params 
) [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

Implements CellularNetwork.

Definition at line 1276 of file AT_CellularNetwork.cpp.

nsapi_error_t get_pdpcontext_params ( pdpContextList_t params_list ) [virtual]

Get the relevant information for an active non secondary PDP context.

Remarks:
optional params are not updated if not received from network.
Parameters:
params_listreference to linked list, which is filled on successful call
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 1136 of file AT_CellularNetwork.cpp.

nsapi_error_t get_rate_control ( CellularNetwork::RateControlExceptionReports &  reports,
CellularNetwork::RateControlUplinkTimeUnit &  time_unit,
int &  uplink_rate 
) [virtual]

Get APN rate control.

Remarks:
optional params are not updated if not received from network, so use good defaults
Parameters:
reportsAdditional exception reports at maximum rate reached are allowed to be sent [optional]
time_unitUplink time unit with values 0=unrestricted, 1=minute, 2=hour, 3=day, 4=week [optional]
uplink_rateMaximum number of messages per timeUnit [optional]
Returns:
NSAPI_ERROR_OK on success NSAPI_ERROR_DEVICE_ERROR on case of failure

Implements CellularNetwork.

Definition at line 1094 of file AT_CellularNetwork.cpp.

nsapi_error_t get_registration_status ( RegistrationType  type,
RegistrationStatus &  status 
) [virtual]

Gets the network registration status.

Parameters:
typesee RegistrationType values
statussee RegistrationStatus values
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 819 of file AT_CellularNetwork.cpp.

nsapi_error_t get_signal_quality ( int &  rssi,
int &  ber 
) [virtual]

Get signal quality parameters.

Parameters:
rssisignal strength level
berbit error rate
Returns:
NSAPI_ERROR_OK on success NSAPI_ERROR_DEVICE_ERROR on other failures

Implements CellularNetwork.

Definition at line 1249 of file AT_CellularNetwork.cpp.

nsapi_ip_stack_t get_stack_type (  ) [virtual]

Get the pdn type in use.

Returns:
stack type

Implements CellularNetwork.

Definition at line 972 of file AT_CellularNetwork.cpp.

MBED_WEAK NetworkInterface * get_target_default_instance (  ) [static, protected, inherited]

Get the target's default network instance.

This method can be overridden by the target. Default implementations are provided weakly by various subsystems as described in NetworkInterface::get_default_instance(), so targets should not need to override in simple cases.

If a target has more elaborate interface selection, it can completely override this behaviour by implementing NetworkInterface::get_target_default_instance() themselves, either unconditionally, or for a specific network-default-interface-type setting

For example, a device with both Ethernet and Wi-fi could be set up its target so that: * DEVICE_EMAC is set, and it provides EMAC::get_default_instance(), which means EthernetInterface provides EthInterface::get_target_instance() based on that EMAC. * It provides WifiInterface::get_target_default_instance(). * The core will route NetworkInterface::get_default_instance() to either of those if network-default-interface-type is set to ETHERNET or WIFI. * The board overrides NetworkInterface::get_target_default_instance() if network-default-interface-type is set to AUTO. This returns either EthInterface::get_default_instance() or WiFIInterface::get_default_instance() depending on a cable detection.

performs the search described by get_default_instance.

Definition at line 74 of file NetworkInterfaceDefaults.cpp.

nsapi_error_t gethostbyname ( const char *  host,
SocketAddress *  address,
nsapi_version_t  version = NSAPI_UNSPEC 
) [virtual, inherited]

Translates a hostname to an IP address with specific version.

The hostname may be either a domain name or an IP address. If the hostname is an IP address, no network transactions will be performed.

If no stack-specific DNS resolution is provided, the hostname will be resolve using a UDP socket on the stack.

Parameters:
hostHostname to resolve
addressDestination for the host SocketAddress
versionIP version of address to resolve, NSAPI_UNSPEC indicates version is chosen by the stack (defaults to NSAPI_UNSPEC)
Returns:
0 on success, negative error code on failure

Definition at line 58 of file NetworkInterface.cpp.

nsapi_value_or_error_t gethostbyname_async ( const char *  host,
hostbyname_cb_t  callback,
nsapi_version_t  version = NSAPI_UNSPEC 
) [virtual, inherited]

Translates a hostname to an IP address (asynchronous)

The hostname may be either a domain name or an IP address. If the hostname is an IP address, no network transactions will be performed.

If no stack-specific DNS resolution is provided, the hostname will be resolve using a UDP socket on the stack.

Call is non-blocking. Result of the DNS operation is returned by the callback. If this function returns failure, callback will not be called. In case result is success (IP address was found from DNS cache), callback will be called before function returns.

Parameters:
hostHostname to resolve
callbackCallback that is called for result
versionIP version of address to resolve, NSAPI_UNSPEC indicates version is chosen by the stack (defaults to NSAPI_UNSPEC)
Returns:
0 on immediate success, negative error code on immediate failure or a positive unique id that represents the hostname translation operation and can be passed to cancel

Definition at line 63 of file NetworkInterface.cpp.

nsapi_error_t gethostbyname_async_cancel ( int  id ) [virtual, inherited]

Cancels asynchronous hostname translation.

When translation is cancelled, callback will not be called.

Parameters:
idUnique id of the hostname translation operation
Returns:
0 on success, negative error code on failure

Definition at line 68 of file NetworkInterface.cpp.

nsapi_error_t init (  ) [virtual]

Does all the needed initializations that can fail.

Remarks:
must be called immediately after constructor.
Returns:
NSAPI_ERROR_OK on success NSAPI_ERROR_NO_MEMORY on memory failure

Implements CellularNetwork.

Definition at line 68 of file AT_CellularNetwork.cpp.

MBED_DEPRECATED_SINCE ( "mbed-os-5.9"  ,
"Parameter timeout will be deprecated. Use mbed-os/features/cellular/framework/API/CellularDevice.h set_timeout instead."   
) [inherited]

Request attach to network.

Parameters:
timeoutmilliseconds to wait for attach response
Returns:
NSAPI_ERROR_OK on success NSAPI_ERROR_DEVICE_ERROR on failure
virtual MeshInterface* meshInterface (  ) [virtual, inherited]

Dynamic downcast to a MeshInterface.

Definition at line 259 of file NetworkInterface.h.

nsapi_error_t scan_plmn ( operList_t operators,
int &  ops_count 
) [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

Implements CellularNetwork.

Definition at line 1008 of file AT_CellularNetwork.cpp.

nsapi_error_t set_access_technology ( RadioAccessTechnology  rat ) [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(...)

Implements CellularNetwork.

Definition at line 997 of file AT_CellularNetwork.cpp.

nsapi_error_t set_access_technology_impl ( RadioAccessTechnology  op_rat ) [protected, virtual]

Sets access technology to be scanned.

Modem specific implementation.

Parameters:
op_ratAccess technology
Returns:
zero on success

Definition at line 986 of file AT_CellularNetwork.cpp.

nsapi_error_t set_blocking ( bool  blocking ) [virtual]

Set blocking status of connect() which by default should be blocking.

Parameters:
blockingtrue if connect is blocking
Returns:
NSAPI_ERROR_OK if PPP mode check errors from nsapi_ppp_set_blocking(...)

Implements CellularNetwork.

Definition at line 495 of file AT_CellularNetwork.cpp.

nsapi_error_t set_ciot_optimization_config ( Supported_UE_Opt  supported_opt,
Preferred_UE_Opt  preferred_opt 
) [virtual]

Set 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

Implements CellularNetwork.

Definition at line 1057 of file AT_CellularNetwork.cpp.

virtual nsapi_error_t set_credentials ( const char *  apn,
AuthenticationType  type,
const char *  username = 0,
const char *  password = 0 
) [pure virtual, inherited]

Set the cellular network APN and credentials.

Parameters:
apnName of the network to connect to
typeAuthentication type to use
usernameOptional username for the APN
passwordOptional password fot the APN
Returns:
NSAPI_ERROR_OK on success NSAPI_ERROR_NO_MEMORY on memory failure
nsapi_error_t set_credentials ( const char *  apn,
const char *  username = 0,
const char *  password = 0 
) [virtual]

Set the cellular network APN and credentials.

Parameters:
apnOptional name of the network to connect to
usernameOptional username for the APN
passwordOptional password fot the APN
Returns:
NSAPI_ERROR_OK on success NSAPI_ERROR_NO_MEMORY on memory failure

Implements CellularNetwork.

Definition at line 197 of file AT_CellularNetwork.cpp.

nsapi_error_t set_dhcp ( bool  dhcp ) [virtual, inherited]

Enable or disable DHCP on the network.

Enables DHCP on connecting the network. Defaults to enabled unless a static IP address has been assigned. Requires that the network is disconnected.

Parameters:
dhcpTrue to enable DHCP
Returns:
0 on success, negative error code on failure

Definition at line 48 of file NetworkInterface.cpp.

nsapi_error_t set_network ( const char *  ip_address,
const char *  netmask,
const char *  gateway 
) [virtual, inherited]

Set a static IP address.

Configures this network interface to use a static IP address. Implicitly disables DHCP, which can be enabled in set_dhcp. Requires that the network is disconnected.

Parameters:
ip_addressNull-terminated representation of the local IP address
netmaskNull-terminated representation of the local network mask
gatewayNull-terminated representation of the local gateway
Returns:
0 on success, negative error code on failure

Definition at line 43 of file NetworkInterface.cpp.

nsapi_error_t set_registration ( const char *  plmn = 0 ) [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

Implements CellularNetwork.

Definition at line 758 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:
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

Implements CellularNetwork.

Definition at line 718 of file AT_CellularNetwork.cpp.

nsapi_error_t set_stack_type ( nsapi_ip_stack_t  stack_type ) [virtual]

Set the pdn type to be used.

Parameters:
stack_typethe stack type to be used.
Returns:
NSAPI_ERROR_OK on success NSAPI_ERROR_PARAMETER if modem does not support the given stack_type

Implements CellularNetwork.

Definition at line 962 of file AT_CellularNetwork.cpp.

virtual WiFiInterface* wifiInterface (  ) [virtual, inherited]

Dynamic downcast to a WiFiInterface.

Definition at line 253 of file NetworkInterface.h.


Field Documentation

AT_CellularBase::SupportedFeature const * _unsupported_features [static, protected, inherited]

Check if some functionality is supported by a cellular module.

For example, most of standard AT commands are optional and not implemented by all cellular modules.

Parameters:
featurecheck for feature to support
Returns:
true on supported, otherwise false

Definition at line 67 of file AT_CellularBase.h.