How to detect (and get notified) when the phone (N950) stops using WiFi for internet access.



  • Hi all,

    In my app I'm using QTcpSocket to download files from the internet.
    I want to allow the user the option to download files only while connected on WiFi (so that he won't have to pay thousands of E/$/etc for using the operator data). I thought of using the class QSystemNetworkInfo in Qt Mobillity with the following signals:
    @void QSystemNetworkInfo::networkModeChanged ( QSystemNetworkInfo::NetworkMode mode ) [signal]@

    However this signal never gets called ...



  • The signal that is triggered when I connect/disconect to/from the WiFi router from the phone is:
    @void QSystemNetworkInfo ::networkStatusChanged(QSystemNetworkInfo::NetworkMode mode, QSystemNetworkInfo::NetworkStatus status);@

    When connecting to WiFi the mode param is QSystemNetworkInfo::NetworkMode::WlanMode and the status param is QSystemNetworkInfo::NetworkStatus::Connected

    When disconnecting from WiFi the mode param is QSystemNetworkInfo::NetworkMode::WlanMode and the status param is QSystemNetworkInfo::NetworkStatus::NoNetworkAvailable.

    There is one more test I need to do later (and post here the results): I will unplug the UTP cable from my WiFi router (so that the phone WiFi will still be connected to the WiFi router but the WiFi router will actually provide no internet connection) and see if the signal gets called with the correct params.

    One last thing I noticed with this signal: the signal does not get called at all when connecting/disconnecting the operator data connection, only works for WiFi ... (but this is enough for me).


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.