Device::TNC

Device::TNC is a Perl module that acts like a generic interface to a TNC.
Download

Device::TNC Ranking & Summary

Advertisement

  • Rating:
  • License:
  • Perl Artistic License
  • Price:
  • FREE
  • Publisher Name:
  • R Bernard Davison
  • Publisher web site:
  • http://search.cpan.org/~rbdavison/XML-API-WIX2-0.02/lib/XML/API/WIX2.pm

Device::TNC Tags


Device::TNC Description

Device::TNC is a Perl module that acts like a generic interface to a TNC. Device::TNC is a Perl module that acts like a generic interface to a TNC.This module implements a generic interface to a Terminal Node Controller (TNC).It loads sub classes that provide the low level interface for the appropriate TNC to be used and provides higher level methods to return frames of data to the user is human readable form.SYNOPSIS use Device::TNC; my $tnc_type = 'KISS'; my %tnc_config = ( 'port' => ($Config{'osname'} eq "MSWin32") ? "COM3" : "/dev/TNC-X", 'baudrate' => 9600, 'warn_malformed_kiss' => 1, 'raw_log' => "raw_packet.log", ); my $tnc = new Device::TNC($tnc_type, %tnc_config); die "Error: Something went wrong connecting to the TNC.n" unless $tnc; while (1) { my $data = $tnc->read_frame(); my $repeaters = join ", ", @{$data->{'ADDRESS'}->{'REPEATERS'}}; my $info = join "", @{$data->{'INFO'}}; print "From: $data->{'ADDRESS'}->{'SOURCE'} "; print "To: $data->{'ADDRESS'}->{'DESTINATION'} "; print "via $repeatersn"; print "Data: $infon"; }new() my $type = "KISS"; my %tnc_data = { 'option' => 'value' }; my $tnc = new Device::TNC($type, %tnc_data);The new method creates and returns a new Device::TNC object that can be used to communicate with a Terminal Node Controller (TNC) of the type passed.The method requires that the first passed argument be the type of TNC to connect to. This will try and load the appropriate module for the TNC type.The subsequent options are passed to the module that is loaded to connect to the desired TNC.For more details on these options see the module documentation for the TNC type.read_frame() my $frame_data = $tnc->read_frame(); my %frame_data = $tnc->read_frame();This method reads a HDLC frame from the TNC and returns a structure as either a hash or a hash reference that contains the fields of the frame.The structure of the returned data is like the following. { 'INFO' => , 'PID' => 'F0', 'CONTROL' => { 'POLL_FINAL' => 0, 'FIELD_TYPE' => 'UI', 'FRAME_TYPE' => 'U' }, 'ADDRESS' => { 'DESTINATION' => 'APT311', 'REPEATERS' => , 'SOURCE' => 'VK2KFJ-7' } }While developing this module I only received U (UI) type frames and so development of the code to work with I and S frames didn't really progress. If anyone want's to read I or S frames please let me know and I'll have a look at implementing them. Please create a KISS log of the data and email it to me. Requirements: · Perl


Device::TNC Related Software