The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

UAV::Pilot::Wumpus::PacketFactory

SYNOPSIS

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

# Create a fresh packet that we might later send over the network:
my $new_packet = UAV::Pilot::Wumpus::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::Wumpus::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::Wumpus::Packet::, such as Ack or RadioOutputs.