How to detect connection

  • Thread starter Paul G. Tobey [eMVP]
  • Start date

P

Paul G. Tobey [eMVP]

You can probably use the OpenNETCF Smart Device Framework to do what you'd
need to do to see if there is a WiFi connection. Get an AdapterList, check
for a WiFi adapter in that list, set up to receive notifications of changes
to that adapter and, when one happens, check to see if you can find your
target partner over that network (create the type of socket you're using for
the real connection, but bind it specfically to the IP of the WiFi adapter
and try to make the connection, etc.)

Paul T.
 
Ad

Advertisements

L

Leonardo Natale

Hi, i´m writting an application in Windows Mobile 5 Smartphone, and i need
to detect when i´m in wi-fi coverage, so indicate my software that use wi-fi
network, and not use GPRS.
I use C# language.

Can anyone help me ?

Thanks in advance.
 
P

Paul G. Tobey [eMVP]

It's available in source form. I suppose that you could take out just the
pieces that you need. Yes, I know how to do it (I wrote about half of the
SDF network stuff, originally), but I'm absolutely not going to try to
recreate that in a newsgroup post. It's in the SDF; you can get the source
to it; I can't think of a good reason not to use SDF for this; there you
are!

Paul T.

Vanesa Rush said:
Thanks Paul for you answer, but in this project, i can´t use OpenNETCF.
Any idea how to do it ?

Thanks a lot


"Paul G. Tobey [eMVP]" <p space tobey no spam AT no instrument no spam DOT
com> escribió en el mensaje news:[email protected]
You can probably use the OpenNETCF Smart Device Framework to do what
you'd need to do to see if there is a WiFi connection. Get an
AdapterList, check for a WiFi adapter in that list, set up to receive
notifications of changes to that adapter and, when one happens, check to
see if you can find your target partner over that network (create the
type of socket you're using for the real connection, but bind it
specfically to the IP of the WiFi adapter and try to make the connection,
etc.)

Paul T.
 
G

Guest

Sure, just spend a bunch of your time writing exactly what's already done,
debugged and available for free. The NDIS and WZC API interfaces are
publicly available on MSDN, so you simply need to write P/Invoke wrappers
around those.


--

Chris Tacke, eMVP
Join the Embedded Developer Community
http://community.opennetcf.com





Vanesa Rush said:
Thanks Paul for you answer, but in this project, i can´t use OpenNETCF.
Any idea how to do it ?

Thanks a lot


"Paul G. Tobey [eMVP]" <p space tobey no spam AT no instrument no spam DOT
com> escribió en el mensaje news:[email protected]
You can probably use the OpenNETCF Smart Device Framework to do what
you'd need to do to see if there is a WiFi connection. Get an
AdapterList, check for a WiFi adapter in that list, set up to receive
notifications of changes to that adapter and, when one happens, check to
see if you can find your target partner over that network (create the
type of socket you're using for the real connection, but bind it
specfically to the IP of the WiFi adapter and try to make the connection,
etc.)

Paul T.
 
S

Simon Hart [MVP]

Tell you're boss he/she is very short sighted. The SDF is written in C# if
that makes a difference.
--
Simon Hart
Visual Developer - Device Application Development MVP
http://simonrhart.blogspot.com


Leonardo Natale said:
Yes, you are right, i´ll use OpenNETCF.
Because my boss wants to use only C# without any other framework.
Thanks a lot boys!!


Sure, just spend a bunch of your time writing exactly what's already done,
debugged and available for free. The NDIS and WZC API interfaces are
publicly available on MSDN, so you simply need to write P/Invoke wrappers
around those.


--

Chris Tacke, eMVP
Join the Embedded Developer Community
http://community.opennetcf.com





Vanesa Rush said:
Thanks Paul for you answer, but in this project, i can´t use OpenNETCF.
Any idea how to do it ?

Thanks a lot


"Paul G. Tobey [eMVP]" <p space tobey no spam AT no instrument no spam
DOT com> escribió en el mensaje
You can probably use the OpenNETCF Smart Device Framework to do what
you'd need to do to see if there is a WiFi connection. Get an
AdapterList, check for a WiFi adapter in that list, set up to receive
notifications of changes to that adapter and, when one happens, check to
see if you can find your target partner over that network (create the
type of socket you're using for the real connection, but bind it
specfically to the IP of the WiFi adapter and try to make the
connection, etc.)

Paul T.

Hi, i´m writting an application in Windows Mobile 5 Smartphone, and i
need to detect when i´m in wi-fi coverage, so indicate my software that
use wi-fi network, and not use GPRS.
I use C# language.

Can anyone help me ?

Thanks in advance.
 
V

Vanesa Rush

Thanks Paul for you answer, but in this project, i can´t use OpenNETCF. Any
idea how to do it ?

Thanks a lot


"Paul G. Tobey [eMVP]" <p space tobey no spam AT no instrument no spam DOT
com> escribió en el mensaje news:[email protected]
 
Ad

Advertisements

L

Leonardo Natale

Yes, you are right, i´ll use OpenNETCF.
Because my boss wants to use only C# without any other framework.
Thanks a lot boys!!


Sure, just spend a bunch of your time writing exactly what's already done,
debugged and available for free. The NDIS and WZC API interfaces are
publicly available on MSDN, so you simply need to write P/Invoke wrappers
around those.


--

Chris Tacke, eMVP
Join the Embedded Developer Community
http://community.opennetcf.com





Vanesa Rush said:
Thanks Paul for you answer, but in this project, i can´t use OpenNETCF.
Any idea how to do it ?

Thanks a lot


"Paul G. Tobey [eMVP]" <p space tobey no spam AT no instrument no spam
DOT com> escribió en el mensaje
You can probably use the OpenNETCF Smart Device Framework to do what
you'd need to do to see if there is a WiFi connection. Get an
AdapterList, check for a WiFi adapter in that list, set up to receive
notifications of changes to that adapter and, when one happens, check to
see if you can find your target partner over that network (create the
type of socket you're using for the real connection, but bind it
specfically to the IP of the WiFi adapter and try to make the
connection, etc.)

Paul T.

Hi, i´m writting an application in Windows Mobile 5 Smartphone, and i
need to detect when i´m in wi-fi coverage, so indicate my software that
use wi-fi network, and not use GPRS.
I use C# language.

Can anyone help me ?

Thanks in advance.
 
D

dgallus

Hey there,

no need for OpenNetCF (i think), this should work with a property out of
microsoft.windowsmobile.status.systemstate

You can/have to link that property to an EventHandler and you're good to go.

Here is a property (with MSDN Link) , i can think of that it is useful
for you:
- WiFiStateConnected http://tinyurl.com/3yo2fm

There are also a few more (possible) useful Properties for your use
-> http://tinyurl.com/2zwmul

Hope i could help you.
If you need some help implementing that stuff just hit up google or talk
to me again.

Greetings,
Dominik
 
D

Dominik Gallus

Forgot to add.

On the last Link there are many ConnectionState Properties you should
check and maybe combine for achieving your goals.

I dunno if the WiFiStateConnected is working because the class
description is empty on MSDN.

Bye.
 
Ad

Advertisements

P

Paul G. Tobey [eMVP]

Your safest bet to establish that it's *really* connected is to try to use
it to do whatever network operation you need. Bind your outgoing socket,
for example, to the IP address of the WiFi adapter and try to connect to the
server you use (or whatever). You have to be prepared for any sort of
wireless network connection to break at any time, so you might as well just
try it. :)

Paul T.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top