473,378 Members | 1,527 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

IrDA Questions

Hi all,

I have been battling to establish an IrDA connection between my Compaq i3850
and my Polar sport watch S720i (heart rate monitor).

I get some weird results, that I don't understand:
Here's my code:

--------------------
// Connect to S720i, send overview request and get results.
IrDAClient client = null;
Stream streamReader, streamWriter = null;
byte[] S720I_OVERVIEW_REQUEST = {0x34, 0xa6, 0x55,0x55,0x56,0xb8,0x25};

client = new IrDAClient();
client.Connect("HRM"); // S720i service = "HRM"

streamWriter = client.GetStream();

streamWriter.Write(S720I_OVERVIEW_REQUEST,0,7); // First question comes
up here!
streamWriter.Close();

byte[] buffer = new byte[1024];

streamReader.Read(buffer,0,buffer.Length-1); // Second question comes up
here!
streamReader.Close();

//... some exception handling follows.
----------------------

So here are my questions:
1. If I use streamWriter.Write I don't seem to get all response bytes (only
the first two). If I use
foreach(byte B in S720I_OVERVIEW_REQUEST)
{ streamWriter.WriteByte(B); }
I get all the values I need. Why is there a difference, doesn't
streamWriter.Write use a byte[] array?

2. Regardless of whether I read in the response with .Read or .ReadByte, the
response byte array
has a 0x02 byte as every other byte. The watch does not return this,
however. Example:
The result should be: {0x34, 0xa6, 0x55,0x55,0x56,0xb8,0x25}, however,
the .Read method gets me
{0x34, 0x02, 0xa6, 0x02, 0x55, 0x02, 0x55,0x02, 0x56,0x02, 0xb8, 0x02,
0x25}.

3. Could all of this have to do with the connection speed of the iPAQ's IR
port? The watch can do:
9600 bps, 8 data bits, 1 or 2 stop bits (??), no parity
Is there a way to set this programmatically?

Any help would be appreciated, otherwise my scalp will be completely void of
hair since I will have torn out
large lumps of it ;)

Regards,
Michael
Nov 16 '05 #1
0 1160

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: William Ryan | last post by:
If you download the code for MS Press Microsoft .NET Compact Framework by Wigley and Wheelwright in Chapter 11 there's code to handle this. If you haven't bought the book----TRUST ME, BUY IT. In...
1
by: Ajay Mahale | last post by:
Is the irda socket based api for windows platform specific ..the dotnet framework (non-compact :)) doesnot seem to support IRDA based communication.Can any one give me a few hinters as to how to...
0
by: Markus Stoeckli | last post by:
I try to interface an embedded device with an iPAQ running PPC2002 over IrDA (C#, VS7). The embedded device uses a MCP2150 controller which handles the IRComm protocol. With the iPAQ I want to...
0
by: Sirtap | last post by:
Hello I have a computer equipped in IrDA port and I'm wandering how to make use of it in my program under WindowsXP. There's Socket class, which has a constructor, where I can pass something...
2
by: Jasmina | last post by:
I am working on an application that will do file exchange (send/receive) between Pocket PC and PC (laptop) via IrDA. I am using VB .NET. On the Pocket PC side I use System.Net.IrDA and...
4
by: Roger Allen | last post by:
Hi: I am trying to write an app in VB2005 that can send data to another device via the IR port on my laptop. I do not want to use Comm Port workarounds. Does anyone know of code examples,...
3
by: Robb Gilmore | last post by:
Hi, I need to write a C#.NET PC application that can talk to a non-windows device using a USB-IrDA adapter. I have been searching for information about how to do this, and the bext info I have...
6
by: Dave | last post by:
I cannot seem to locate the System.Net.IrDA namespace in C# express. Where could I get this dll? -- L. A. Jones
4
by: hjgvhv uhhgvjuhv | last post by:
I am trying my hand at IrDA software. Google came up with so many hits, I am running in circles. Does anyone have any web site with decent explanation of IrDA operation ? Thanks donald
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.