45 #include "../qnetworksession_impl.h" 47 #include <QtNetwork/private/qnetworkconfiguration_p.h> 49 #include <QtNetwork/qnetworksession.h> 51 #include <QtCore/qdebug.h> 53 #include <QtDBus/QtDBus> 54 #include <QtDBus/QDBusConnection> 55 #include <QtDBus/QDBusInterface> 56 #include <QtDBus/QDBusMessage> 57 #include <QtDBus/QDBusReply> 59 #ifndef QT_NO_BEARERMANAGEMENT 113 config->
id = cpPriv->
id;
120 fetchedConfigurations.
append(config);
123 return fetchedConfigurations;
153 if(serv.
getType() !=
"cellular") {
178 if(serv.
getType() !=
"cellular") {
228 if(serv.
isFavorite() && (servState ==
"idle" || servState ==
"failure")) {
232 if(servState ==
"association" || servState ==
"configuration" || servState ==
"login") {
235 if(servState ==
"ready" || servState ==
"online") {
257 QFile tx(
"/sys/class/net/"+devFile+
"/statistics/tx_bytes");
272 QFile rx(
"/sys/class/net/"+devFile+
"/statistics/rx_bytes");
313 if(item ==
"Services") {
318 foreach(
const QString service, list) {
324 if(item ==
"Technologies") {
327 if(newlist.count() > 0) {
330 foreach(
const QString listPath, newlist) {
341 if(item ==
"State") {
349 if(item ==
"State") {
361 if(item ==
"State") {
393 if (ptr->
name != networkName) {
394 ptr->
name = networkName;
397 if (ptr->
state != curState) {
398 ptr->
state = curState;
417 if( serv.
getType() ==
"cellular") {
442 if (type ==
"ethernet")
444 if (type ==
"bluetooth")
446 if (type ==
"cellular") {
463 if(ofonoNetwork.isValid()) {
467 foreach(
const QString opTech, opIface.getTechnologies()) {
469 if(opTech ==
"gsm") {
472 if(opTech ==
"edge"){
475 if(opTech ==
"umts"){
478 if(opTech ==
"hspa"){
542 if (connectionType ==
"ethernet") {
544 }
else if (connectionType ==
"wifi") {
546 }
else if (connectionType ==
"cellular") {
549 networkName = serv->
getAPN();
555 }
else if (connectionType ==
"wimax") {
561 cpPriv->
name = networkName;
594 #endif // QT_NO_BEARERMANAGEMENT BearerType
Specifies the type of bearer used by a configuration.
static QString number(int, int base=10)
This is an overloaded member function, provided for convenience. It differs from the above function o...
QBool contains(QChar c, Qt::CaseSensitivity cs=Qt::CaseSensitive) const
QString section(QChar sep, int start, int end=-1, SectionFlags flags=SectionDefault) const
This function returns a section of the string.
uint qHash(const QProcEnvKey &key)
QList< QString > serviceNetworks
virtual quint64 bytesWritten(const QString &id)
bool isNull() const
Returns true if both the date and the time are null; otherwise returns false.
#define QT_END_NAMESPACE
This macro expands to.
void lock()
Locks the mutex.
bool isRoamingAllowed(const QString &context)
T qdbus_cast(const QDBusArgument &arg)
virtual void disconnectFromId(const QString &id)
void addServiceConfiguration(const QString &servicePath)
QNetworkConfiguration::StateFlags state
bool open(OpenMode flags)
Opens the file using OpenMode mode, returning true if successful; otherwise false.
The QDBusArgument class is used to marshall and demarshall D-Bus arguments.
bool isValid() const
Returns true if this is a valid reference to a remote object.
QDBusObjectPath currentModem()
QNetworkConfiguration::StateFlags getStateForService(const QString &service)
void configurationChanged(QNetworkConfigurationPrivatePointer config)
void unlock()
Unlocks this mutex locker.
virtual quint64 startTime(const QString &id)
QString toString() const
Returns the variant as a QString if the variant has type() String , Bool , ByteArray ...
QStringList getTechnologies()
State
This enum describes the connectivity state of the session.
int count(const T &t) const
Returns the number of occurrences of value in the list.
The QString class provides a Unicode character string.
bool requiresPolling() const
QMap< QString, QString > configInterfaces
The QObject class is the base class of all Qt objects.
QNetworkConfiguration::BearerType bearerType
QStringList getServices()
bool exists() const
Returns true if the file specified by fileName() exists; otherwise returns false. ...
void relock()
Relocks an unlocked mutex locker.
QConnmanManagerInterface * connmanManager
bool removeOne(const T &t)
Removes the first occurrence of value in the list and returns true on success; otherwise returns fals...
void append(const T &t)
Inserts value at the end of the list.
QList< QNetworkConfigurationPrivate * > getConfigurations()
#define QT_BEGIN_NAMESPACE
This macro expands to.
void technologyPropertyChangedContext(const QString &, const QString &, const QDBusVariant &)
QHash< QString, QNetworkConfigurationPrivatePointer > accessPointConfigurations
virtual QString getInterfaceFromId(const QString &id)
static bool connect(const QObject *sender, const char *signal, const QObject *receiver, const char *member, Qt::ConnectionType=Qt::AutoConnection)
Creates a connection of the given type from the signal in the sender object to the method in the rece...
bool isEmpty() const
Returns true if the string has no characters; otherwise returns false.
QMap< QString, QConnmanTechnologyInterface * > technologies
const T value(const Key &key) const
Returns the value associated with the key key.
const T & at(int i) const
Returns the item at index position i in the list.
The QStringList class provides a list of strings.
int secsTo(const QDateTime &) const
Returns the number of seconds from this datetime to the other datetime.
void configurationAdded(QNetworkConfigurationPrivatePointer config)
QConnmanEngine(QObject *parent=0)
QList< QNetworkConfigurationPrivate * > foundConfigurations
void configurationChange(const QString &id)
QNetworkSessionPrivate * createSessionBackend()
QString path() const
Returns this object path.
const T * ptr(const T &t)
virtual void connectToId(const QString &id)
void unlock()
Unlocks the mutex.
bool connmanAvailable() const
static bool disconnect(const QObject *sender, const char *signal, const QObject *receiver, const char *member)
Disconnects signal in object sender from method in object receiver.
int remove(const Key &key)
Removes all the items that have the key key from the map.
void servicePropertyChangedContext(const QString &, const QString &, const QDBusVariant &)
The QMutexLocker class is a convenience class that simplifies locking and unlocking mutexes...
QNetworkConfiguration::Purpose purpose
The QFile class provides an interface for reading from and writing to files.
QExplicitlySharedDataPointer< QNetworkConfigurationPrivate > QNetworkConfigurationPrivatePointer
virtual QNetworkConfigurationPrivatePointer defaultConfiguration()
virtual quint64 bytesReceived(const QString &id)
The QTextStream class provides a convenient interface for reading and writing text.
bool requestScan(const QString &type)
QNetworkConfiguration::Type type
iterator insert(const Key &key, const T &value)
Inserts a new item with the key key and a value of value.
Q_INVOKABLE void requestUpdate()
bool singleShot
This static function calls a slot after a given time interval.
QNetworkSession::State sessionStateForId(const QString &id)
The QDBusObjectPath class enables the programmer to identify the OBJECT_PATH type provided by the D-B...
void configurationRemoved(QNetworkConfigurationPrivatePointer config)
QVariant variant() const
Returns this D-Bus variant as a QVariant object.
void propertyChangedContext(const QString &, const QString &, const QDBusVariant &)
static QDateTime currentDateTime()
Returns the current datetime, as reported by the system clock, in the local time zone.
QList< QDBusObjectPath > getPrimaryContexts()
bool contains(const Key &key) const
Returns true if the map contains an item with key key; otherwise returns false.
T qvariant_cast(const QVariant &)
QNetworkConfiguration::BearerType ofonoTechToBearerType(const QString &type)
void connectionError(const QString &id, QBearerEngineImpl::ConnectionError error)
QString serviceFromId(const QString &id)
void removeConfiguration(const QString &servicePath)
virtual QNetworkConfigurationManager::Capabilities capabilities() const
Q_INVOKABLE void initialize()
virtual void close()
Calls QFile::flush() and closes the file.
#define Q_UNUSED(x)
Indicates to the compiler that the parameter with the specified name is not used in the body of a fun...
bool hasIdentifier(const QString &id)
The QDBusVariant class enables the programmer to identify the variant type provided by the D-Bus type...
The QMap class is a template class that provides a skip-list-based dictionary.
The QList class is a template class that provides lists.
QNetworkConfiguration::BearerType typeToBearer(const QString &type)