[maemo-developers] connecting to network in background

From: Dominik Bartenstein db at wahuu.at
Date: Wed Dec 8 19:06:50 EET 2010
Hi Thomas,

thanks for your reply!

"Connect automatically" is set to "Any connection" but I have also tried 
with "WLAN" and mobile internet.

What I have noted is that I can successfully initiate a connect-request 
via dbus:
dbus-send --system --type=method_call --print-reply \
           --dest=com.nokia.icd2 \
           /com/nokia/icd2 \
           com.nokia.icd2.connect_req \
           uint32:1

When setting the value of the last parameter to uint32:0 
(ICD_CONNECTION_FLAG_APPLICATION_EVENT) _no_ connection is established.
http://maemo.org/api_refs/5.0/5.0-final/icd2/group__dbus__api.html
According to my understanding, ICD_CONNECTION_FLAG_APPLICATION_EVENT 
would silently initiate a connection in the background.

When the sessionProperty "ConnectInBackground" is set to True, 
session.open() requests a connection with the 
ICD_CONNECTION_FLAG_APPLICATION_EVENT flag: 
http://qt.gitorious.org/qt/qt/blobs/4.7/src/plugins/bearer/icd/qnetworksession_impl.cpp
And that does not seem to work ...

Am I missing something?

To clarify my intention. I have an background application running that 
periodically checks for updates via the Internet. if a connection cannot 
be established, I do not want a modal user dialog to pop up. Connection 
errors should be ignored silently.

Thanks,
Dominikb

p.s. I have already filed a bug report: 
http://bugreports.qt.nokia.com/browse/QTBUG-15924

On 12/07/2010 08:32 AM, Thomas Perl wrote:
> Hi Dominik,
>
> 2010/12/6 Dominik Bartenstein<db at wahuu.at>:
>> I try to open a QNetworkSession via session.open(). That works like a charm
>> but if the connection cannot be established a connection pop up appears by
>> default.
>> [...]
>> Is the "ConnectInBackground" sessionProperty implemented/available for
>> Maemo5 PR1.3/N900?
>
> Depending on what you want to achieve, you might be able to use the
> "native" (platform-specific) APIs on Maemo 5 to request internet
> connectivity. They work and are fully implemented:
>
> http://wiki.maemo.org/Documentation/Maemo_5_Developer_Guide/Using_Connectivity_Components/Maemo_Connectivity#Requesting_for_Connection
>
> It might also depend on the settings of your device. Go to Settings ->
> Internet connections and check the "Connect automatically" setting. If
> you want to be able to connect in the background, it has to be set to
> something else than "Always ask". If it still does not work with
> QNetworkSession after checking this, it might be worth reporting this
> as a bug on http://bugs.maemo.org/, even if you end up using libconic
> for requesting the connection, so it can be fixed for future uses :)
>
> HTH.
>
> Thomas
>

More information about the maemo-developers mailing list