Help for this page

Select Code to Download


  1. 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",
    );
    
  2. or download this
    my @packet_fields = qw(    ident
                flags
    ...
                    terminator
                    chksum
                    );
    
  3. 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);
    
  4. or download this
    my %packet_fields = (
       $Idents{ Format_7 }    => qw(    ident
    ...
                    chksum
                    ),
    );
    
  5. or download this
       @packet{$%packet_fields{ $ident} } = unpack (
       $packet_template{ $ident }, $buffer);