FT817COMM
view release on metacpan or search on metacpan
NAME
VERSION
SYNOPSIS
Constructor and Port Configurations
Destructor
Lock File
Initialization
METHODS
1. Using Return Data From a Module
2. Using setVerbose()
3. Build a sub-routine into a condition
DEBUGGER
Modules
AUTHOR
BUGS
SUPPORT
ACKNOWLEDGEMENTS
LICENSE AND COPYRIGHT
NAME ^
Ham::Device::FT817COMM - Library to control the Yaesu FT817 Ham Radio
VERSION ^
Version 0.9.8
SYNOPSIS ^
use HAM::Device::FT817COMM;
Constructor and Port Configurations
my $FT817 = new Ham::Device::FT817COMM (
serialport => '/dev/ttyUSB0',
baud => '38400',
lockfile => '/var/lock/ft817'
);
my $port = $FT817->{'serialport'};
my $baud = $FT817->{'baud'};
my $lockfile = $FT817->{'lockfile'};
my $version = $FT817->moduleVersion;
Destructor
$FT817->closePort;
Lock File
In the event you abruptly end the software or loose connectivity via ssh. When attempting to reconnect you will see the following error.
Can't open serial port /dev/ttyUSB0: File exists
The lock file can be remove simply by
rm /var/lock/ft817
Initialization
The instance of the device and options are created with the constructor and port configurations shown above. The variable which is an instance of the device may be named at that point. In this case $FT817. The serialport must be a valid port and not ...
Note that you are not limited to one radio. You can create more than one instance using a different name and serial port
my $anotherFT817 = new Ham::Device::FT817COMM (
serialport => '/dev/ttyUSB1',
baud => '38400',
lockfile => '/var/lock/ft817-2'
);
my $port = $FT817->{'serialport'};
my $baud = $FT817->{'baud'};
my $lockfile = $FT817->{'lockfile'};
my $version = $FT817->moduleVersion;
REMEMBER!!!! Each instance created needs its own destructor.
Finally lockfile is recommended to ensure that no other software may access the port at the same time. The lockfile is removed as part of the invocation of the destructor method.
METHODS ^
1. Using Return Data From a Module
This allows for complete control of the rig through the sub routines all done through the cat interface
$output = 'rigname'->'command'('value');
an example is a follows
$output = $FT817->catLock('ON');
Using this method, the output which is collected in the varible $output is designed to be minimal for use in applications that provide an already formatted output.
For example:
$output = $FT817->catLock('ON');
print "$output";
Would simply return F0 if the command failed and 00 if the command was sucessfull. The outputs vary from module to module, depending on the function
2. Using setVerbose()
The module already has pre-formatted outputs for each subroutine. Using the same example in a different form and setting setVerbose(1) we have the following
setVerbose(1);
$FT817->catLock('ON');
The output would be, for example:
Set Lock (ENABLE) Sucessfull.
Other verbose outputs exist to catch errors.
setVerbose(1);
$FT817->catLock('blabla');
The output would be:
Set Lock (blabla) Failed. Option:blabla invalid.
An example of both is shown below for the command getHome()
As return data: Y
As verbose(1) : At Home Frequency
( run in 0.593 second using v1.01-cache-2.11-cpan-39bf76dae61 )