Posted by F2 on Fri 3rd Feb 01:46 (modification of post by F2 view diff)
diff | download | new post
- use strict;
- my @arr = split(/\s+/,"50 00 9F 11 00 28 82 48 21 84 BC 00 01 02 01 00 09 01 38 00 23 05 08 01 01 02 00 00 18 00 50 05 00 00 00 00 00 00 00 00 02 00 0C FE CE 00 0F 00 FD FF 2D 00 00 00 00 00 04 01 0C FE");
- my @hexData;
- my $i=0;
- foreach my $elem(@arr){
- $i++;
- }
- my $obj;
- $obj=parse119F($data);
- my $ts = $obj->{timestamp};
- ## End of scope of main program.
- ## -- Subroutines defined below.
- sub getTimestamp{
- my ($length,$lc,$ts);
- $len=$len-12;
- if($length eq ($len+12)){
- my $ret=($timestamp[3]*2**32+$timestamp[2]*2**16+$timestamp[1]+($timestamp[0]%1536)/1536)*(0.00125);
- }
- else{
- }
- }
- sub parse119F{
- my ($obj,$tmp,$tmp1,$tmp2,$i,$j);
- $obj->{timestamp}=getTimestamp($data);
- $len=$len-12;
- $len=$len-8;
- ($obj->{SubPktHeader},$obj->{SlotNo},$obj->{TxfrReason},$obj->{Rate},$tmp,$tmp1,$tmp2,$data)=unpack("V v C C C C v C C a$len",$data);
- $len=$len-12;
- }
Submit a correction or amendment below (click here to make a fresh posting)
After submitting an amendment, you'll be able to view the differences between the old and new posts easily.