File Information
Library: IoT/MobileConnection
Package: MobileConnection
Header: IoT/MobileConnection/MobileConnectionService.h
Description
The MobileConnectionService interface is used to configure and establish a mobile data connection.
Member Summary
Member Functions: authenticate, connectData, deviceName, disconnectData, enableRadio, enterPIN, getAPN, getPDPType, iccid, imei, imsi, isDataConnected, isRadioEnabled, lockSIM, networkOperator, phoneNumber, radioAccessTechnology, registrationStatus, setAPN, setPDPType, signalStrength, simState, unlockSIM
Types Aliases
Ptr
using Ptr = Poco::SharedPtr < MobileConnectionService >;
Constructors
MobileConnectionService
Creates the MobileConnectionService.
Destructor
~MobileConnectionService
virtual ~MobileConnectionService();
Destroys the MobileConnectionService.
Member Functions
authenticate
virtual void authenticate(
AuthMethod method,
const std::string & username,
const std::string & password
) = 0;
Provide the credentials for the mobile data connection.
connectData
virtual void connectData() = 0;
Establishes the data connection.
deviceName
virtual std::string deviceName() const = 0;
Returns the modem device name.
disconnectData
virtual void disconnectData() = 0;
Closes the data connection.
enableRadio
virtual void enableRadio(
bool enable
) = 0;
Enables or disables the radio.
enterPIN
virtual void enterPIN(
const std::string & pin
) = 0;
Provides the given PIN to the SIM.
getAPN
virtual std::string getAPN() const = 0;
Returns the configured Access Point Name (APN) for the mobile data connection.
getPDPType
virtual PDPType getPDPType() const = 0;
Returns the PDP Type for the mobile data connection.
iccid
virtual std::string iccid() const = 0;
Returns the SIMs ICCID (Integrated Circuit Card Identifier).
imei
virtual std::string imei() const = 0;
Returns the IMEI (International Mobile Equipment Identity).
imsi
virtual std::string imsi() const = 0;
Returns the SIM's IMSI (International Mobile Subscriber Identity).
isDataConnected
virtual bool isDataConnected() = 0;
Returns true if the data connection is available.
isRadioEnabled
virtual bool isRadioEnabled() const = 0;
Returns true if the radio is enabled, otherwise false.
lockSIM
virtual void lockSIM(
const std::string & pin
) = 0;
Locks the SIM, using the given PIN.
networkOperator
virtual std::string networkOperator() const = 0;
Returns the name of the network operator, if available, or an empty string otherwise.
phoneNumber
virtual std::string phoneNumber() const = 0;
Returns the phone number associated with the SIM.
radioAccessTechnology
virtual RadioAccessTechnology radioAccessTechnology() const = 0;
Returns the radio access technology (RAT) used to connect to the mobile network.
registrationStatus
virtual RegistrationStatus registrationStatus() const = 0;
Returns the network registration status.
setAPN
virtual void setAPN(
const std::string & apn
) = 0;
Sets the Access Point Name (APN) for the mobile data connection.
setPDPType
virtual void setPDPType(
PDPType type
) = 0;
Sets the PDP Type for the mobile data connection.
signalStrength
virtual int signalStrength() const = 0;
Returns the signal strength in a range from 0 to 5 (suitable for displaying corresponding "signal strength bars").
- 0: No signal.
- 1: Very weak signal.
- 2: Weak signal strength.
- 3: Good signal strength.
- 4: Strong signal strength.
- 5: Very strong signal strength.
Returns -1 if the signal strength cannot be obtained.
simState
virtual SIMState simState() const = 0;
Returns the current state of the SIM.
unlockSIM
virtual void unlockSIM(
const std::string & pin
) = 0;
Unlocks the SIM, using the given PIN.
Variables
dataConnected
Poco::BasicEvent < void > dataConnected;
The data connection has become available.
dataDisconnected
Poco::BasicEvent < void > dataDisconnected;
The data connection no longer is available.