NAME
UAV::Pilot::ArdupilotProtocol::PacketFactory
SYNOPSIS
# Where $packet_in is a bunch of bytes read from the network:
my $packet = UAV::Pilot::ArdupilotProtocol::PacketFactory->read_packet(
$packet_in );
# Create a fresh packet that we might later send over the network:
my $new_packet = UAV::Pilot::ArdupilotProtocol::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::ArdupilotProtocol::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::ArdupilotProtocol::Packet::
, such as Ack
or RadioOutputs
.