=head1 DESCRIPTION
-In unidirectionnal communication channels (such as networking or IPC), the main issue is often to know the length of the message. Some possible solutions are fixed-length messages (which is quite cumbersome) or a special ending sequence (but it no longer can appear in the data). This module proposes another solution, by using a begin/end signature specialized for each message.
+In unidirectionnal communication channels (such as networking or IPC), the main issue is often to know the length of the message.
+Some possible solutions are fixed-length messages (which is quite cumbersome) or a special ending sequence (but it no longer can appear in the data).
+This module proposes another solution, by using a begin/end signature specialized for each message.
An actual implementation is also provided :
=head1 PROTOCOL
-Each byte of the data string is converted into its bits sequence, with bits of lowest weight coming first. All those bits sequences are put into the same order as the characters occur in the string.
+Each byte of the data string is converted into its bits sequence, with bits of lowest weight coming first.
+All those bits sequences are put into the same order as the characters occur in the string.
The header is composed of three bits (lowest weight coming first) :
=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<Storable> object. See also the L</CONSTANTS> section ;
+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<Storable> object.
+See also the L</CONSTANTS> section ;
=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
-The emitter computes then the longuest sequence of successives 0 (say, m) and 1 (n) in the concatenation of the header and the data. A signature is then chosen :
+The emitter computes then the longuest sequence of successives 0 (say, m) and 1 (n) in the concatenation of the header and the data.
+A signature is then chosen :
=over 4
a ... a b | t0 t1 r | ... data ... | b a ... a
signature | header | data | reversed signature
-The receiver knows that the signature has been sent when it has catched at least one 0 and one 1. The signal is completely transferred when it has received for the first time the whole reversed signature.
+The receiver knows that the signature has been sent when it has catched at least one 0 and one 1.
+The signal is completely transferred when it has received for the first time the whole reversed signature.
=head1 CONSTANTS
=head2 C<BM_DATA_AUTO>
-Default for non-references messages. Try to guess if the given scalar is an UTF-8 string with C<Encode::is_utf8>.
+Default for non-references messages.
+Try to guess if the given scalar is an UTF-8 string with C<Encode::is_utf8>.
=head2 C<BM_DATA_PLAIN>
-Treats the data as a plain string. No extra mangling in done.
+Treats the data as a plain string.
+No extra mangling in done.
=head2 C<BM_DATA_UTF8>
-Treats the data as an UTF-8 string. The string is C<Encode::encode_utf8>'d in a binary string before sending, and C<Encode::decode_utf8>'d by the receiver.
+Treats the data as an UTF-8 string.
+The string is C<Encode::encode_utf8>'d in a binary string before sending, and C<Encode::decode_utf8>'d by the receiver.
=head2 C<BM_DATA_STORABLE>
=head1 BUGS
-Please report any bugs or feature requests to C<bug-bit-morsesignals at rt.cpan.org>, or through the web interface at L<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.
+Please report any bugs or feature requests to C<bug-bit-morsesignals at rt.cpan.org>, or through the web interface at L<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.
=head1 SUPPORT
=head1 DESCRIPTION
-Base class for L<Bit::MorseSignals> emitters. Please refer to this module for more general information about the protocol.
+Base class for L<Bit::MorseSignals> emitters.
+Please refer to this module for more general information about the protocol.
-The emitter object enqueues messages and prepares them one by one into L<Bit::MorseSignals> packets. It gives then back the bits of the packet in the order they should be sent.
+The emitter object enqueues messages and prepares them one by one into L<Bit::MorseSignals> packets.
+It gives then back the bits of the packet in the order they should be sent.
=cut
my $bme = Bit::MorseSignals::Emitter->new;
-L<Bit::MorseSignals::Emitter> object constructor. Currently does not take any optional argument.
+L<Bit::MorseSignals::Emitter> object constructor.
+Currently does not take any optional argument.
=cut
$bme->post($msg, type => $type);
-Adds C<$msg> to the message queue and, if no other message is currently processed, dequeue the oldest item and prepare it. The type is automatically chosen, but you may want to try to force it with the C<type> option : C<$type> is then one of the C<BM_DATA_*> constants listed in L<Bit::MorseSignals/CONSTANTS>
+Adds C<$msg> to the message queue and, if no other message is currently processed, dequeue the oldest item and prepare it.
+The type is automatically chosen, but you may want to try to force it with the C<type> option : C<$type> is then one of the C<BM_DATA_*> constants listed in L<Bit::MorseSignals/CONSTANTS>
=cut
=head2 C<pop>
-If a message is being processed, pops the next bit in the packet. When the message is over, the next in the queue is immediatly prepared and the first bit of the new packet is given back. If the queue is empty, C<undef> is returned. You may want to use this method with the idiom :
+If a message is being processed, pops the next bit in the packet.
+When the message is over, the next in the queue is immediatly prepared and the first bit of the new packet is given back.
+If the queue is empty, C<undef> is returned.
+You may want to use this method with the idiom :
while (defined(my $bit = $deuce->pop)) {
...
=head1 BUGS
-Please report any bugs or feature requests to C<bug-bit-morsesignals-emitter at rt.cpan.org>, or through the web interface at L<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.
+Please report any bugs or feature requests to C<bug-bit-morsesignals-emitter at rt.cpan.org>, or through the web interface at L<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.
=head1 SUPPORT
=head1 DESCRIPTION
-Base class for L<Bit::MorseSignals> receivers. Please refer to this module for more general information about the protocol.
+Base class for L<Bit::MorseSignals> receivers.
+Please refer to this module for more general information about the protocol.
Given a sequence of bits coming from the L<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.
my $bmr = Bit::MorseSignals::Receiver->new(done => $cb);
-L<Bit::MorseSignals::Receiver> object constructor. With the C<'done'> option, you can specify a callback that will be triggered every time a message is completed, and in which C<$_[0]> will be the receiver object and C<$_[1]> the message received.
+L<Bit::MorseSignals::Receiver> object constructor.
+With the C<'done'> option, you can specify a callback that will be triggered every time a message is completed, and in which C<$_[0]> will be the receiver object and C<$_[1]> the message received.
=cut
$bmr->push($bit);
-Tells the receiver that you have received the bit C<$bit>. Returns true while the message isn't completed, and C<undef> as soon as it is.
+Tells the receiver that you have received the bit C<$bit>.
+Returns true while the message isn't completed, and C<undef> as soon as it is.
=cut
=head1 BUGS
-Please report any bugs or feature requests to C<bug-bit-morsesignals-receiver at rt.cpan.org>, or through the web interface at L<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.
+Please report any bugs or feature requests to C<bug-bit-morsesignals-receiver at rt.cpan.org>, or through the web interface at L<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.
=head1 SUPPORT