ModemManager::Modem

Search for usage in LXR

ModemManager::Modem Class Reference

#include <modem.h>

Inherits ModemManager::Interface.

Public Types

typedef QFlags< MMModemAccessTechnology > AccessTechnologies
 
typedef QFlags< MMModemCapability > Capabilities
 
typedef QFlags< MMBearerIpFamily > IpBearerFamilies
 
typedef QList< PtrList
 
typedef QFlags< MMModemMode > ModemModes
 
typedef QSharedPointer< ModemPtr
 

Signals

void accessTechnologiesChanged (QFlags< MMModemAccessTechnology > accessTechnologies)
 
void bearerAdded (const QString &bearer)
 
void bearerRemoved (const QString &bearer)
 
void bearersChanged ()
 
void currentBandsChanged (const QList< MMModemBand > &supportedBands)
 
void currentCapabilitiesChanged (const QFlags< MMModemCapability > &currentCapabilities)
 
void currentModesChanged (ModemManager::CurrentModesType currentModes)
 
void deviceChanged (const QString &device)
 
void deviceIdentifierChanged (const QString &deviceIdentifier)
 
void driversChanged (const QStringList &drivers)
 
void equipmentIdentifierChanged (const QString &equipmentIdentifier)
 
void manufacturerChanged (const QString &manufacturer)
 
void maxActiveBearersChanged (uint maxActiveBearers)
 
void maxBearersChanged (uint maxBearers)
 
void modelChanged (const QString &model)
 
void ownNumbersChanged (const QStringList &ownNumbers)
 
void pluginChanged (const QString &plugin)
 
void portsChanged (const ModemManager::PortList &ports)
 
void powerStateChanged (MMModemPowerState powerState)
 
void primaryPortChanged (const QString &primaryPort)
 
void revisionChanged (const QString &revision)
 
void signalQualityChanged (ModemManager::SignalQualityPair signalQuality)
 
void simPathChanged (const QString &oldPath, const QString &newPath)
 
void stateChanged (MMModemState oldState, MMModemState newState, MMModemStateChangeReason reason)
 
void stateFailedReasonChanged (MMModemStateFailedReason stateFailedReason)
 
void supportedBandsChanged (const QList< MMModemBand > &supportedBands)
 
void supportedCapabilitiesChanged (const QList< MMModemCapability > &supportedCapabilities)
 
void supportedIpFamiliesChanged (QFlags< MMBearerIpFamily > supportedIpFamilies)
 
void supportedModesChanged (ModemManager::SupportedModesType supportedModes)
 
void unlockRequiredChanged (MMModemLock unlockRequired)
 
void unlockRetriesChanged (const ModemManager::UnlockRetriesMap &unlockRetries)
 

Public Member Functions

 Modem (const QString &path, QObject *parent=nullptr)
 
AccessTechnologies accessTechnologies () const
 
QDBusPendingReply< QStringcommand (const QString &cmd, uint timeout)
 
QDBusPendingReply< QDBusObjectPathcreateBearer (const ModemManager::BearerProperties &bearerProperties)
 
QList< MMModemBand > currentBands () const
 
Capabilities currentCapabilities () const
 
CurrentModesType currentModes () const
 
QDBusPendingReply< void > deleteBearer (const QString &bearer)
 
QString device () const
 
QString deviceIdentifier () const
 
QStringList drivers () const
 
QString equipmentIdentifier () const
 
QDBusPendingReply< void > factoryReset (const QString &code)
 
ModemManager::Bearer::Ptr findBearer (const QString &bearer) const
 
bool isEnabled () const
 
bool isValid () const
 
ModemManager::Bearer::List listBearers () const
 
QString manufacturer () const
 
uint maxActiveBearers () const
 
uint maxBearers () const
 
QString model () const
 
QStringList ownNumbers () const
 
QString plugin () const
 
PortList ports () const
 
MMModemPowerState powerState () const
 
QString primaryPort () const
 
QDBusPendingReply< void > reset ()
 
QString revision () const
 
QDBusPendingReply< void > setCurrentBands (const QList< MMModemBand > &bands)
 
QDBusPendingReply< void > setCurrentCapabilities (Capabilities caps)
 
QDBusPendingReply< void > setCurrentModes (const CurrentModesType &mode)
 
QDBusPendingReply< void > setEnabled (bool enable)
 
QDBusPendingReply< void > setPowerState (MMModemPowerState state)
 
void setTimeout (int timeout)
 
SignalQualityPair signalQuality () const
 
QString simPath () const
 
MMModemState state () const
 
MMModemStateFailedReason stateFailedReason () const
 
QList< MMModemBand > supportedBands () const
 
QList< MMModemCapability > supportedCapabilities () const
 
IpBearerFamilies supportedIpFamilies () const
 
SupportedModesType supportedModes () const
 
int timeout () const
 
QString uni () const
 
MMModemLock unlockRequired () const
 
UnlockRetriesMap unlockRetries () const
 

Detailed Description

The Modem class.

The Modem interface controls the status and actions in a given modem object.

Definition at line 146 of file modem.h.

Member Typedef Documentation

◆ AccessTechnologies

typedef QFlags< MMModemAccessTechnology > ModemManager::Modem::AccessTechnologies

Definition at line 158 of file modem.h.

◆ Capabilities

typedef QFlags< MMModemCapability > ModemManager::Modem::Capabilities

Definition at line 157 of file modem.h.

◆ IpBearerFamilies

typedef QFlags< MMBearerIpFamily > ModemManager::Modem::IpBearerFamilies

Definition at line 160 of file modem.h.

◆ List

Definition at line 163 of file modem.h.

◆ ModemModes

typedef QFlags< MMModemMode > ModemManager::Modem::ModemModes

Definition at line 159 of file modem.h.

◆ Ptr

Definition at line 162 of file modem.h.

Constructor & Destructor Documentation

◆ Modem()

Modem::Modem ( const QString & path,
QObject * parent = nullptr )
explicit

Definition at line 225 of file modem.cpp.

◆ ~Modem()

Modem::~Modem ( )
override

Definition at line 261 of file modem.cpp.

Member Function Documentation

◆ accessTechnologies()

ModemManager::Modem::AccessTechnologies Modem::accessTechnologies ( ) const
Returns
QFlags of MMModemAccessTechnology values, specifying the current network access technologies used by the device to communicate with the network.

If the device's access technology cannot be determined, MM_MODEM_ACCESS_TECHNOLOGY_UNKNOWN will be reported.

Definition at line 504 of file modem.cpp.

◆ command()

QDBusPendingReply< QString > Modem::command ( const QString & cmd,
uint timeout )

Definition at line 384 of file modem.cpp.

◆ createBearer()

QDBusPendingReply< QDBusObjectPath > Modem::createBearer ( const ModemManager::BearerProperties & bearerProperties)

Create a new packet data bearer using the given characteristics.

This request may fail if the modem does not support additional bearers, if too many bearers are already defined, or if properties are invalid.

Definition at line 289 of file modem.cpp.

◆ currentBands()

QList< MMModemBand > Modem::currentBands ( ) const
Returns
List of MMModemBand values, specifying the radio frequency and technology bands the device is currently using when connecting to a network.

It must be a subset of supportedBands()

Definition at line 546 of file modem.cpp.

◆ currentCapabilities()

ModemManager::Modem::Capabilities Modem::currentCapabilities ( ) const
Returns
QFlags of MMModemCapability values, specifying the generic family of access technologies the modem currently supports without a firmware reload or reinitialization.

Definition at line 402 of file modem.cpp.

◆ currentModes()

ModemManager::CurrentModesType Modem::currentModes ( ) const
Returns
A pair of MMModemMode values, where the first one is a bitmask specifying the access technologies (eg 2G/3G/4G) the device is currently allowed to use when connecting to a network, and the second one is the preferred mode of those specified as allowed.

The pair must be one of those specified in supportedModes()

Definition at line 534 of file modem.cpp.

◆ deleteBearer()

QDBusPendingReply< void > Modem::deleteBearer ( const QString & bearer)

Delete an existing packet data bearer.

If the bearer is currently active and providing packet data server, it will be disconnected and that packet data service will terminate.

Parameters
bearerpath to the bearer to delete

Definition at line 316 of file modem.cpp.

◆ device()

QString Modem::device ( ) const
Returns
The physical modem device reference (ie, USB, PCI, PCMCIA device), which may be dependent upon the operating system.

In Linux for example, this points to a sysfs path of the usb_device object.

Definition at line 444 of file modem.cpp.

◆ deviceIdentifier()

QString Modem::deviceIdentifier ( ) const
Returns
A best-effort device identifier based on various device information like model name, firmware revision, USB/PCI/PCMCIA IDs, and other properties.

This ID is not guaranteed to be unique and may be shared between identical devices with the same firmware, but is intended to be "unique enough" for use as a casual device identifier for various user experience operations.

This is not the device's IMEI or ESN since those may not be available before unlocking the device via a PIN.

Definition at line 438 of file modem.cpp.

◆ drivers()

QStringList Modem::drivers ( ) const
Returns
The Operating System device drivers handling communication with the modem hardware.

Definition at line 450 of file modem.cpp.

◆ equipmentIdentifier()

QString Modem::equipmentIdentifier ( ) const
Returns
The identity of the device.

This will be the IMEI number for GSM devices and the hex-format ESN/MEID for CDMA devices.

Definition at line 474 of file modem.cpp.

◆ factoryReset()

QDBusPendingReply< void > Modem::factoryReset ( const QString & code)

Clear the modem's configuration (including persistent configuration and state), and return the device to a factory-default state.

If not required by the modem, code may be ignored.

This command may or may not power-cycle the device.

Parameters
codeCarrier-supplied code required to reset the modem.

Definition at line 350 of file modem.cpp.

◆ findBearer()

ModemManager::Bearer::Ptr Modem::findBearer ( const QString & bearer) const
Returns
the configured packet data bearer on given path

Definition at line 338 of file modem.cpp.

◆ isEnabled()

bool Modem::isEnabled ( ) const
Returns
true if the modem is fully functional, false when in low power mode or disabled
See also
setEnabled()

Definition at line 271 of file modem.cpp.

◆ isValid()

bool Modem::isValid ( ) const

Definition at line 277 of file modem.cpp.

◆ listBearers()

ModemManager::Bearer::List Modem::listBearers ( ) const
Returns
the configured packet data bearers (EPS Bearers, PDP Contexts, or CDMA2000 Packet Data Sessions).

Definition at line 322 of file modem.cpp.

◆ manufacturer()

QString Modem::manufacturer ( ) const
Returns
The equipment manufacturer, as reported by the modem.

Definition at line 420 of file modem.cpp.

◆ maxActiveBearers()

uint Modem::maxActiveBearers ( ) const
Returns
The maximum number of active packet data bearers the modem supports.

POTS and CDMA2000-only devices support one active bearer, while GSM/UMTS and LTE-capable devices (including LTE/CDMA devices) typically support at least two active bearers.

Definition at line 414 of file modem.cpp.

◆ maxBearers()

uint Modem::maxBearers ( ) const
Returns
The maximum number of defined packet data bearers the modem supports.

This is not the number of active/connected bearers the modem supports, but simply the number of bearers that may be defined at any given time. For example, POTS and CDMA2000-only devices support only one bearer, while GSM/UMTS devices typically support three or more, and any LTE-capable device (whether LTE-only, GSM/UMTS-capable, and/or CDMA2000-capable) also typically support three or more.

Definition at line 408 of file modem.cpp.

◆ model()

QString Modem::model ( ) const
Returns
The equipment model, as reported by the modem.

Definition at line 426 of file modem.cpp.

◆ ownNumbers()

QStringList Modem::ownNumbers ( ) const
Returns
List of numbers (e.g. MSISDN in 3GPP) being currently handled by this modem.

Definition at line 516 of file modem.cpp.

◆ plugin()

QString Modem::plugin ( ) const
Returns
The name of the plugin handling this modem.

Definition at line 456 of file modem.cpp.

◆ ports()

ModemManager::PortList Modem::ports ( ) const
Returns
The list of ports in the modem, given as an array of string and unsigned integer pairs. The string is the port name or path, and the integer is the port type given as a MMModemPortType value.
Since
1.1.94

Definition at line 468 of file modem.cpp.

◆ powerState()

MMModemPowerState Modem::powerState ( ) const
Returns
A MMModemPowerState value specifying the current power state of the modem.

Definition at line 522 of file modem.cpp.

◆ primaryPort()

QString Modem::primaryPort ( ) const
Returns
The name of the primary port using to control the modem.

Definition at line 462 of file modem.cpp.

◆ reset()

QDBusPendingReply< void > Modem::reset ( )

Clear non-persistent configuration and state, and return the device to a newly-powered-on state.

This command may power-cycle the device.

Definition at line 344 of file modem.cpp.

◆ revision()

QString Modem::revision ( ) const
Returns
The revision identification of the software, as reported by the modem.

Definition at line 432 of file modem.cpp.

◆ setCurrentBands()

QDBusPendingReply< void > Modem::setCurrentBands ( const QList< MMModemBand > & bands)

Set the radio frequency and technology bands the device is currently allowed to use when connecting to a network.

Parameters
bandsList of MMModemBand values, to specify the bands to be used.

Definition at line 374 of file modem.cpp.

◆ setCurrentCapabilities()

QDBusPendingReply< void > Modem::setCurrentCapabilities ( Capabilities caps)

Set the capabilities of the device.

A restart of the modem may be required.

Parameters
capsQFlags of MMModemCapability values, to specify the capabilities to use.

Definition at line 362 of file modem.cpp.

◆ setCurrentModes()

QDBusPendingReply< void > Modem::setCurrentModes ( const CurrentModesType & mode)

Set the access technologies (e.g.

2G/3G/4G preference) the device is currently allowed to use when connecting to a network.

The given combination should be supported by the modem, as specified in supportedModes()

Parameters
mode

Definition at line 368 of file modem.cpp.

◆ setEnabled()

QDBusPendingReply< void > Modem::setEnabled ( bool enable)

Enable or disable the modem.

When enabled, the modem's radio is powered on and data sessions, voice calls, location services, and Short Message Service may be available.

When disabled, the modem enters low-power state and no network-related operations are available.

Definition at line 283 of file modem.cpp.

◆ setPowerState()

QDBusPendingReply< void > Modem::setPowerState ( MMModemPowerState state)

Set the power state of the modem.

This action can only be run when the modem is in MM_MODEM_STATE_DISABLED state.

Definition at line 356 of file modem.cpp.

◆ setTimeout()

void Modem::setTimeout ( int timeout)

Sets the timeout in milliseconds for all async method DBus calls.

-1 means the default DBus timeout (usually 25 seconds).

Definition at line 577 of file modem.cpp.

◆ signalQuality()

ModemManager::SignalQualityPair Modem::signalQuality ( ) const
Returns
Signal quality in percent (0 - 100) of the dominant access technology the device is using to communicate with the network. Always 0 for POTS devices.

The additional boolean value indicates if the quality value given was recently taken.

Definition at line 510 of file modem.cpp.

◆ simPath()

QString Modem::simPath ( ) const
Returns
The path of the SIM object available in this device, if any.

Definition at line 390 of file modem.cpp.

◆ state()

MMModemState Modem::state ( ) const
Returns
Overall state of the modem, given as a MMModemState value.

If the device's state cannot be determined, MM_MODEM_STATE_UNKNOWN will be reported.

Definition at line 492 of file modem.cpp.

◆ stateFailedReason()

MMModemStateFailedReason Modem::stateFailedReason ( ) const
Returns
Error specifying why the modem is in MM_MODEM_STATE_FAILED state, given as a MMModemStateFailedReason value.

Definition at line 498 of file modem.cpp.

◆ supportedBands()

QList< MMModemBand > Modem::supportedBands ( ) const
Returns
List of MMModemBand values, specifying the radio frequency and technology bands supported by the device.

For POTS devices, only the MM_MODEM_BAND_ANY mode will be returned.

Definition at line 540 of file modem.cpp.

◆ supportedCapabilities()

QList< MMModemCapability > Modem::supportedCapabilities ( ) const
Returns
List of MMModemCapability values, specifying the combinations of generic family of access technologies the modem supports.

If the modem doesn't allow changing the current capabilities, a single entry with MM_MODEM_CAPABILITY_ANY will be given.

Definition at line 396 of file modem.cpp.

◆ supportedIpFamilies()

ModemManager::Modem::IpBearerFamilies Modem::supportedIpFamilies ( ) const
Returns
QFlags of MMBearerIpFamily values, specifying the IP families supported by the device.

Definition at line 552 of file modem.cpp.

◆ supportedModes()

ModemManager::SupportedModesType Modem::supportedModes ( ) const
Returns
This property exposes the supported mode combinations, given as an list of unsigned integer pairs, where: The first integer is a bitmask of MMModemMode values, specifying the allowed modes. The second integer is a single MMModemMode, which specifies the preferred access technology, among the ones defined in the allowed modes.

Definition at line 528 of file modem.cpp.

◆ timeout()

int Modem::timeout ( ) const

Returns the current value of the DBus timeout in milliseconds.

-1 means the default DBus timeout (usually 25 seconds).

Definition at line 583 of file modem.cpp.

◆ uni()

QString Modem::uni ( ) const

Definition at line 265 of file modem.cpp.

◆ unlockRequired()

MMModemLock Modem::unlockRequired ( ) const
Returns
Current lock state of the device, given as a MMModemLock value.

Definition at line 480 of file modem.cpp.

◆ unlockRetries()

ModemManager::UnlockRetriesMap Modem::unlockRetries ( ) const
Returns
A dictionary in which the keys are MMModemLock flags, and the values are integers giving the number of PIN tries remaining before the code becomes blocked (requiring a PUK) or permanently blocked. Dictionary entries exist only for the codes for which the modem is able to report retry counts.

Definition at line 486 of file modem.cpp.


The documentation for this class was generated from the following files:
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Tue Mar 26 2024 11:17:51 by doxygen 1.10.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.