NAME
Device::RFXCOM::TX - Module to support an RFXCOM RF transmitter
VERSION
version 1.103250
SYNOPSIS
# for a USB-based device, transmitting X10 RF messages
my $tx = Device::RFXCOM::TX->new(device => '/dev/ttyUSB0', x10 => 1);
$tx->transmit(type => 'homeeasy', command => 'on', ...);
$tx->wait_for_ack() while ($tx->queue);
DESCRIPTION
Module to encode messages for an RFXCOM RF receiver. Module for sending RF messages with an RFXCOM transmitter.
IMPORTANT: This API is still subject to change.
METHODS
new(%parameters)
This constructor returns a new RFXCOM RF transmitter object. The supported parameters are:
- device
-
The name of the device to connect to. The value can be a tty device name or
hostname:port
for a TCP-based RFXCOM transmitter.The default is
/dev/rfxcom-tx
in anticipation of a scenario where a udev rule has been used to identify the USB tty device for the device. For example, a file might be created in/etc/udev/rules.d/91-rfxcom
with a line like:SUBSYSTEM=="tty", SYSFS{idProduct}=="6001", SYSFS{idVendor}=="0403", SYSFS{serial}=="AnnnnABC", NAME="rfxcom-tx"
where the
serial
number attribute is obtained from the output from:udevinfo -a -p `udevinfo -q path -n /dev/ttyUSB0` | \ sed -e'/ATTRS{serial}/!d;q'
- init_callback
-
This parameter can be set to a callback to be called when the device initialization has been completed.
- receiver_connected
-
This parameter should be set to a true value if a receiver is connected to the transmitter.
- flamingo
-
This parameter should be set to a true value to enable the transmission for "flamingo" RF messages.
- harrison
-
This parameter should be set to a true value to enable the transmission for "harrison" RF messages.
- koko
-
This parameter should be set to a true value to enable the transmission for "klik-on klik-off" RF messages.
- x10
-
This parameter should be set to a false value to disable the transmission for "x10" RF messages. This protocol is enable by default in keeping with the hardware default.
There is no option to enable homeeasy messages because they use either the klik-on klik-off protocol or homeeasy specific commands in order to trigger them.
receiver_connected()
Returns true if the transmitter is operating with a receiver connected.
flamingo()
Returns true if the transmitter is configured to transmit "flamingo" RF messages.
harrison()
Returns true if the transmitter is configured to transmit "harrison" RF messages.
koko()
Returns true if the transmitter is configured to transmit "klik-on klik-off" RF messages.
x10()
Returns true if the transmitter is configured to transmit "x10" RF messages. This attribute defaults to true.
transmit(%params)
This method sends an RF message to the device for transmission.
wait_for_ack($timeout)
This method blocks until a new message has been received by the device. When a message is received a data structure is returned that represents the data received.
IMPORTANT: This API is still subject to change.
THANKS
Special thanks to RFXCOM, http://www.rfxcom.com/, for their excellent documentation and for giving me permission to use it to help me write this code. I own a number of their products and highly recommend them.
SEE ALSO
RFXCOM website: http://www.rfxcom.com/
AUTHOR
Mark Hindess <soft-rfxcom@temporalanomaly.com>
COPYRIGHT AND LICENSE
This software is copyright (c) 2010 by Mark Hindess.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.