views:

619

answers:

3

Are there any good api's or examples of communicating between two devices via WiFi?

I am programming an app for 600 window's mobile (version 5) devices. They occasionally will need to connect with another device and exchange info.

Each device connects to the internet via GPRS (using the phone line). I could do the communications via that, but it is slow and may not work in all locations (this app will be used nationwide).

Just as an FYI, I also plan to look into bluetooth, but the stack we get on our Symbol Devices (MC70) is the Stonestreet One stack (we cannot change that). It is a very difficult to use stack with no managed code API. Also, it requires manual setup to use. My users will not be very technically inclined.

If there is another way to communicate (ie via the WiFi connection) I would love that.

(Ideally, I would like to be able to programmatically turn on the WiFi, send/receive data and then turn off the WiFi (to save batteries).)

Any help/suggestions are appreciated.

+1  A: 

Someone is welcomed to prove me wrong but, as far as i know, out of the box it has to be bluetooth. WiFi is for networks. If you setup each device to also act as an access point you could make this happen. So I am sure it can be done, but it's not a clear path.

I see other issue slike security as well, because a router would handle this and now each of the 600 devices would be an access point handling this security, i am just shooting from the hip now which is basically my long winded advice to not go that direction.

-update maybe i am a bad answerer, I just thought this was a bad direction. You can google windows mobile wifi peer to peer. Here is one site that covers it. http://www.smartphonemag.com/cms/blogs/3/588

Jonathan Kaufman
There *is* a way to do adhoc wireless in Windows Mobile, like the asker is looking for. There was an earlier SO question on this, and I'm trying to find it.
MusiGenesis
I think this is the one you are thinking about. http://stackoverflow.com/questions/1280322/better-way-to-communicate-between-ad-hoc-wifi-windows-mobile-devices It did not give me any practical advice on how to do it though.
Vaccano
+1  A: 

Here is an earlier question on this subject:

http://stackoverflow.com/questions/1280322/better-way-to-communicate-between-ad-hoc-wifi-windows-mobile-devices

... which suggests that this is at least possible.

As an alternative, if the devices have infrared ports, you could have them communicate that way (I think).

Update: just found this example:

http://community.opennetcf.com/articles/cf/archive/2008/06/09/exchanging-data-using-windows-mobile-windows-communication-foundation-net-compact-framework-and-exchange-2007.aspx

It looks like you can do peer-to-peer communications with it. It requires .Net CF 3.5, however.

MusiGenesis
Thanks for the answer. Looked at that example and it is using a central exchange server to manage the peer to peer communication (done via email). I like that solution, but setting up an exchange server for this app would be difficult as the users are not employees of my company. It also would not address the issue where there is no GPRS (via phone) internet connection.
Vaccano
Alright, I'm useless. I've favorited this question, because I'm interested in learning how to do this also. `ctacke` is an SO user and also the author of OpenNetCF, and I'm sure he knows how to do this or where to point you.
MusiGenesis
+2  A: 

Motorola (who have bought Symbol a few years ago) do release an Enterprise Mobility Developer Kit for .NET CF which also has some libraries for controlling the WLAN on a Symbol MC70. I have worked with this in the past and it seems to work very well. The SDK comes with the full documentation and some sample applications.

tomlog
This is looking like the best solution as of now.
Vaccano