"be consistent" | |
PerlMonks |
Re^3: finding a serial port with Win32::SerialPortby Marshall (Canon) |
on Aug 22, 2011 at 11:58 UTC ( [id://921632]=note: print w/replies, xml ) | Need Help?? |
Yes, using the code from AnonMonk... You have to ask Win32 what the names of the COM ports are or probe up to a certain COMxx number. There are USB ports that can show up as COM ports and I don't know how to create a complete list. I think its hard to do because a new COM port can just "show up" dynamically (i.e. when you plug in a new USB device). This may not be right, but this is what it does on my machine.
I think perhaps another possibility is to "probe COM ports". Use a block "eval" on the "open_uart($_);" statement. >br> Run through the first 32 ports. If a port works works then $_ is a valid COM port and push it onto some stack.
In Section
Seekers of Perl Wisdom
|
|