-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
210e849
commit 43cbda0
Showing
4 changed files
with
118 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
//! CCSDS C2 CLI subcommand | ||
//! | ||
//! This subcommand can be used to generate the C2 LDPC code (rate ~7/8) | ||
//! described in the CCSDS TM Synchronization and Channel Coding Blue Book | ||
//! standard. It will print the alist of the parity check matrix to | ||
//! `stdout`. See [`crate::codes::ccsds`] for more information about the CCSDS | ||
//! LDPC codes. | ||
//! | ||
//! # Examples | ||
//! The parity check matrix can be generated with | ||
//! ```shell | ||
//! $ ldpc-toolbox ccsds-c2 | ||
//! ``` | ||
|
||
use crate::cli::*; | ||
use crate::codes::ccsds::C2Code; | ||
use clap::Parser; | ||
|
||
/// CCSDS CLI arguments. | ||
#[derive(Debug, Parser)] | ||
#[command(about = "Generates the alist of CCSDS C2 LDPC")] | ||
pub struct Args {} | ||
|
||
impl Run for Args { | ||
fn run(&self) -> std::result::Result<(), Box<dyn std::error::Error>> { | ||
let h = C2Code::new().h(); | ||
print!("{}", h.alist()); | ||
Ok(()) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters