Timm Murray > UAV-Pilot-0.8 > UAV::Pilot::WumpusRover::PacketFactory

Download:
UAV-Pilot-0.8.tar.gz

Dependencies

Annotate this POD

CPAN RT

New  1
Open  2
View/Report Bugs
Source  

NAME ^

  UAV::Pilot::WumpusRover::PacketFactory

SYNOPSIS ^

    # Where $packet_in is a bunch of bytes read from the network:
    my $packet = UAV::Pilot::WumpusRover::PacketFactory->read_packet(
        $packet_in );

    # Create a fresh packet that we might later send over the network:
    my $new_packet = UAV::Pilot::WumpusRover::PacketFactory->fresh_packet(
        'Ack' );

DESCRIPTION ^

Creates new packets, either for reading a bunch of bytes off the network, or for fresh ones that we'll send back over the network.

METHODS ^

read_packet

    read_packet( $bytes )

Takes a bunch of bytes and returns a UAV::Pilot::WumpusRover::Packet object based on that data.

fresh_packet

    fresh_packet( $type )

Creates a new packet based on $type and returns it. The $type parameter should be one of the classes under UAV::Pilot::WumpusRover::Packet::, such as Ack or RadioOutputs.

syntax highlighting: