Solved

UDP connection in Windows CE 3.0

Posted on 2004-04-07
5
786 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

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

Preface: This article is part of a series focused on cross platform mobile app development (specifically Android and iOS) using the Alloy framework and Titanium Studio made by Appcelerator (https://www.appcelerator.com/). This article presumes a wor…
A short article about problems I had with the new location API and permissions in Marshmallow
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…

760 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

26 Experts available now in Live!

Get 1:1 Help Now