ControlX10-CM11
view release on metacpan or search on metacpan
$data = &ControlX10::CM11::read($serial_port, $no_block);
=item receive_buffer
This command handles the upload response to an "Interface Poll Signal"
message (0x5a) B<read> from the CM11. The module sends "ready" (0xc3) and
receives up to 10 bytes. The first two bytes are size and description of
the remaining bytes. These are used to decode the data bytes, but are not
returned by the B<receive_buffer> function. Each of the data bytes is
decoded as if it was a B<send> command from an external CM11 or equivalent
external source (such as an RF keypad).
$data = &ControlX10::CM11::receive_buffer($serial_port);
# $data eq "A2AK" after an external device turned off A2
Multiple house and unit addresses can appear in a single buffer.
if ($data eq "B1BKA2AJ") {
print "B1 off, A2 on\n";
}
# $percent == 40
A more complex C<$data> input is possible.
if ($data eq "B1B3B5B7B9BLLE") {
print "House B Inputs 1,3,5,7,9 Brightened to 85%\n";
}
The conversion between text_data and percent makes more sense to the code
than to humans. The following table gives representative values. Others
may be received from a CM11 and will be properly decoded.
Percent Text Percent Text
0 M7 50 AA
5 ED 55 I6
10 EC 60 NF
15 C7 65 N2
20 KD 70 F6
25 K4 75 DB
30 O7 80 D2
35 OA 85 LE
( run in 0.256 second using v1.01-cache-2.11-cpan-26ccb49234f )