Hi all,

I have an HP iPaq 2495 with Mobile 5.0. I'm trying to create a program
to send data to a Lego Mindstorm unit. Using a regediting program I
installed, I found the following several entries, from which I think
the communications port is COM2 or COM3

HKEY_LOCAL_MACHINE/Comm/Irsir1/Parms/Port = 2
HKEY_LOCAL_MACHINE/Drivers/Builtin/IRCOMM/Index = 3
HKEY_LOCAL_MACHINE/Drivers/Builtin/IrDA/Index = 2

Now thinking that IrDA is not the format I want, as I need to have
direct control over the emitted IR signal, I used COM3 in the following
code

<code>
dim serialtest as new system.io.ports.serialport("COM3")
serialtest.open()
serialtest.write(bytes, 0, 10) 'Writing a byte file of length 10
serialtest.close()
</code>

This gives me the following error triggered at the serialtest.write()
line:
IOException
at System.IO.Ports.SerialStream.WinIOError()
at System.IO.Ports.SerialStream.Write()
at System.IO.Ports.SerialPort.Write()
at DeviceApplication3.Form1.tester()
at DeviceApplication3.Button1_click()
...

It also produces no IR transmission. I also tried switching to COM2,
and while this gave me no errors, it also produced no IR transmission.

Thanks for your help,

Ryan

Re: Using the IR port for serial communication by Yaroslav

Yaroslav
Wed Apr 05 02:27:36 CDT 2006

It has been discussed a while ago. For example, the thread below is also
about controlling Lego via Pocket PC raw IR.
http://groups.google.com/group/microsoft.public.pocketpc.developer/browse_thread/thread/736d22be1324c855/03c7506612fd6541?lnk=st&q=serial+IR+Pocket+PC&rnum=3&hl=ru#03c7506612fd6541


--
Yaroslav Goncharov
Spb Software House, http://spbsoftwarehouse.com
Pocket PC Developer Network, http://pocketpcdn.com


<rrryanc@gmail.com> wrote in message
news:1144210825.779788.244850@v46g2000cwv.googlegroups.com...
> Hi all,
>
> I have an HP iPaq 2495 with Mobile 5.0. I'm trying to create a program
> to send data to a Lego Mindstorm unit. Using a regediting program I
> installed, I found the following several entries, from which I think
> the communications port is COM2 or COM3
>
> HKEY_LOCAL_MACHINE/Comm/Irsir1/Parms/Port = 2
> HKEY_LOCAL_MACHINE/Drivers/Builtin/IRCOMM/Index = 3
> HKEY_LOCAL_MACHINE/Drivers/Builtin/IrDA/Index = 2
>
> Now thinking that IrDA is not the format I want, as I need to have
> direct control over the emitted IR signal, I used COM3 in the following
> code
>
> <code>
> dim serialtest as new system.io.ports.serialport("COM3")
> serialtest.open()
> serialtest.write(bytes, 0, 10) 'Writing a byte file of length 10
> serialtest.close()
> </code>
>
> This gives me the following error triggered at the serialtest.write()
> line:
> IOException
> at System.IO.Ports.SerialStream.WinIOError()
> at System.IO.Ports.SerialStream.Write()
> at System.IO.Ports.SerialPort.Write()
> at DeviceApplication3.Form1.tester()
> at DeviceApplication3.Button1_click()
> ...
>
> It also produces no IR transmission. I also tried switching to COM2,
> and while this gave me no errors, it also produced no IR transmission.
>
> Thanks for your help,
>
> Ryan
>



Re: Using the IR port for serial communication by rrryanc

rrryanc
Wed Apr 05 10:30:04 CDT 2006

Hi,

I looked at that thread and it appears that what I'm trying to do
should work, at least according to the second poster in it. However,
there was no information on how that's accomplished and I'm left with
my non-functional code still. I replied to the person who said they
had successfully done it before, but that thread is over 2 years old.
Thanks for your help,

Ryan