There is no template for 24-bit words. (This type of machine does not.) You can use any of the following snippets.
You want band be the most significant 6 bits of a 16-bit word ( y in yyyy yyxx xxxx xxxx ). To do this, use $_ >> 10 .
( $obj->{Version}, my $tmp0, $obj->{EARFCN}, my $tmp1, $obj->{res2}, my $tmp2 ) = unpack("C a3 v CCV", $data); $obj->{res1} = unpack("V", $tmp0."\x00"); $obj->{band} = $tmp1 >> 10;
or
( my $tmp0, $obj->{EARFCN}, my $tmp1, $obj->{res2}, my $tmp2 ) = unpack("V v CCV", $data); $obj->{Version} = $tmp0 & 0xFF; $obj->{res1} = $tmp0 >> 8; $obj->{band} = $tmp1 >> 10;
source share