ModemManager::Bearer Class

class ModemManager::Bearer

The Bearer class. More...

Header: #include <ModemManager::Bearer>
CMake: find_package(KF6 REQUIRED COMPONENTS ModemManagerQt)
target_link_libraries(mytarget PRIVATE KF6::ModemManagerQt)

Public Types

Public Functions

Bearer(const QString &path, QObject *parent = nullptr)
(since 6.24.0) MMBearerType bearerType() const
QDBusPendingReply<void> connectBearer()
(since 6.24.0) ModemManager::ConnectionError connectionError() const
QDBusPendingReply<void> disconnectBearer()
QString interface() const
ModemManager::IpConfig ip4Config() const
ModemManager::IpConfig ip6Config() const
uint ipTimeout() const
bool isConnected() const
(since 6.24.0) bool isMultiplexed() const
bool isSuspended() const
(since 6.24.0) uint profileId() const
QVariantMap properties() const
(since 6.24.0) bool reloadStatsSupported() const
void setTimeout(int timeout)
(since 6.24.0) QVariantMap stats() const
int timeout() const
QString uni() const

Signals

(since 6.24.0) void bearerTypeChanged(MMBearerType bearerType)
void connectedChanged(bool connected)
(since 6.24.0) void connectionErrorChanged(const ModemManager::ConnectionError &error)
void interfaceChanged(const QString &iface)
void ip4ConfigChanged(const ModemManager::IpConfig &ipv4Config)
void ip6ConfigChanged(const ModemManager::IpConfig &ipv6Config)
void ipTimeoutChanged(uint ipTimeout)
(since 6.24.0) void multiplexedChanged(bool multiplexed)
(since 6.24.0) void profileIdChanged(uint profileId)
void propertiesChanged(const QVariantMap &properties)
(since 6.24.0) void reloadStatsSupportedChanged(bool supported)
(since 6.24.0) void statsChanged(const QVariantMap &stats)
void suspendedChanged(bool suspended)

Detailed Description

This class provides access to specific actions that may be performed on available bearers.

Member Type Documentation

Bearer::List

Bearer::Ptr

Member Function Documentation

[explicit] Bearer::Bearer(const QString &path, QObject *parent = nullptr)

[since 6.24.0] MMBearerType Bearer::bearerType() const

Returns bearer type.

This function was introduced in 6.24.0.

[signal, since 6.24.0] void Bearer::bearerTypeChanged(MMBearerType bearerType)

This function was introduced in 6.24.0.

QDBusPendingReply<void> Bearer::connectBearer()

Requests activation of a packet data connection with the network using this bearer's properties. Upon successful activation, the modem can send and receive packet data and, depending on the addressing capability of the modem, a connection manager may need to start PPP, perform DHCP, or assign the IP address returned by the modem to the data interface. Upon successful return, the ip4Config() and/or ip6Config() properties become valid and may contain IP configuration information for the data interface associated with this bearer.

[signal] void Bearer::connectedChanged(bool connected)

[since 6.24.0] ModemManager::ConnectionError Bearer::connectionError() const

Returns additional information about the connection error.

This function was introduced in 6.24.0.

[signal, since 6.24.0] void Bearer::connectionErrorChanged(const ModemManager::ConnectionError &error)

This function was introduced in 6.24.0.

QDBusPendingReply<void> Bearer::disconnectBearer()

Disconnect and deactivate this packet data connection.

Any ongoing data session will be terminated and IP addresses become invalid when this method is called.

QString Bearer::interface() const

Returns the operating system name for the network data interface that provides packet data using this bearer.

Connection managers must configure this interface depending on the IP "method" given by the ip4Config() or ip6Config() properties set by bearer activation.

If MM_BEARER_IP_METHOD_STATIC or MM_BEARER_IP_METHOD_DHCP methods are given, the interface will be an ethernet-style interface suitable for DHCP or setting static IP configuration on, while if the MM_BEARER_IP_METHOD_PPP method is given, the interface will be a serial TTY which must then have PPP run over it.

[signal] void Bearer::interfaceChanged(const QString &iface)

ModemManager::IpConfig Bearer::ip4Config() const

If the bearer was configured for IPv4 addressing, upon activation this property contains the addressing details for assignment to the data interface.

[signal] void Bearer::ip4ConfigChanged(const ModemManager::IpConfig &ipv4Config)

ModemManager::IpConfig Bearer::ip6Config() const

If the bearer was configured for IPv6 addressing, upon activation this property contains the addressing details for assignment to the data interface.

[signal] void Bearer::ip6ConfigChanged(const ModemManager::IpConfig &ipv6Config)

uint Bearer::ipTimeout() const

Returns maximum time to wait for a successful IP establishment, when PPP is used.

[signal] void Bearer::ipTimeoutChanged(uint ipTimeout)

bool Bearer::isConnected() const

Returns whether or not the bearer is connected and thus whether packet data communication using this bearer is possible.

[since 6.24.0] bool Bearer::isMultiplexed() const

Returns whether the bearer is connected through a multiplexed network link.

This function was introduced in 6.24.0.

bool Bearer::isSuspended() const

In some devices, packet data service will be suspended while the device is handling other communication, like a voice call. If packet data service is suspended (but not deactivated) this property will be true

[signal, since 6.24.0] void Bearer::multiplexedChanged(bool multiplexed)

This function was introduced in 6.24.0.

[since 6.24.0] uint Bearer::profileId() const

Returns profile identifier.

This function was introduced in 6.24.0.

[signal, since 6.24.0] void Bearer::profileIdChanged(uint profileId)

This function was introduced in 6.24.0.

QVariantMap Bearer::properties() const

Returns map of properties used when creating the bearer

See also IpConfig.

[signal] void Bearer::propertiesChanged(const QVariantMap &properties)

[since 6.24.0] bool Bearer::reloadStatsSupported() const

Returns whether stats reload is supported.

This function was introduced in 6.24.0.

[signal, since 6.24.0] void Bearer::reloadStatsSupportedChanged(bool supported)

This function was introduced in 6.24.0.

void Bearer::setTimeout(int timeout)

Sets the timeout in milliseconds for all async method DBus calls. -1 means the default DBus timeout (usually 25 seconds).

See also timeout().

[since 6.24.0] QVariantMap Bearer::stats() const

Returns bearer statistics.

This function was introduced in 6.24.0.

[signal, since 6.24.0] void Bearer::statsChanged(const QVariantMap &stats)

This function was introduced in 6.24.0.

[signal] void Bearer::suspendedChanged(bool suspended)

int Bearer::timeout() const

Returns the current value of the DBus timeout in milliseconds. -1 means the default DBus timeout (usually 25 seconds).

See also setTimeout().

QString Bearer::uni() const

Returns the DBUS path (uni) to the object