How to communicate with Win CE device connected by usb - c#

Greetings.
I'm trying to communicate between desktop PC and Windows CE 5.0 device connected by usb (cradle).
I feel like I'm missing something obvious, because I can't find how to establish connection between them. What namespace to look? I just want simple communication: connect, exchange some data, disconnect. Sockets are more then enough, but what address should I access? The one assigned by usb connection on handheld is not accessible on desktop machine.
Communication should be initiated from desktop PC.
My handheld is running Windows CE 5.0 with .NET Compact Framework 2.0
Please point me to the right direction :)

Do you have ActiveSync connection with the device. If you do, use OpenNETCF desktop communication. It is exatly what you are looking for.

Hmm it appears that mobile device won't popup in FileOpenDialog.
Use Rapi? http://social.msdn.microsoft.com/Forums/en-US/vssmartdevicesvbcs/thread/4826aa50-f206-499e-b115-584c3f058f8a
or check this

If you are able to create and use server application for desktop, do data communication trough socket. You can transfer whatever you want.

Related

BLE Device connection

Please has anyone used bglib or BleDriver.NET to connect to a BLE device? I need help in using any of these libraries.
The issue is I have a bluegiga bluetooth dongle and a bluetooth calliper. I want to get data from the calliper through an existing C# desktop application. The desktop application runs on Windows 8 and 8.1, but it is just a windows desktop application. I am able to use the libraries to open the dongle's port but I can not connect with the calliper.
Can someone throw some light into this for me?
Thank you very much.
I finally found a solution to the above problem. The caliper is designed in such a way that it cannot be used through a customers' bespoke application, thus requires its manufacturer's Bluetooth application to work.

Data forwarding server

I have the app for Android and another app for PC, both were written by me. Android app connects to the PC app, and the PC app sends data (in realtime) to the smartphone.
The problem is: if the PC is connected to the mobile wireless network, I can't get its address, so I can't connect my Android app to the PC.
So, is there some simple application (for Windows), that I can use as a server for data forwarding. PC and mobile App will be connected to this server (launched on the station with the static address), and the server will just forward data from one app to another?
Or maybe there are good tutorials for creating such kind of server on C#/Java?
I would use a third pc (a server) that acts as a bridge for Android and PC. I wrote a web service in .NET for a virtual server on the internet. Both Android and PC know the ip address (or the domain name) of the server.
The PC talk to server using .NET native web service call, the Android uses ksoap.
For more infomration about ksoap for android look here:
http://code.google.com/p/ksoap2-android/
EDIT:
I suppose you can have the web server in the pc but you need to configure your modem to forward specific ports to the pc. But if you have no static ip address you need to reconfigure the ip address on Android device everytime your modem is rebooted (or switched off/on). You can also try to use dynamic dns services...
Check this out:
http://whiletrue.blog.com/2013/07/11/smartphone-as-pc-controller/
I've made this with Muzzley. Basically, you already have most of the work done if you integrate with it.
(disclaimer: i work for this project)
On the PC side, you can use the lib to include in you pc app in several languages:
(java) http://www.muzzley.com/documentation/libraries/java.html
(.NET) http://www.muzzley.com/documentation/libraries/dotnet.html
(nodejs) http://www.muzzley.com/documentation/libraries/nodejs.html
On the smartphone side, you can use any of the existent widgets (virtual interfaces):
http://www.muzzley.com/documentation/widgets.html
or eventually make your own:
http://www.muzzley.com/documentation/widgets/webview.html
Example:
You can pull from github several examples here:
https://github.com/muzzley/muzzley-demos/
(check the the webview example)
I hope it helps.

USB CDC on Windows 8 RT

Can a Windows Store Application communicate with a USB-connected device through a virtual COM Port?
Does the framework for such apps contain the SerialPort class?
If not, in what other way can I create a connection between a device and an App?
All this assuming that Classic Desktop is unavailable.
You aren't the first to ask. But let me be the first to answer: http://blog.jerrynixon.com/2012/05/metro-answers-can-i-use-serial-port.html
The short answer is no. With this exception: the device is on USB (with a dongle) with a modern driver exposing IOCTLS device information – this gives Windows Store Apps device access.

Testing Socket Programming in C# on Windows Mobile 6 Emulator

I need to develop and test an application in Windows Mobile 6 for socket Programming in c#. I have done it in Windows Desktop application (i.e Creating a Windows Console Application that acts as a Server and listens. Then a Windows Form Application that is the client. Has a button and textbox. When i press the button the client gets connected to the server).
Now i have no idea how to check socket programming in windows Mobile 6. (Building a WM6 application that acts as a client and another that acts as sever something like that or should i be using a different approach? I am clueless)
Thanks.
If you just want to test your Windows Mobile 6 client then you can simply connect it to your Windows Desktop application. Click on File > Configure > Network and check the Enable NE2000 option. You can see this blog post to find out how to install the NE2000 driver.
Using Windows Mobile 6 as a client and Windows Desktop as the server is fine. If you want to use the sockets over GPRS or CDMA then you should be aware of the fact your mobile device will likely have a dynamic IP (which can change as the handheld roams to other wireless networks) and will be behind NAT, so it can be difficult to push data out to the handheld without some kind of connection to the server initiated by the client.

can c# be used for communicating mobile and pc?

As a minor project in my degree I would like to communicate mobile and pc .I am interested to communicate through bluetooth is it possible to do so in c#?
If possible please provide me list of application or hardware i would requiere in order to do so.
thanks in advance
If (and it's a big if based on the lack of information in your question) you mean "How do I write an app on my PC, using C#, that can communicate with a Windows Mobile device that is connected to my PC via ActiveSync or WMDC" then the answer is RAPI. A free, open-source managed wrapper for it is here.
Yes its possible if its with windows mobile phone or pocket pc with bluetooth. You need a bluetooth enabled computer and mobile phone. For dev you need to download the windows mobile 6 sdk.
Then developing of the communication between desktop app and mobile phone app, you can use the 32feet.Net is open source.
When you download it and installs (well it unpacks to program files folder) you will have the dll that you make reference to in Visual Studio. Also you will get some sample apps. One of them is a Bluetooth Chat that works in Desktop, Pocket PC and SmartPhone.
Another option you could use is set up a web service that acts like an intermediary between the device and your machine. One huge benefit of this is that no longer are you bound by the distance requirements of bluetooth.
Of course if you're trying to build some sort of proximity service (do z when item x is 3 meters from item y) then bluetooth is probably the way to go.

Categories