GithubHelp home page GithubHelp logo

yacd's Introduction

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);

yacd's People

Contributors

architek avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.