X-Git-Url: http://git.vpit.fr/?a=blobdiff_plain;f=lib%2FBit%2FMorseSignals.pm;h=4df153d8ff3f2cbdc7b5d85f518b7bb3b9e8dbd1;hb=7311d27d4099d8c1f0e011db45d53a21853ff703;hp=d06a35318a5448675a2fd2f7cfebffbaa86a7179;hpb=9a209b336e8b6850c08050f7ca84f86f0546bf57;p=perl%2Fmodules%2FBit-MorseSignals.git diff --git a/lib/Bit/MorseSignals.pm b/lib/Bit/MorseSignals.pm index d06a353..4df153d 100644 --- a/lib/Bit/MorseSignals.pm +++ b/lib/Bit/MorseSignals.pm @@ -9,19 +9,21 @@ Bit::MorseSignals - The MorseSignals protocol. =head1 VERSION -Version 0.03 +Version 0.08 =cut -our $VERSION = '0.03'; +our $VERSION = '0.08'; =head1 SYNOPSIS use Bit::MorseSignals::Emitter; use Bit::MorseSignals::Receiver; - my $deuce = new Bit::MorseSignals::Emitter; - my $pants = new Bit::MorseSignals::Receiver done => sub { print $_[1], "\n" }; + my $deuce = Bit::MorseSignals::Emitter->new; + my $pants = Bit::MorseSignals::Receiver->new( + done => sub { print $_[1], "\n" }, + ); $deuce->post('HLAGH') for 1 .. 3; $pants->push while defined ($_ = $deuce->pop); @@ -34,9 +36,13 @@ An actual implementation is also provided : =over 4 -=item L is a base class for emitters ; +=item * -=item L is a base class for receivers ; +L is a base class for emitters ; + +=item * + +L is a base class for receivers. =back @@ -50,9 +56,13 @@ The header is composed of three bits (lowest weight coming first) : =over 4 -=item - The 2 first ones denote the data type : a value of 0 is used for a plain string, 1 for an UTF-8 encoded string, and 2 for a L object. See also the L section ; +=item * + +The 2 first ones denote the data type : a value of 0 is used for a plain string, 1 for an UTF-8 encoded string, and 2 for a L object. See also the L section ; + +=item * -=item - The third one is reserved. For compatibility reasons, the receiver should for now enforce the message data type to plain when this bit is lit. +The third one is reserved. For compatibility reasons, the receiver should for now enforce the message data type to plain when this bit is lit. =back @@ -60,9 +70,13 @@ The emitter computes then the longuest sequence of successives 0 (say, m) and 1 =over 4 -=item - If m > n, we take n+1 times 1 followed by one 0 ; +=item * -=item - Otherwise, we take m+1 times 0 followed by one 1. +If m > n, we take n+1 times 1 followed by one 0 ; + +=item * + +Otherwise, we take m+1 times 0 followed by one 1. =back @@ -106,11 +120,11 @@ The constants L, L, L and L; our @EXPORT = (); our %EXPORT_TAGS = ( - 'consts' => [ qw/BM_DATA_AUTO BM_DATA_PLAIN BM_DATA_UTF8 BM_DATA_STORABLE/ ] + 'consts' => [ qw ] ); our @EXPORT_OK = map { @$_ } values %EXPORT_TAGS; $EXPORT_TAGS{'all'} = [ @EXPORT_OK ]; @@ -127,7 +141,7 @@ L, L. Vincent Pit, C<< >>, L. -You can contact me by mail or on #perl @ FreeNode (vincent or Prof_Vince). +You can contact me by mail or on C (vincent). =head1 BUGS @@ -139,6 +153,8 @@ You can find documentation for this module with the perldoc command. perldoc Bit::MorseSignals +Tests code coverage report is available at L. + =head1 COPYRIGHT & LICENSE Copyright 2008 Vincent Pit, all rights reserved.