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

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::Packet

DESCRIPTION ^

Role for WumpusRover packets. These are based on the ArduPilot protocol packets, as described here:

http://code.google.com/p/ardupilot-mega/wiki/Protocol

No attempts have yet been made to test this against an existing ArduPilot implmentation, but it should be close.

Do not create Packets directly. Instead, use UAV::Pilot::WumpusRover::PacketFactory.

Does the UAV::Pilot::Logger role.

METHODS ^

write

    write( $fh )

Writes the packet to the given filehandle.

make_checksum_clean

Recalculates the checksum based on current field values.

make_byte_vector

Returns the packet fields in a single scalar full of bytes.

get_ordered_payload_vales

Returns the packet field values in the order they appear in payload_fields().

get_ordered_payload_value_bytes

Returns a byte array of all the packet fields in the order they appear in payload_fields().

make_packet_queue_map_key ^

Creates a unique key for this packet.

ATTRIBUTES ^

preamble

Fixed bytes that start every packet

version

Protocol version

checksum1

First checksum byte

checksum2

Second checksum byte

REQUIRED METHODS/ATTRIBUTES ^

message_id

ID for this type of message

payload_fields

Arrayref. A list of field names in the order they appear in the packet.

payload_length

Hashref. Keys match to an entry in payload_fields. Values are the length in bytes of that field.

syntax highlighting: