Pocket PC Networking >> .NET CF IRDA Programming Problem

by mblatch » Thu, 24 Feb 2005 09:11:15 GMT

Sorry if some of you have read this on other newsgroups, but I hadn't
seen developer.networking and this question may be more appropriate
here.

I have developed an application in Visual Studio 2003 using .NET
Compact Frameworks v1.0 and even tried the Visual Studio 2005 beta 1
with .NET CF v2.0. I have coded the application in both C# and Visual
Basic, with no difference in results. This application is to allow my
PocketPC (Mobile 2003) to talk to a Polar Heart Rate Monitor (TinyTP
IRDA protocol).

Here's my problem. I initate a connection from the PocketPC using the
rough sequence of commands:

irClient.DiscoverDevices
irClient.Connect(endPoint)
irStream=irClient.GetStream

I then proceed to transmit commands to the Polar device and receive
responses using the pair of commands:

irStream.Write(....)
irStream.Read(....)

I sucessfully transmit 4 commands (1 byte in length) and get the
receive data back (2-7 bytes in length). The fifth command is
transmitted (at least I know it returns from irStream.Write), but there
is no received data and the app hangs. It's not the command that is
causing the hang, because I can send the same request 5 times in a row,
and I hang on the fifth.

Here's the catch. I can run the exact same application on my laptop,
using its IR port, and all data is received from the Polar device.
Also, I can run the application allowing my PocketPC and laptop to
communicate together and that works flawlessly.

So, could there be a protocol negotiation problem between my PocketPC
and the Polar watch (even though laptop and watch work)?

I'd appreciate any suggestions, or if I should inquire about this on
another newsgroup, please direct me there.

Thanks,
Mike



Similar Threads

1. open RADIO and GPRS connection via source code .net (.net CF 2.0, WM5) - Pocket PC Networking

2. What is good Book on .Net CF programming

Charlie,

There are a number of good books out, but the one I'd recommend would depend
on the language you plan to use. For example, if you'll be using VB.Net, I'd
recommend .Net Compact Framework Pocket Guide by Wei-Meng Lee as an
introduction and The Definitive Guide to the .Net Compact Framework by Roof
and Fergus for a more thorough treatment.

-- 
Ginny Caughey
.Net Compact Framework MVP

Have an opinion on the effectiveness of Microsoft Embedded newsgroups?
Let Microsoft know!
https://www.windowsembeddedeval.com/community/newsgroups



"charlie" < XXXX@XXXXX.COM > wrote in message
news: XXXX@XXXXX.COM ...
>
> Hi, is there a book for learning how to program for ppc's using .net cf,
that is written clearly and that is for someone who does not have any
programming  experience at all.
> Thank You


3. Programming for non graphical .NET CF - Pocketpc Developer

4. .Net CF loading forms problem.

Tried me.show at the formy load event
and frmY.Show after application.run(formY) in main sub.

Neither worked.

-Gabriel

"tperri" wrote:

> Did you do a frmY.Show();  ?
> 
> 
> 
> "Gabriel Alonso" wrote:
> 
> > There's seems to be a problem with application.run in the .NET compact framework.
> > 
> > The following text explains it:
> > 
> > I have a very weird problem, and I was hoping someone here could give me an advice on how to solve it. 
> > 
> > I have an app that begins on sub main. In the sub main I do something like this: 
> > 
> > public sub main 
> > 'do some stuff 
> > dim foo as new frmX 
> > application.run(foo) 
> > 'do some other stuff when user is done with formX 
> > dim bar as new frmY 
> > application.run(bar) 
> > 'When user is done with frmY, the program will just exit 
> > end sub 
> > 
> > Ok, as you can all see, this fairly simple program will open formX, wait until the user disposes formX, and then load and show formY... in theory. 
> > 
> > What really happens is that it loads and shows formX as expected... But when it's done with frmX (the user disposes it) and moves to frmY, it loads it, but it doesn't show it!... 
> > 
> > The form and the program are loaded, and you can access it via 'task manager', but in the moment the first form dissapears, it transfer the focus to whatever program was in front before starting my app. 
> > 
> > I have tried everything in the loadevent, activateevent of the second form, and even in submain... me.show, me.refresh, me.bringtofront... nothing seems to work... 
> > 
> > any ideas?
> > 
> > Thanks in advance. 
> > -Gabriel 
> > 

5. Irda v.s Bluetooth v.s CF v.s SD v.s Wireless Lan - Pocketpc Developer

6. IrDA using .NET Framework

7. Upload file to ASP.NET (.NET CF 1.0) - Pocketpc Developer

8. Forms - .NET vs .NET CF

Hello,

Can anybody explain what are the main difference between the full .NET 
Framework and the .NET Compact Framework regarding Windows Forms?

regards

mathon