Solved

UDP connection in Windows CE 3.0

Posted on 2004-04-07
5
789 Views
Last Modified: 2013-12-27
I'm trying to read data from a serial port on an Ipaq 3630 with Windows CE 3.0 and then transmit the data using UDP (not TCP) protocol to a PC (Windows XP) over the internet vía GPRS, all this in any Visual Basic language.

The problem is:
1. Embedded Viusal Basic Winsock control doesn't accept UDP protocol.
2. I haven't been able to find how to use the winsock API of Windows CE (suposing it accepts UDP protocol) from Visual Basic because apparently it uses a structure (which EVB doesnt accept) to initialice it.
3. Visual Basic .Net for pocket pc platform solves the socket problem but doesn't manage serial communications. I found an class to manage serial communications from EVB.NEt but it doesn't seem to work for a Windows CE 3.0 device.

Thanks in advace.
0
Comment
Question by:crocca
  • 2
  • 2
5 Comments
 
LVL 48

Expert Comment

by:Mikal613
ID: 10780139
http://www.pocketpcdn.com/articles/http.html

Good news Winsock does accept the UDP Protocol
0
 

Author Comment

by:crocca
ID: 10784336
Thanks Mika but I have alrady seen this article and:

1. The protocol used here is TCP, not UDP ("WinSock1.Protocol = CInt(0)", 0 is TCP, 1 is UDP but is not accepted in EVB)
2. This article (like others) says that Winsock Control accepts UDP but when you put a Winsock Control in a form, you get only 2 options for the protocol: 0 (TCP) and 2 (IR).

I've found one Micosoft Example (the socket example that comes for the HPC SDK, found in "C:\Program Files\Windows CE Toolsrama\wce211\MS HPC Pro\samples\eVB\WSock\Device") that uses the thre options, TCP, UDP and IR, but in the UDP part of the code it says that the winsock control doesn't accept UDP!!!!.
I tested it and it's true. If you put 1 in the protocol you get an error 380, "invalid property value", and if you use the bind() method (from the udp protocol) you also get an error ("object doesn't accept this method" or something like that)

I think the solution to implement this in VB passes through making API calls to the socket API but:
1. I haven't found the name of the socket dll to call or the API functions
2. What I've seen in C++ cals to the API, you need to initialize de socket calling a function with a structure as a parameter. And EVB doesn't accept structres.

I still haven't got a clue to the solution other than using TCP protocol, but I don't want to because I will be recieving packets from various "senders" to the same "reciever" so I dont want to establish a connection. Thats the definition of UDP!

Carlos
0
 
LVL 7

Accepted Solution

by:
CJCraft earned 500 total points
ID: 10795252
I'd consider the VB.NET path.  It is more powerful and more supported.  If you need serial support in VB .NET you can use the Smart Device Framework, open source, from http://www.opennetcf.org/CategoryView.aspx?category=Home.
0
 
LVL 7

Expert Comment

by:CJCraft
ID: 10795262
0
 

Author Comment

by:crocca
ID: 10809258
Thanks CJCraft,

I used the Smart Device Framework. It got some errors that couldn't make it work but now it is almost working. I still get an error when closing the serial port but i guess I'll fix it soon.

Thanks for the tip on the Smart Device Framework.

I still can't believe microsoft didn't implement the serial com on VB .Net!

Carlos
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I think the most popular question in our Windows Mobile Programming zone is about the backlight - we all want to keep it on when our application is running. Few years ago the function SystemIdleTimerReset() did this job. On our side we had to detec…
In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
Migrating to Microsoft Office 365 is becoming increasingly popular for organizations both large and small. If you have made the leap to Microsoft’s cloud platform, you know that you will need to create a corporate email signature for your Office 365…
This is used to tweak the memory usage for your computer, it is used for servers more so than workstations but just be careful editing registry settings as it may cause irreversible results. I hold no responsibility for anything you do to the regist…

911 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now