add useful functions
This commit is contained in:
14
src/lib.rs
14
src/lib.rs
@@ -1011,6 +1011,20 @@ impl CcsdsPacketId {
|
|||||||
psc: packet.psc(),
|
psc: packet.psc(),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub const fn raw(&self) -> u32 {
|
||||||
|
((self.packet_id.raw() as u32) << 16) | self.psc.raw() as u32
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
impl From<SpacePacketHeader> for CcsdsPacketId {
|
||||||
|
#[inline]
|
||||||
|
fn from(header: SpacePacketHeader) -> Self {
|
||||||
|
Self {
|
||||||
|
packet_id: header.packet_id,
|
||||||
|
psc: header.psc,
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// CCSDS packet creator with optional support for a CRC16 CCITT checksum appended to the
|
/// CCSDS packet creator with optional support for a CRC16 CCITT checksum appended to the
|
||||||
|
|||||||
Reference in New Issue
Block a user