summaryrefslogtreecommitdiffstats
path: root/src/plugins/bearer/symbian
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins/bearer/symbian')
-rw-r--r--src/plugins/bearer/symbian/qnetworksession_impl.cpp127
-rw-r--r--src/plugins/bearer/symbian/qnetworksession_impl.h5
-rw-r--r--src/plugins/bearer/symbian/symbian_3/symbian_3.pro2
-rw-r--r--src/plugins/bearer/symbian/symbianengine.cpp218
-rw-r--r--src/plugins/bearer/symbian/symbianengine.h1
5 files changed, 234 insertions, 119 deletions
diff --git a/src/plugins/bearer/symbian/qnetworksession_impl.cpp b/src/plugins/bearer/symbian/qnetworksession_impl.cpp
index f89ed0a..1de4c0f 100644
--- a/src/plugins/bearer/symbian/qnetworksession_impl.cpp
+++ b/src/plugins/bearer/symbian/qnetworksession_impl.cpp
@@ -146,62 +146,65 @@ void QNetworkSessionPrivateImpl::configurationRemoved(QNetworkConfigurationPriva
}
}
+void QNetworkSessionPrivateImpl::configurationAdded(QNetworkConfigurationPrivatePointer config)
+{
+ Q_UNUSED(config);
+ // If session is based on service network, some other app may create new access points
+ // to the SNAP --> synchronize session's state with that of interface's.
+ if (!publicConfig.isValid() || publicConfig.type() != QNetworkConfiguration::ServiceNetwork)
+ return;
+
+#ifdef QT_BEARERMGMT_SYMBIAN_DEBUG
+ qDebug() << "QNS this : " << QString::number((uint)this) << " - "
+ << "configurationAdded IAP: "
+ << toSymbianConfig(privateConfiguration(config))->numericIdentifier();
+#endif
+
+ syncStateWithInterface();
+}
+
+// Function sets the state of the session to match the state
+// of the underlying interface (the configuration this session is based on)
void QNetworkSessionPrivateImpl::syncStateWithInterface()
{
if (!publicConfig.isValid())
return;
- if (iFirstSync && publicConfig.isValid()) {
+ if (iFirstSync) {
QObject::connect(engine, SIGNAL(configurationStateChanged(TUint32, TUint32, QNetworkSession::State)),
this, SLOT(configurationStateChanged(TUint32, TUint32, QNetworkSession::State)));
// Listen to configuration removals, so that in case the configuration
// this session is based on is removed, session knows to enter Invalid -state.
QObject::connect(engine, SIGNAL(configurationRemoved(QNetworkConfigurationPrivatePointer)),
this, SLOT(configurationRemoved(QNetworkConfigurationPrivatePointer)));
+ // Connect to configuration additions, so that in case a configuration is added
+ // in a SNAP this session is based on, the session knows to synch its state with its
+ // interface.
+ QObject::connect(engine, SIGNAL(configurationAdded(QNetworkConfigurationPrivatePointer)),
+ this, SLOT(configurationAdded(QNetworkConfigurationPrivatePointer)));
}
// Start listening IAP state changes from QNetworkConfigurationManagerPrivate
iHandleStateNotificationsFromManager = true;
- // Check open connections to see if there is already
- // an open connection to selected IAP or SNAP
- TUint count;
- TRequestStatus status;
- iConnectionMonitor.GetConnectionCount(count, status);
- User::WaitForRequest(status);
- if (status.Int() != KErrNone) {
- return;
- }
-
- TUint numSubConnections;
- TUint connectionId;
- for (TUint i = 1; i <= count; i++) {
- TInt ret = iConnectionMonitor.GetConnectionInfo(i, connectionId, numSubConnections);
- if (ret == KErrNone) {
- TUint apId;
- iConnectionMonitor.GetUintAttribute(connectionId, 0, KIAPId, apId, status);
- User::WaitForRequest(status);
- if (status.Int() == KErrNone) {
- TInt connectionStatus;
- iConnectionMonitor.GetIntAttribute(connectionId, 0, KConnectionStatus, connectionStatus, status);
- User::WaitForRequest(status);
- if (connectionStatus == KLinkLayerOpen) {
- if (state != QNetworkSession::Closing) {
- if (newState(QNetworkSession::Connected, apId)) {
- return;
- }
- }
- }
- }
- }
- }
-
- if (state != QNetworkSession::Connected) {
- if ((publicConfig.state() & QNetworkConfiguration::Discovered) ==
- QNetworkConfiguration::Discovered) {
- newState(QNetworkSession::Disconnected);
- } else {
- newState(QNetworkSession::NotAvailable);
- }
+ // Check what is the state of the configuration this session is based on
+ // and set the session in appropriate state.
+#ifdef QT_BEARERMGMT_SYMBIAN_DEBUG
+ qDebug() << "QNS this : " << QString::number((uint)this) << " - "
+ << "syncStateWithInterface() state of publicConfig is: " << publicConfig.state();
+#endif
+ switch (publicConfig.state()) {
+ case QNetworkConfiguration::Active:
+ newState(QNetworkSession::Connected);
+ break;
+ case QNetworkConfiguration::Discovered:
+ newState(QNetworkSession::Disconnected);
+ break;
+ case QNetworkConfiguration::Defined:
+ newState(QNetworkSession::NotAvailable);
+ break;
+ case QNetworkConfiguration::Undefined:
+ default:
+ newState(QNetworkSession::Invalid);
}
}
@@ -253,7 +256,8 @@ QNetworkInterface QNetworkSessionPrivateImpl::currentInterface() const
<< "currentInterface() requested, state: " << state
<< "publicConfig validity: " << publicConfig.isValid();
if (activeInterface.isValid())
- qDebug() << "interface is: " << activeInterface.humanReadableName();
+ qDebug() << "QNS this : " << QString::number((uint)this) << " - "
+ << "interface is: " << activeInterface.humanReadableName();
#endif
if (!publicConfig.isValid() || state != QNetworkSession::Connected) {
@@ -382,7 +386,7 @@ void QNetworkSessionPrivateImpl::open()
SymbianNetworkConfigurationPrivate *symbianConfig =
toSymbianConfig(privateConfiguration(publicConfig));
-#ifdef OCC_FUNCTIONALITY_AVAILABLE
+#if defined(OCC_FUNCTIONALITY_AVAILABLE) && defined(SNAP_FUNCTIONALITY_AVAILABLE)
// With One Click Connectivity (Symbian^3 onwards) it is possible
// to connect silently, without any popups.
TConnPrefList pref;
@@ -412,7 +416,7 @@ void QNetworkSessionPrivateImpl::open()
SymbianNetworkConfigurationPrivate *symbianConfig =
toSymbianConfig(privateConfiguration(publicConfig));
-#ifdef OCC_FUNCTIONALITY_AVAILABLE
+#if defined(OCC_FUNCTIONALITY_AVAILABLE) && defined(SNAP_FUNCTIONALITY_AVAILABLE)
// On Symbian^3 if service network is not reachable, it triggers a UI (aka EasyWLAN) where
// user can create new IAPs. To detect this, we need to store the number of IAPs
// there was before connection was started.
@@ -906,6 +910,14 @@ QNetworkConfiguration QNetworkSessionPrivateImpl::activeConfiguration(TUint32 ia
if (iapId == 0) {
_LIT(KSetting, "IAP\\Id");
iConnection.GetIntSetting(KSetting, iapId);
+#if defined(OCC_FUNCTIONALITY_AVAILABLE) && defined(SNAP_FUNCTIONALITY_AVAILABLE)
+ // Check if this is an Easy WLAN configuration. On Symbian^3 RConnection may report
+ // the used configuration as 'EasyWLAN' IAP ID if someone has just opened the configuration
+ // from WLAN Scan dialog, _and_ that connection is still up. We need to find the
+ // real matching configuration. Function alters the Easy WLAN ID to real IAP ID (only if
+ // easy WLAN):
+ engine->easyWlanTrueIapId(iapId);
+#endif
}
#ifdef SNAP_FUNCTIONALITY_AVAILABLE
@@ -944,7 +956,7 @@ QNetworkConfiguration QNetworkSessionPrivateImpl::activeConfiguration(TUint32 ia
}
}
} else {
-#ifdef OCC_FUNCTIONALITY_AVAILABLE
+#if defined(OCC_FUNCTIONALITY_AVAILABLE) && defined(SNAP_FUNCTIONALITY_AVAILABLE)
// On Symbian^3 (only, not earlier or Symbian^4) if the SNAP was not reachable, it triggers
// user choice type of activity (EasyWLAN). As a result, a new IAP may be created, and
// hence if was not found yet. Therefore update configurations and see if there is something new.
@@ -982,7 +994,7 @@ QNetworkConfiguration QNetworkSessionPrivateImpl::activeConfiguration(TUint32 ia
qDebug() << "QNS this : " << QString::number((uint)this) << " - "
<< "configuration was not found, returning invalid.";
#endif
-#endif // OCC_FUNCTIONALITY_AVAILABLE
+#endif
// Given IAP Id was not found from known IAPs array
return QNetworkConfiguration();
}
@@ -1044,6 +1056,11 @@ void QNetworkSessionPrivateImpl::RunL()
TInt error = KErrNone;
QNetworkConfiguration newActiveConfig = activeConfiguration();
if (!newActiveConfig.isValid()) {
+ // RConnection startup was successfull but no configuration
+ // was found. That indicates that user has chosen to create a
+ // new WLAN configuration (from scan results), but that new
+ // configuration does not have access to Internet (Internet
+ // Connectivity Test, ICT, failed).
error = KErrGeneral;
} else {
// Use name of the IAP to open global 'Open C' RConnection
@@ -1053,16 +1070,24 @@ void QNetworkSessionPrivateImpl::RunL()
strcpy(ifr.ifr_name, nameAsByteArray.constData());
error = setdefaultif(&ifr);
}
-
if (error != KErrNone) {
isOpen = false;
isOpening = false;
iError = QNetworkSession::UnknownSessionError;
QT_TRYCATCH_LEAVING(emit QNetworkSessionPrivate::error(iError));
- Cancel();
if (ipConnectionNotifier) {
ipConnectionNotifier->StopNotifications();
}
+ if (!newActiveConfig.isValid()) {
+ // No valid configuration, bail out.
+ // Status updates from QNCM won't be received correctly
+ // because there is no configuration to associate them with so transit here.
+ iConnection.Close();
+ newState(QNetworkSession::Closing);
+ newState(QNetworkSession::Disconnected);
+ } else {
+ Cancel();
+ }
QT_TRYCATCH_LEAVING(syncStateWithInterface());
return;
}
@@ -1117,7 +1142,9 @@ void QNetworkSessionPrivateImpl::RunL()
isOpening = false;
activeConfig = QNetworkConfiguration();
serviceConfig = QNetworkConfiguration();
- if (publicConfig.state() == QNetworkConfiguration::Undefined ||
+ if (statusCode == KErrCancel) {
+ iError = QNetworkSession::SessionAbortedError;
+ } else if (publicConfig.state() == QNetworkConfiguration::Undefined ||
publicConfig.state() == QNetworkConfiguration::Defined) {
iError = QNetworkSession::InvalidConfigurationError;
} else {
@@ -1300,7 +1327,7 @@ bool QNetworkSessionPrivateImpl::newState(QNetworkSession::State newState, TUint
}
}
}
-#ifdef OCC_FUNCTIONALITY_AVAILABLE
+#if defined(OCC_FUNCTIONALITY_AVAILABLE) && defined(SNAP_FUNCTIONALITY_AVAILABLE)
// If the retVal is not true here, it means that the status update may apply to an IAP outside of
// SNAP (session is based on SNAP but follows IAP outside of it), which may occur on Symbian^3 EasyWlan.
if (retVal == false && activeConfig.isValid() &&
diff --git a/src/plugins/bearer/symbian/qnetworksession_impl.h b/src/plugins/bearer/symbian/qnetworksession_impl.h
index 0754ace..aac9321 100644
--- a/src/plugins/bearer/symbian/qnetworksession_impl.h
+++ b/src/plugins/bearer/symbian/qnetworksession_impl.h
@@ -64,7 +64,7 @@
#ifdef SNAP_FUNCTIONALITY_AVAILABLE
#include <comms-infras/cs_mobility_apiext.h>
#endif
-#ifdef OCC_FUNCTIONALITY_AVAILABLE
+#if defined(OCC_FUNCTIONALITY_AVAILABLE) && defined(SNAP_FUNCTIONALITY_AVAILABLE)
#include <extendedconnpref.h>
#endif
@@ -134,7 +134,8 @@ protected: // From CActive
private Q_SLOTS:
void configurationStateChanged(TUint32 accessPointId, TUint32 connMonId, QNetworkSession::State newState);
void configurationRemoved(QNetworkConfigurationPrivatePointer config);
-
+ void configurationAdded(QNetworkConfigurationPrivatePointer config);
+
private:
TUint iapClientCount(TUint aIAPId) const;
quint64 transferredData(TUint dataType) const;
diff --git a/src/plugins/bearer/symbian/symbian_3/symbian_3.pro b/src/plugins/bearer/symbian/symbian_3/symbian_3.pro
index 25f18f2..ff0f11c 100644
--- a/src/plugins/bearer/symbian/symbian_3/symbian_3.pro
+++ b/src/plugins/bearer/symbian/symbian_3/symbian_3.pro
@@ -6,7 +6,7 @@ symbian {
DEFINES += SNAP_FUNCTIONALITY_AVAILABLE
LIBS += -lcmmanager
- exists($$MW_LAYER_PUBLIC_EXPORT_PATH(extendedconnpref.h)) {
+ exists($$prependEpocroot($$MW_LAYER_PUBLIC_EXPORT_PATH(extendedconnpref.h))) {
DEFINES += OCC_FUNCTIONALITY_AVAILABLE
LIBS += -lextendedconnpref
}
diff --git a/src/plugins/bearer/symbian/symbianengine.cpp b/src/plugins/bearer/symbian/symbianengine.cpp
index ca444c1..4bd6d2f 100644
--- a/src/plugins/bearer/symbian/symbianengine.cpp
+++ b/src/plugins/bearer/symbian/symbianengine.cpp
@@ -270,7 +270,7 @@ void SymbianEngine::updateConfigurationsL()
QList<QString> knownConfigs = accessPointConfigurations.keys();
QList<QString> knownSnapConfigs = snapConfigurations.keys();
-#ifdef SNAP_FUNCTIONALITY_AVAILABLE
+#ifdef SNAP_FUNCTIONALITY_AVAILABLE
// S60 version is >= Series60 3rd Edition Feature Pack 2
TInt error = KErrNone;
@@ -291,14 +291,17 @@ void SymbianEngine::updateConfigurationsL()
if (error == KErrNone) {
QNetworkConfigurationPrivatePointer ptr(cpPriv);
accessPointConfigurations.insert(ptr->id, ptr);
-
- mutex.unlock();
- // Emit configuration added. Connected slots may throw execptions
- // which propagate here --> must be converted to leaves (standard
- // std::exception would cause any TRAP trapping this function to terminate
- // program).
- QT_TRYCATCH_LEAVING(emit configurationAdded(ptr));
- mutex.lock();
+ if (!iFirstUpdate) {
+ // Emit configuration added. Connected slots may throw execptions
+ // which propagate here --> must be converted to leaves (standard
+ // std::exception would cause any TRAP trapping this function to terminate
+ // program).
+ QT_TRYCATCH_LEAVING(updateActiveAccessPoints());
+ updateStatesToSnaps();
+ mutex.unlock();
+ QT_TRYCATCH_LEAVING(emit configurationAdded(ptr));
+ mutex.lock();
+ }
}
}
CleanupStack::PopAndDestroy(&connectionMethod);
@@ -311,7 +314,17 @@ void SymbianEngine::updateConfigurationsL()
iCmManager.AllDestinationsL(destinations);
for(int i = 0; i < destinations.Count(); i++) {
RCmDestination destination;
- destination = iCmManager.DestinationL(destinations[i]);
+
+ // Some destinatsions require ReadDeviceData -capability (MMS/WAP)
+ // The below function will leave in these cases. Don't. Proceed to
+ // next destination (if any).
+ TRAPD(error, destination = iCmManager.DestinationL(destinations[i]));
+ if (error == KErrPermissionDenied) {
+ continue;
+ } else {
+ User::LeaveIfError(error);
+ }
+
CleanupClosePushL(destination);
QString ident = QT_BEARERMGMT_CONFIGURATION_SNAP_PREFIX +
QString::number(qHash(destination.Id()));
@@ -319,12 +332,12 @@ void SymbianEngine::updateConfigurationsL()
knownSnapConfigs.removeOne(ident);
} else {
SymbianNetworkConfigurationPrivate *cpPriv = new SymbianNetworkConfigurationPrivate;
-
+
HBufC *pName = destination.NameLC();
QT_TRYCATCH_LEAVING(cpPriv->name = QString::fromUtf16(pName->Ptr(),pName->Length()));
CleanupStack::PopAndDestroy(pName);
pName = NULL;
-
+
cpPriv->isValid = true;
cpPriv->id = ident;
cpPriv->numericId = destination.Id();
@@ -336,64 +349,75 @@ void SymbianEngine::updateConfigurationsL()
QNetworkConfigurationPrivatePointer ptr(cpPriv);
snapConfigurations.insert(ident, ptr);
-
- mutex.unlock();
- QT_TRYCATCH_LEAVING(emit configurationAdded(ptr));
- mutex.lock();
+ if (!iFirstUpdate) {
+ QT_TRYCATCH_LEAVING(updateActiveAccessPoints());
+ updateStatesToSnaps();
+ mutex.unlock();
+ QT_TRYCATCH_LEAVING(emit configurationAdded(ptr));
+ mutex.lock();
+ }
}
- QNetworkConfigurationPrivatePointer privSNAP = snapConfigurations.value(ident);
-
+
+ // Loop through all connection methods in this SNAP
+ QMap<unsigned int, QNetworkConfigurationPrivatePointer> connections;
for (int j=0; j < destination.ConnectionMethodCount(); j++) {
RCmConnectionMethod connectionMethod = destination.ConnectionMethodL(j);
CleanupClosePushL(connectionMethod);
-
+
TUint32 iapId = connectionMethod.GetIntAttributeL(CMManager::ECmIapId);
QString iface = QT_BEARERMGMT_CONFIGURATION_IAP_PREFIX+QString::number(qHash(iapId));
// Check that IAP can be found from accessPointConfigurations list
- QNetworkConfigurationPrivatePointer priv = accessPointConfigurations.value(iface);
- if (!priv) {
+ QNetworkConfigurationPrivatePointer ptr = accessPointConfigurations.value(iface);
+ if (!ptr) {
SymbianNetworkConfigurationPrivate *cpPriv = NULL;
TRAP(error, cpPriv = configFromConnectionMethodL(connectionMethod));
if (error == KErrNone) {
- QNetworkConfigurationPrivatePointer ptr(cpPriv);
+ ptr = QNetworkConfigurationPrivatePointer(cpPriv);
accessPointConfigurations.insert(ptr->id, ptr);
- mutex.unlock();
- QT_TRYCATCH_LEAVING(emit configurationAdded(ptr));
- mutex.lock();
-
- QMutexLocker configLocker(&privSNAP->mutex);
- privSNAP->serviceNetworkMembers.append(ptr);
+ if (!iFirstUpdate) {
+ QT_TRYCATCH_LEAVING(updateActiveAccessPoints());
+ updateStatesToSnaps();
+ mutex.unlock();
+ QT_TRYCATCH_LEAVING(emit configurationAdded(ptr));
+ mutex.lock();
+ }
}
} else {
knownConfigs.removeOne(iface);
- // Check that IAP can be found from related SNAP's configuration list
- bool iapFound = false;
- QMutexLocker snapConfigLocker(&privSNAP->mutex);
- for (int i = 0; i < privSNAP->serviceNetworkMembers.count(); i++) {
- if (toSymbianConfig(privSNAP->serviceNetworkMembers[i])->numericIdentifier() ==
- iapId) {
- iapFound = true;
- break;
- }
- }
- if (!iapFound)
- privSNAP->serviceNetworkMembers.append(priv);
}
-
+
+ if (ptr) {
+ unsigned int priority;
+ TRAPD(error, priority = destination.PriorityL(connectionMethod));
+ if (!error)
+ connections.insert(priority, ptr);
+ }
+
CleanupStack::PopAndDestroy(&connectionMethod);
}
-
+
+ QNetworkConfigurationPrivatePointer privSNAP = snapConfigurations.value(ident);
QMutexLocker snapConfigLocker(&privSNAP->mutex);
- if (privSNAP->serviceNetworkMembers.count() > 1) {
+
+ if (privSNAP->serviceNetworkMembers != connections) {
+ privSNAP->serviceNetworkMembers = connections;
+
// Roaming is supported only if SNAP contains more than one IAP
- privSNAP->roamingSupported = true;
+ privSNAP->roamingSupported = privSNAP->serviceNetworkMembers.count() > 1;
+
+ snapConfigLocker.unlock();
+
+ updateStatesToSnaps();
+
+ mutex.unlock();
+ QT_TRYCATCH_LEAVING(emit configurationChanged(privSNAP));
+ mutex.lock();
}
-
+
CleanupStack::PopAndDestroy(&destination);
}
CleanupStack::PopAndDestroy(&destinations);
-
#else
// S60 version is < Series60 3rd Edition Feature Pack 2
CCommsDbTableView* pDbTView = ipCommsDB->OpenTableLC(TPtrC(IAP));
@@ -411,10 +435,13 @@ void SymbianEngine::updateConfigurationsL()
if (readNetworkConfigurationValuesFromCommsDb(apId, cpPriv)) {
QNetworkConfigurationPrivatePointer ptr(cpPriv);
accessPointConfigurations.insert(ident, ptr);
-
- mutex.unlock();
- QT_TRYCATCH_LEAVING(emit configurationAdded(ptr));
- mutex.lock();
+ if (!iFirstUpdate) {
+ QT_TRYCATCH_LEAVING(updateActiveAccessPoints());
+ updateStatesToSnaps();
+ mutex.unlock();
+ QT_TRYCATCH_LEAVING(emit configurationAdded(ptr));
+ mutex.lock();
+ }
} else {
delete cpPriv;
}
@@ -423,8 +450,9 @@ void SymbianEngine::updateConfigurationsL()
}
CleanupStack::PopAndDestroy(pDbTView);
#endif
+
QT_TRYCATCH_LEAVING(updateActiveAccessPoints());
-
+
foreach (const QString &oldIface, knownConfigs) {
//remove non existing IAP
QNetworkConfigurationPrivatePointer ptr = accessPointConfigurations.take(oldIface);
@@ -439,10 +467,13 @@ void SymbianEngine::updateConfigurationsL()
QNetworkConfigurationPrivatePointer ptr2 = snapConfigurations.value(iface);
// => Check if one of the IAPs of the SNAP is active
QMutexLocker snapConfigLocker(&ptr2->mutex);
- for (int i = 0; i < ptr2->serviceNetworkMembers.count(); ++i) {
- if (toSymbianConfig(ptr2->serviceNetworkMembers[i])->numericIdentifier() ==
+ QMutableMapIterator<unsigned int, QNetworkConfigurationPrivatePointer> i(ptr2->serviceNetworkMembers);
+ while (i.hasNext()) {
+ i.next();
+
+ if (toSymbianConfig(i.value())->numericIdentifier() ==
toSymbianConfig(ptr)->numericIdentifier()) {
- ptr2->serviceNetworkMembers.removeAt(i);
+ i.remove();
break;
}
}
@@ -463,6 +494,10 @@ void SymbianEngine::updateConfigurationsL()
stopCommsDatabaseNotifications();
TRAP_IGNORE(defaultConfig = defaultConfigurationL());
startCommsDatabaseNotifications();
+
+#ifdef SNAP_FUNCTIONALITY_AVAILABLE
+ updateStatesToSnaps();
+#endif
}
#ifdef SNAP_FUNCTIONALITY_AVAILABLE
@@ -683,15 +718,21 @@ void SymbianEngine::updateActiveAccessPoints()
User::WaitForRequest(status);
QString ident = QT_BEARERMGMT_CONFIGURATION_IAP_PREFIX+QString::number(qHash(apId));
QNetworkConfigurationPrivatePointer ptr = accessPointConfigurations.value(ident);
-#ifdef OCC_FUNCTIONALITY_AVAILABLE
+#if defined(OCC_FUNCTIONALITY_AVAILABLE) && defined(SNAP_FUNCTIONALITY_AVAILABLE)
if (!ptr) {
// If IAP was not found, check if the update was about EasyWLAN
ptr = configurationFromEasyWlan(apId, connectionId);
+ // Change the ident correspondingly
+ if (ptr) {
+ ident = QT_BEARERMGMT_CONFIGURATION_IAP_PREFIX +
+ QString::number(qHash(toSymbianConfig(ptr)->numericIdentifier()));
+ }
}
#endif
if (ptr) {
iConnectionMonitor.GetIntAttribute(connectionId, subConnectionCount, KConnectionStatus, connectionStatus, status);
- User::WaitForRequest(status);
+ User::WaitForRequest(status);
+
if (connectionStatus == KLinkLayerOpen) {
online = true;
inactiveConfigs.removeOne(ident);
@@ -791,15 +832,19 @@ void SymbianEngine::updateStatesToSnaps()
// => Check if one of the IAPs of the SNAP is discovered or active
// => If one of IAPs is active, also SNAP is active
// => If one of IAPs is discovered but none of the IAPs is active, SNAP is discovered
- for (int i=0; i<ptr->serviceNetworkMembers.count(); i++) {
- QMutexLocker configLocker(&ptr->serviceNetworkMembers[i]->mutex);
+ QMapIterator<unsigned int, QNetworkConfigurationPrivatePointer> i(ptr->serviceNetworkMembers);
+ while (i.hasNext()) {
+ i.next();
+
+ const QNetworkConfigurationPrivatePointer child = i.value();
- if ((ptr->serviceNetworkMembers[i]->state & QNetworkConfiguration::Active)
- == QNetworkConfiguration::Active) {
+ QMutexLocker configLocker(&child->mutex);
+
+ if ((child->state & QNetworkConfiguration::Active) == QNetworkConfiguration::Active) {
active = true;
break;
- } else if ((ptr->serviceNetworkMembers[i]->state & QNetworkConfiguration::Discovered)
- == QNetworkConfiguration::Discovered) {
+ } else if ((child->state & QNetworkConfiguration::Discovered) ==
+ QNetworkConfiguration::Discovered) {
discovered = true;
}
}
@@ -1035,7 +1080,7 @@ void SymbianEngine::EventL(const CConnMonEventBase& aEvent)
QString ident = QT_BEARERMGMT_CONFIGURATION_IAP_PREFIX+QString::number(qHash(apId));
QNetworkConfigurationPrivatePointer ptr = accessPointConfigurations.value(ident);
-#ifdef OCC_FUNCTIONALITY_AVAILABLE
+#if defined(OCC_FUNCTIONALITY_AVAILABLE) && defined(SNAP_FUNCTIONALITY_AVAILABLE)
if (!ptr) {
// Check if status was regarding EasyWLAN
ptr = configurationFromEasyWlan(apId, connectionId);
@@ -1060,7 +1105,7 @@ void SymbianEngine::EventL(const CConnMonEventBase& aEvent)
User::WaitForRequest(status);
QString ident = QT_BEARERMGMT_CONFIGURATION_IAP_PREFIX+QString::number(qHash(apId));
QNetworkConfigurationPrivatePointer ptr = accessPointConfigurations.value(ident);
-#ifdef OCC_FUNCTIONALITY_AVAILABLE
+#if defined(OCC_FUNCTIONALITY_AVAILABLE) && defined(SNAP_FUNCTIONALITY_AVAILABLE)
if (!ptr) {
// Check for EasyWLAN
ptr = configurationFromEasyWlan(apId, connectionId);
@@ -1152,6 +1197,8 @@ void SymbianEngine::EventL(const CConnMonEventBase& aEvent)
QT_TRYCATCH_LEAVING(changeConfigurationStateAtMaxTo(ptr, QNetworkConfiguration::Defined));
}
}
+ // Something has in IAPs, update states to SNAPs
+ updateStatesToSnaps();
}
break;
@@ -1168,7 +1215,7 @@ void SymbianEngine::EventL(const CConnMonEventBase& aEvent)
User::WaitForRequest(status);
QString ident = QT_BEARERMGMT_CONFIGURATION_IAP_PREFIX+QString::number(qHash(apId));
QNetworkConfigurationPrivatePointer ptr = accessPointConfigurations.value(ident);
-#ifdef OCC_FUNCTIONALITY_AVAILABLE
+#if defined(OCC_FUNCTIONALITY_AVAILABLE) && defined(SNAP_FUNCTIONALITY_AVAILABLE)
if (!ptr) {
// If IAP was not found, check if the update was about EasyWLAN
ptr = configurationFromEasyWlan(apId, connectionId);
@@ -1189,7 +1236,7 @@ void SymbianEngine::EventL(const CConnMonEventBase& aEvent)
}
}
-#ifdef OCC_FUNCTIONALITY_AVAILABLE
+#if defined(OCC_FUNCTIONALITY_AVAILABLE) && defined(SNAP_FUNCTIONALITY_AVAILABLE)
// Tries to derive configuration from EasyWLAN.
// First checks if the interface brought up was EasyWLAN, then derives the real SSID,
// and looks up configuration based on that one.
@@ -1224,6 +1271,45 @@ QNetworkConfigurationPrivatePointer SymbianEngine::configurationFromEasyWlan(TUi
}
return QNetworkConfigurationPrivatePointer();
}
+
+bool SymbianEngine::easyWlanTrueIapId(TUint32& trueIapId)
+{
+ // Check if this is easy wlan id in the first place
+ if (trueIapId != iCmManager.EasyWlanIdL())
+ return false;
+
+ // Loop through all connections that connection monitor is aware
+ // and check for IAPs based on easy WLAN
+ TRequestStatus status;
+ TUint connectionCount;
+ iConnectionMonitor.GetConnectionCount(connectionCount, status);
+ User::WaitForRequest(status);
+ TUint connectionId;
+ TUint subConnectionCount;
+ TUint apId;
+ if (status.Int() == KErrNone) {
+ for (TUint i = 1; i <= connectionCount; i++) {
+ iConnectionMonitor.GetConnectionInfo(i, connectionId, subConnectionCount);
+ iConnectionMonitor.GetUintAttribute(connectionId, subConnectionCount,
+ KIAPId, apId, status);
+ User::WaitForRequest(status);
+ if (apId == trueIapId) {
+ QNetworkConfigurationPrivatePointer ptr =
+ configurationFromEasyWlan(apId, connectionId);
+ if (ptr) {
+#ifdef QT_BEARERMGMT_SYMBIAN_DEBUG
+ qDebug() << "QNCM easyWlanTrueIapId(), found true IAP ID: "
+ << toSymbianConfig(ptr)->numericIdentifier();
+#endif
+ trueIapId = toSymbianConfig(ptr)->numericIdentifier();
+ return true;
+ }
+ }
+ }
+ }
+ return false;
+}
+
#endif
// Sessions may use this function to report configuration state changes,
diff --git a/src/plugins/bearer/symbian/symbianengine.h b/src/plugins/bearer/symbian/symbianengine.h
index cfddc29..ecd858d 100644
--- a/src/plugins/bearer/symbian/symbianengine.h
+++ b/src/plugins/bearer/symbian/symbianengine.h
@@ -208,6 +208,7 @@ private:
QNetworkSession::State newState);
#ifdef OCC_FUNCTIONALITY_AVAILABLE
QNetworkConfigurationPrivatePointer configurationFromEasyWlan(TUint32 apId, TUint connectionId);
+ bool easyWlanTrueIapId(TUint32& trueIapId);
#endif
private: // Data