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: boolThe 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: boolThe 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: u32A 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: boolThe keep header flag is used to determine if sync bytes are passed along to the called when pull_packet is called, or left behind.
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.
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: boolThe CCSDS header is big endian in the standard, but allow little endian headers to be parsed.
Implementations§
Source§impl CcsdsParserConfig
impl CcsdsParserConfig
pub fn new() -> CcsdsParserConfig
Trait Implementations§
Source§impl Clone for CcsdsParserConfig
impl Clone for CcsdsParserConfig
Source§fn clone(&self) -> CcsdsParserConfig
fn clone(&self) -> CcsdsParserConfig
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more