FT817COMM
view release on metacpan or search on metacpan
lib/Ham/Device/FT817COMM.pm view on Meta::CPAN
$letter2 = $labelarray[6];
($letter) = grep { $CWID{$_} eq $letter } keys %CWID;
($letter2) = grep { $CWID{$_} eq $letter2 } keys %CWID;
my $writestatus1 = $self->writeDoubleblock('1927',"$letter","$letter2");
print "$writestatus1\n";
if ($verbose){print "DONE!\n";}
return 0;
}
################################################## FIN
=head1 NAME
Ham::Device::FT817COMM - Library to control the Yaesu FT817 Ham Radio
=head1 VERSION
Version 0.9.9
=head1 SYNOPSIS
use HAM::Device::FT817COMM;
=head2 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;
=head2 Destructor
$FT817->closePort;
=head2 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
=head2 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 B<$FT817>.
The serialport must be a valid port and not locked. You must consider that your login must have
permission to access the port either being added to the group or giving the user suffucient privilages.
The baudrate 'baud' must match the baudrate of the radio B<CAT RATE> which is menu item B<14>.
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 B<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.
=head1 METHODS
=head2 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 B<$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 B<F0> if the command failed and B<00> if the command was sucessfull. The outputs vary
from module to module, depending on the function
=head2 2. Using setVerbose()
The module already has pre-formatted outputs for each subroutine. Using the same example in a different form
and setting B<setVerbose(1)> we have the following
setVerbose(1);
$FT817->catLock('ON');
The output would be, for example:
Set Lock (ENABLE) Sucessfull.
( run in 0.645 second using v1.01-cache-2.11-cpan-39bf76dae61 )