Bit::MorseSignals::Receiver - Base class for Bit::MorseSignals receivers.


Bit-MorseSignals documentation  | view source Contained in the Bit-MorseSignals distribution.

Index


NAME

Top

Bit::MorseSignals::Receiver - Base class for Bit::MorseSignals receivers.

VERSION

Top

Version 0.06

SYNOPSIS

Top

    use Bit::MorseSignals::Receiver;

    my $pants = new Bit::MorseSignals::Receiver done => sub { print "received $_[1]!\n" };
    while (...) {
     my $bit = comes_from_somewhere_lets_say_signals();
     $pants->push($bit);
    }

DESCRIPTION

Top

Base class for Bit::MorseSignals receivers. Please refer to this module for more general information about the protocol.

Given a sequence of bits coming from the Bit::MorseSignals protocol, the receiver object detects when a packet has been completed and then reconstructs the original message depending of the datatype specified in the header.

METHODS

Top

new < done => $cb >

Bit::MorseSignals::Receiver object constructor. With the 'done' option, you can specify a callback that will be triggered every time a message is completed, and in which $_[0] will be the receiver object and $_[1] the message received.

push $bit

Tells the receiver that you have received the bit $bit. Returns true while the message isn't completed, and undef as soon as it is.

reset

Resets the current receiver state, obliterating any current message being received.

busy

True when the receiver is in the middle of assembling a message.

msg

The last message completed, or undef when no message has been assembled yet.

EXPORT

Top

An object module shouldn't export any function, and so does this one.

DEPENDENCIES

Top

Carp (standard since perl 5), Encode (since perl 5.007003), Storable (idem).

SEE ALSO

Top

Bit::MorseSignals, Bit::MorseSignals::Emitter.

AUTHOR

Top

Vincent Pit, <perl at profvince.com>, http://www.profvince.com.

You can contact me by mail or on #perl @ FreeNode (vincent or Prof_Vince).

BUGS

Top

Please report any bugs or feature requests to bug-bit-morsesignals-receiver at rt.cpan.org, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Bit-MorseSignals. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.

SUPPORT

Top

You can find documentation for this module with the perldoc command.

    perldoc Bit::MorseSignals::Receiver

Tests code coverage report is available at http://www.profvince.com/perl/cover/Bit-MorseSignals.

COPYRIGHT & LICENSE

Top


Bit-MorseSignals documentation  | view source Contained in the Bit-MorseSignals distribution.