Struct spacepackets::PacketId
source · pub struct PacketId {
pub ptype: PacketType,
pub sec_header_flag: bool,
/* private fields */
}Expand description
Abstraction for the CCSDS Packet ID, which forms the last thirteen bits of the first two bytes in the CCSDS primary header.
Fields§
§ptype: PacketType§sec_header_flag: boolImplementations§
source§impl PacketId
impl PacketId
pub const fn const_tc(sec_header: bool, apid: u16) -> Self
pub const fn const_tm(sec_header: bool, apid: u16) -> Self
pub fn tc(sec_header: bool, apid: u16) -> Option<Self>
pub fn tm(sec_header: bool, apid: u16) -> Option<Self>
pub const fn const_new(ptype: PacketType, sec_header: bool, apid: u16) -> Self
pub fn new(
ptype: PacketType,
sec_header_flag: bool,
apid: u16
) -> Option<PacketId>
sourcepub fn set_apid(&mut self, apid: u16) -> bool
pub fn set_apid(&mut self, apid: u16) -> bool
Set a new Application Process ID (APID). If the passed number is invalid, the APID will not be set and false will be returned. The maximum allowed value for the 11-bit field is 2047
pub fn apid(&self) -> u16
pub fn raw(&self) -> u16
Trait Implementations§
source§impl<'de> Deserialize<'de> for PacketId
impl<'de> Deserialize<'de> for PacketId
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more