|
Post Number: 1
|
|
Post Number: 2
|
|
Post Number: 3
|
|
Post Number: 4
|
damien_s_lucifer
Emperor of Detnet
Group: Members
Posts: 33
Joined: Jan. 1970
|
|
Posted on: Feb. 17 2001,01:08 |
|
|
Now that I think about it, the Windows software that comes with the Visor should map the Visor to a COM: port (though it's probably referred to as USBCOMx: or something.)Here's an easy way to find the name of that port : use the Add Printer wizard, tell it you're connecting a LOCAL printer, and then scroll through the device names under "Use the following port :". It should be fairly easy to open the device as a file (say, "USBCOM1:" or whatever the device name is - maybe use the colon, maybe not, you'd have to try) and then redirect all I/O to a real COM port. Something like this (I hope you know Perl, or can at least make some sense out of it) : code:
# open the ports for read/write sysopen(PALM,"USBCOM1:",O_RDWR); sysopen(PORT,"COM2:",O_RDWR); # fork once if ($pid = fork()) { # we're the child, read input from the Palm and send to the COM port while (sysread(PALM,$input,1)) # Read a character from the PALM { syswrite(PORT,$input,1); # and write it to the COM port } exit(0); # Child is done } # end of child. # We're the parent. while (sysread(PORT,$input,1)) # Read a char from the COM port { syswrite(PALM,$input,1); # and write it to the Palm } # end of prog
If you don't know how to use fork(), I highly recommend learning. It makes the impementation *far* less painful. If your C library doesn't support a true fork(), get yourself better one (the GNU compiler for Windows supports it, I think.) Or just grab Perl for Windows from ActiveState. You'll probably have to adjust your COM port speed in Windows, it usually defaults to 9600. This message has been edited by damien_s_lucifer on February 17, 2001 at 08:13 PM
|
|
|
|
Post Number: 5
|
|
Post Number: 6
|
|
Post Number: 7
|
|
Post Number: 8
|
askheaves
Ack!!!
Group: Members
Posts: 1955
Joined: Sep. 2000
|
|
Posted on: Feb. 17 2001,05:52 |
|
|
You know what? That's a damn good question.I suppose it depends on what your specific application is. If you're doing programming, I wouldn't recommend even attempting this. For one thing, I have to believe that Windows has a hard coded speed limit on COM ports. You wouldn't be able to get any sort of speed advantage that you would out of USB since Fast USB 1 is 12Mb/s, Slow USB 1 is like 1Mb/s, and USB 2 is on the order of 400Mb/s. Also, programmatically, it's just as easy to access the USB functionality as it is to get to a COM port, and I believe the interface is a bit more powerful for you. Under WinNT, the system has logical access to 256 COM ports, and I believe Win9X has like 16 accessible. However, every COM port takes up significant system resources, like a memory range and in IRQ (although that has been minimized recently). COM ports are very antiquated beasts. If you want some real power, stick with the USB due to it's tremendous power. Explain your intent, and maybe we can help better.
|
|
|
|
Post Number: 9
|
|
Post Number: 10
|
|
|
|