Stephen R. Scaffidi > TL1ng-0.08 > TL1ng::Base

Download:
TL1ng-0.08.tar.gz

Dependencies

Annotate this POD

CPAN RT

Open  1
View/Report Bugs
Module Version: 0.08   Source  

DESCRIPTION ^

Base class for device-specific TL1ng classes. Provides the most basic functionality required for working with TL1. Sub-classes typically would not override the methods here, rather they would use those methods to build 'macros' for working with a specific device.<br> <br> I plan on writing an example device-specific sub-class in the near future to demonstrate what I mean.

new

Create a new TL1 object representing the connection to the TL1 NE/GNE.<BR> <BR> Right now I've only written a TL1ng::Source subclass to support working over a Telnet connection but in the future I may add the ability to use a serial port or named pipe or something...

get_next

Retrieves the next available message, regardless of it's type. Will wait up to $timeout seconds for a message, defaulting to whatever the source's current timeout is. If no messages become available, returns undef.

 my $timeout = $tl1->source->timeout();
 my $msg     = $tl1->get_next();  # waits $timeout seconds
 
 my $msg     = $tl1->get_next(5);  # waits 5 seconds

get_auto

Retrieves the next available autonomous message. Will wait until $timeout seconds or default to $self->timeout(). If no autonomous message can be retrieved, returns false.

 my $msg = $tl1->get_auto();

get_resp

Retrieves the next available message that is a response to the given CTAG. (Remember, all TL1 commands must have a CTAG for identifying the response messages to the command) If $timeout is specified, waits that many seconds for a matching message. If no timeout is specified, uses $self->timeout(). If no matching message is found, returns false.

 my $CTAG = '12345';
 my $timeout = 60;
 my $msg = $tl1->get_resp($CTAG, $timeout);

send_cmd

Sends a TL1 command string to the connected NE. This method will NOT wait for the NE to return any response, but my experience shows that this response may or not be useful, or even related to the issued command! Therefore, after sending the command this method returns the status of the output operation.(almost *always* true) Any responses to this command (or whatever the NE sends next) can be retrieved with get_next().

 my $cmd = 'rtrv-alm-all:andvmael3001::1;';
 $tl1->send_cmd($cmd);
 my $resp = $tl1->get_next();

Just a trick - this method (on success) actually returns $self, so you can chain it with another method, like this...

 my $ctag = '1234';
 my $cmd = 'rtrv-alm-all:andvmael3001::${ctag};';
 my $resp = $tl1->send_cmd($cmd)->get_resp($ctag);

source

Returns a reference to the module that provides access to the TL1 NE.

 $tl1->source->connect();
 $tl1->source->is_connected();
 # etc...

rand_ctag

Generates a random valid CTAG.

last_ctag

Returns the last CTAG used with send_cmd() (which parses out the CTAG and remembers it.)

syntax highlighting: