[maemo-developers] Function to check presents of WiFi connection

From: Jussi Kukkonen jhkukkon at cc.hut.fi
Date: Wed Nov 7 13:39:10 EET 2007
Michael Stepanov wrote:
> Hi,
> I'm not Maemo guru. So, that's why my question may sound stupid a bit. I
> need to check WiFi connection before run my application. Is there some
> function in the Maemo SDk to do that or it's better to use command line WiFi
> utility?

I assume you just want to know if there is an internet connection (not
necessarily wifi)?  If you are using C, libconic is the place you should
be looking in:

If I remember correctly it goes like this (not exactly a one-liner):

 * create object with con_ic_connection_new()
 * connect to the connection event signal
 * run con_ic_connection_connect() with parameter
 * your signal handler will get a en event that
   has connection status.

If you want to constantly monitor changes instead of just checking once,
set automatic-connection-events to true. IIRC one of the event objects
also lets you check if the connection is a WLAN if you really are
interested in that.


Jussi Kukkonen

More information about the maemo-developers mailing list