- or download this
# List all packet types that this script knows about
my %Idents = (
...
$Idents{ Rotation_Marker } => "C3 n n n n n n n n n n n n C3",
$Idents{ Format_7 } => "C B16 n2 A4 A8 A2 A A A3 C2",
);
- or download this
my @packet_fields = qw( ident
flags
...
terminator
chksum
);
- or download this
if ($ident == $Idents{ Rotation_Marker }) {
@packet{ @rotation_packet_fields } = unpack (
...
if ($ident == $Idents{ Format_7 }) {
@packet{ @packet_fields } = unpack (
$packet_template{ $ident }, $buffer);
- or download this
my %packet_fields = (
$Idents{ Format_7 } => qw( ident
...
chksum
),
);
- or download this
@packet{$%packet_fields{ $ident} } = unpack (
$packet_template{ $ident }, $buffer);