mdog has asked for the wisdom of the Perl Monks concerning the following question:
use ControlX10::CM11; # $serial_port is an object created using Win32::SerialPort # or Device::SerialPort depending on OS # my $serial_port = setup_serial_port('COM10', 4800); # This works fine...I can turn things on and off #&ControlX10::CM11::send($serial_port, 'C1'); # Address device C1 #&ControlX10::CM11::send($serial_port, 'CJ'); # Turn device ON &ControlX10::CM11::send($serial_port, 'C1'); # Address device C1 &ControlX10::CM11::send($serial_port, 'CSTATUS'); # Query C1 for its s +tatus #&ControlX10::CM11::send($serial_port, 'CSTATUS_ON'); # Check if devic +e is on?? #&ControlX10::CM11::send($serial_port, 'CSTATUS_OFF'); # Check if devi +ce is off?? $data = &ControlX10::CM11::receive_buffer($serial_port); print "$data\n"; # always prints blank lines $data = &ControlX10::CM11::read($serial_port, $no_block); print "$data\n"; # always prints blank lines
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Device Status with ControlX10::CM11
by jasonk (Parson) on Mar 28, 2003 at 20:26 UTC | |
by mdog (Pilgrim) on Mar 28, 2003 at 22:37 UTC |