Struct CcsdsParserConfig

Source
pub struct CcsdsParserConfig {
    pub allowed_apids: Option<Vec<u16>>,
    pub max_packet_length: Option<u32>,
    pub min_packet_length: Option<u32>,
    pub secondary_header_required: bool,
    pub sync_bytes: Vec<u8>,
    pub keep_sync: bool,
    pub num_header_bytes: u32,
    pub keep_header: bool,
    pub num_footer_bytes: u32,
    pub keep_footer: bool,
    pub little_endian_header: bool,
}
Expand description

The CcsdsParserConfig struct provides all configuration used by a CcsdsParser. This is broken out into a seprate structure to be read in, serialized, and otherwise manipulated independantly of a particular CcsdsParser.

Fields§

§allowed_apids: Option<Vec<u16>>

The allowed APIDs list is either None, meaning any APID is valid, or a Vec of allowed APIDs. Note that if an APId is not in the allowed APID list, the packet is considered improperly formatted, rather then being a valid packet with an unexpected APID.

§max_packet_length: Option<u32>

The max packet length is either None, meaning any packet length is valid, or a given number of bytes. This applies to the CCSDS packet length. If a packet’s length exceeds this amount, then it is considered improperly formatted.

§min_packet_length: Option<u32>

The min packet length is either None, meaning any packet length is valid, or a given number of bytes. This applies to the CCSDS packet length. If a packet’s length is below this amount, then it is considered improperly formatted.

§secondary_header_required: bool

The secondary header bit may or may not be set in a particular CCSDS packet. For some projects, all packets have a secondary header. In this case, this flag can be set to indicate that a properly formatted packet must have this flag set.

§sync_bytes: Vec<u8>

The sync bytes are a Vec of bytes that must proceed a packet for it to be valid. This is useful when there is a sync marker before each packet.

§keep_sync: bool

The keep sync flag is used to determine if sync bytes are passed along to the called when pull_packet is called, or left behind.

§num_header_bytes: u32

A packet can have a header with a fixed number of bytes. This is usually 0, but in some cases there is a prefix on each packet from another protocol.

§keep_header: bool

The keep header flag is used to determine if sync bytes are passed along to the called when pull_packet is called, or left behind.

§num_footer_bytes: u32

A packet can have a footer with a fixed number of bytes, such as a CRC that is outside of the CCSDS packet and used by another protocol. This is usually 0, but in some cases there is a prefix on each packet from another protocol.

§keep_footer: bool

The keep footer flag is used to determine if sync bytes are passed along to the called when pull_packet is called, or left behind.

§little_endian_header: bool

The CCSDS header is big endian in the standard, but allow little endian headers to be parsed.

Implementations§

Trait Implementations§

Source§

impl Clone for CcsdsParserConfig

Source§

fn clone(&self) -> CcsdsParserConfig

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for CcsdsParserConfig

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl PartialEq for CcsdsParserConfig

Source§

fn eq(&self, other: &CcsdsParserConfig) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl StructuralPartialEq for CcsdsParserConfig

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.