MyGit

architek/Yacd

Fork: 0 Star: 4 (更新于 2024-05-30 15:15:10)

license: 暂无

Language: Perl .

Yet Another Ccsds Decoder : Fast TM Frame and Packet decoder in Perl

GitHub网址

Build Status

This library allows decoding of CCSDS frames and packets as defined in the PSS/ECSS standards. As the underlying library (Convert::Binary::C) is written in C, performance is greatly improved compared to Ccsds framework.

On an Intel(R) Core(TM) i3 CPU M 350 @ 2.27GHz, decoding was observed at a speed of 60MB/s.

Easy Install (in Windows, simply do not put sudo)

cpan Module::Install   <------ used by Makefile.PL

perl Makefile.PL

sudo make              <------ the sudo here is required as this will install all dependencies

sudo make install

Example of use:

use Yacd::File::FrameLog qw/frames_loop/;
use Data::Dumper;
use Convert::Binary::C;

#User defined callbacks
sub pkt_tm_decode{
    my ($pkt,$raw,$rec_head)=@_;
    print Dumper($pkt);
}
sub tmfe_decode{
    my ($frame,$raw,$rec_head)=@_;
    print Dumper($frame);
}

#Load Customization of protocol
my $c = eval {
Convert::Binary::C->new(
    IntSize=>4, ShortSize=>2,
    Alignment=>1, CompoundAlignment=>1,
    ByteOrder=>'BigEndian',
    UnsignedChars=>1, UnsignedBitfields=>1,
    #OrderMembers=>1,   # requires Tie::Hash::Indexed (huge performance loss)
    ) ->parse_file('custo.h')
};

if ($@) {
    die "The structure definition was not parsed properly:\n$@";
}

#Prepare config to module. Callbacks are called for each frame or packet found
my $config={
    coderefs_packet=>[ \&main::pkt_tm_decode, ], #callbacks for packets
    coderefs_frame=>[\&main::tmfe_record],       #callbacks for frames
    idle_frames=>1,                              #also pass idle frames to callback
    idle_packets=>1,                             #also pass idle packets to callback
    c=>$c,                                       #protocol definition
    skip=>13000,                                 #skip n frames (until the next packet)
    frame_nr=>20042,                             #decode n frames (until the last packet is finished)
};

#Launch loop on logfile
read_frames($ARGV[0],$config);

最近版本更新:(数据更新于 1970-01-01 00:00:00)

主题(topics):

ccsds

architek/Yacd同语言 Perl最近更新仓库

2024-02-07 01:14:41 major/MySQLTuner-perl

2023-12-18 21:57:03 fxcoudert/gfortran-for-macOS

2022-05-22 17:20:36 holzschu/a-shell

2020-05-29 09:41:32 cowsay-org/cowsay

2019-02-25 00:03:35 jfcoz/postgresqltuner

2018-08-31 09:24:13 alx-tools/Betty