Bluetooth library v1.5 and IrDA support

L

Lonifasiko

Hi,

I'm playing with the Bluetooth library v1.5 that Peter Foot released
some weeks ago here: http://32feet.net/default.aspx

The "ObjectPush" example application detects my mobile phone Nokia 6100
but I'm having problems with a glucometer I've recently bougth. This
glucometer can transfer (the prospect says that) stored data via
infrarred port towards PC or PDA. In my case, I want to capture data to
download it from the glucometer to the PDA. When I have the glucometer
ready for transferring data and both infrarred ports are paired, the
example does not discover any device. ic.DiscoverDevices() method does
not discover the glucometer at all, but discovers my mobile phone
perfectly. What could be the reason? Is there more than one protocol
in infrarred communication like there is in Bluetooth (Widcomm and
Microsoft's Bluetooth stacks)?

I know that Accu-Check (the manufacturer company of the glucometer) has
got a special software (both for PC and PDA) that reads data via
infrarred port, but I want to capture it myself in order to do it my
own with my .NET CF application. I want to think that they use a
standard interface for transferring data from the glucometer to the
PDA....else I'm lost.

Don't know if it's important but I'm deploying this example into my
iPAQ from VS.NET 2005 Beta2. Any incompatibilities while project
conversion?

Peter, I need you more than ever, but any help from anybody will be
greatly appreciated.

Anyway, I'll try to call glucometer's manufacturer so they can tell me
about the way infrarred communication is done between glucometer and
PDA.

Thanks in advance.
 
P

Peter Foot [MVP]

It's possible that although they use Infrared it's not over IrDA, hence the
discovery not working. I'd really need some more details of the device to be
able to provide a detailed suggestion. You can possibly connect to the Ir
port directly using the COM port and connect to the device that way and
you'll need to know from the manufacturer what format the data is
transmitted in.

Peter
 
L

Lonifasiko

Hi Peter, thanks very much for your info.

Here is the link of the device I'm playing with:
http://www.accu-chek.com/us/rewrite/content/en_US/2.1.3:30/article/ACCM_general_article_2533.htm

I've now noticed that at the bottom of the page says:
"use infrared technology to beam data to your PDA with ACCU-CHEK®
Active Cable".

I'm afraid I have to buy the cable they say. This cable (I've found
"ACCU-CHEK® Active Cable"), as far as I understand is a cable that
converts infrarred signal to serial port. On their web seems to be this
way!

Could you please confirm me this Peter?

You told me that I could maybe connect to IR port directly using the
COM port. What do you mean Peter? Could you give me any suggestion on
doing this?

I thougth all infrarred communication were over irDA and therefore
accesible with your library, but I now see that there are different
ways of achieving this kind of connections. What a pain!

Thanks very much for all your help Peter. Regards.
 
P

Peter Foot [MVP]

Their adapter may or may not be specific to their application, I would
suspect not, and it is provided for users with desktop PCs 99% of which
don't have Infrared built in.

There are two ways of accessing infrared over a virtual serial port, the
first is to connect directly to the infrared port and you'll have full
control over infrared, the other is to use the IrCOMM port which is
implemented on top of IrDA. Both have a different port name usually they are
COM2: and COM3: but the settings are in the registry (don't have them to
hand right now). If you think this would be sufficiently useful these
properties are something that could be incorporated into a future version.

If you use the serial port code from OpenNETCF or other ones available (or
the new classes in .NETCF v2.0) you could try to establish a connection this
way and see if you can retrieve any data, but if the device is expecting
specific commands you'll need some documentation from the manufacturer.

Let me know how you get on

Peter

--
Peter Foot
Windows Embedded MVP
http://www.inthehand.com | http://www.peterfoot.net

Hi Peter, thanks very much for your info.

Here is the link of the device I'm playing with:
http://www.accu-chek.com/us/rewrite/content/en_US/2.1.3:30/article/ACCM_general_article_2533.htm

I've now noticed that at the bottom of the page says:
"use infrared technology to beam data to your PDA with ACCU-CHEK®
Active Cable".

I'm afraid I have to buy the cable they say. This cable (I've found
"ACCU-CHEK® Active Cable"), as far as I understand is a cable that
converts infrarred signal to serial port. On their web seems to be this
way!

Could you please confirm me this Peter?

You told me that I could maybe connect to IR port directly using the
COM port. What do you mean Peter? Could you give me any suggestion on
doing this?

I thougth all infrarred communication were over irDA and therefore
accesible with your library, but I now see that there are different
ways of achieving this kind of connections. What a pain!

Thanks very much for all your help Peter. Regards.
 
L

Lonifasiko

Thanks Peter, I'm going to try connecting to infrarred port with CF 2.0
classes right now! I understand I must connect to COM2 or COM3 virtual
serial ports and listen if data is received.

Thanks and be sure I'll give you some feedback around this. Regards.
 
L

Lonifasiko

Peter, I'm trying to read from COM2 or COM3 port wihout any success.
This is my code. See if you can take a rapid look at it:

SerialPort sp = new SerialPort("COM3", 19200);
sp.DataReceived += new
SerialDataReceivedEventHandler(this.ReceiveData);
sp.ReadTimeout = 3000;
sp.WriteTimeout = 3000;
sp.Open();
char[] inputCharacters = new char[10000];
sp.Read(inputCharacters, 0, 5);

I understand this code shoul do it!

Thanks.
 
P

Peter Foot [MVP]

Start from the beginning, does the SerialPort get created successfully, if
not what exception do you get?

Peter
 
L

Lonifasiko

Hi Peter, sorry for yesterday's rush.

I'm using an iPAQ h5550 with infrarred port incorporated.

Playing with the code I sent you, these are the results:

- When opening COM2 (irDA you said), I got a System.IO.IOException
saying that "port COM2 does not exist".
- COM3 (irCOMM) is successfully opened but throws an exception when
reading from buffer. It throws a System.TimeoutException.

I've tried with different baudrates, parities, I've also tried reading
bytes, char, using ReadExisting and ReadLine methods........but no
results.

I think today glucometer manufacturer is going to put in contact with
me, but seems that they use an specific protocol or data format. All
that I suppose is oriented for the software they optionally sell with
the glucometer. Is this normal?

Discovery of infrarred devices I think should be a universal unique
protocol. Does irDA access with your library try to do this? Is yours a
standard?

I hope to tell you soon the results from my telephone call to the
manufacturer.

Kind regards.
 
D

Dick Grier

Hi,
I think today glucometer manufacturer is going to put in contact with
me, but seems that they use an specific protocol or data format. All
that I suppose is oriented for the software they optionally sell with
the glucometer. Is this normal?
<<

Yes. Serial protocols are (most) often ad hoc. Sometimes a device simply
spits out ASCII text that you can interpret easily. Often there are
embedded data that are used for control, data delimiting, formatting, or
error detection (always true if a binary protocol is employed). My guess is
that 8 out of 10 off-the-shelf devices use a serial protocol that would
require some explanation from the manufacturer for you to code an app that
uses it.

Dick
--
Richard Grier (Microsoft Visual Basic MVP)

See www.hardandsoftware.net for contact information.

Author of Visual Basic Programmer's Guide to Serial Communications, 4th
Edition ISBN 1-890422-28-2 (391 pages) published July 2004. See
www.mabry.com/vbpgser4 to order.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top