Solved

UDP connection in Windows CE 3.0

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

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Storing User Credentials 14 138
Android : Reclaim space from phone memory 1 193
Outlook on Android with no lock screen 2 146
Galaxy note 5 issue with new Android 6.0.1 update 7 419
Progress means simplifying, not complicating. Bruno Munari Preface How to detect the name of the internal storage or an SD-card on Windows Mobile device from the desktop application? I got this question, when I was working on a PC applicati…
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…
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

770 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