-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
bump deku dependency #14
base: main
Are you sure you want to change the base?
Conversation
Thanks for the contribution! was there a specific change made in deku 0.13 that was needed to support your implementation? or is this just a general update because there's a newer version available? having implementations compatible with both would be great and i'd be interested in learning about whats different between the derive implementations to see if its possible to get both serde/postcard and deku versions in together in a way that doesn't require separately maintaining both of them |
I actually went for a zerocopy/serde implementation now. I can still send you my serde compatible version (has become a bit overengineered though..). I think something was not available in the older version but I would need to recheck. |
Is there another space packet library out there based on zerocopy? sounds like there's also lot of rust serialization/deserialization libraries around as well. If there's a better implementation of CCSDS SpacePacket out there, i'd love to see if there's interest in collaborating since I mostly put this together because i thought i could do better than an existing library that i found via Aerorust. As far as this PR goes, I agree with the formatting changes, the only thing id like to be a little cautious about is making sure the version update is there to solve a particular problem since there's always a risk that it could break something for someones workflow that may not be covered by the tests. Let me know if you're still interested in pursuing this PR or if theres anything i can do to make this (relatively new) library helpful for you! |
Yeah there are also other libraries out there based on /// Generic trait to access fields of a CCSDS space packet header according to CCSDS 133.0-B-2
pub trait CcsdsPrimaryHeader {
const SEQ_FLAG_MASK: u16 = 0xC000;
fn version(&self) -> u8;
fn packet_id(&self) -> PacketId;
fn psc(&self) -> PacketSequenceCtrl;
/// Retrieve data length field
fn data_len(&self) -> u16;
/// Retrieve 13 bit Packet Identification field. Can usually be retrieved with a bitwise AND
/// of the first 2 bytes with 0x1FFF
#[inline]
fn packet_id_raw(&self) -> u16 {
self.packet_id().raw()
}
/// Retrieve Packet Sequence Count
#[inline]
fn psc_raw(&self) -> u16 {
self.psc().raw()
}
#[inline]
/// Retrieve Packet Type (TM: 0, TC: 1)
fn ptype(&self) -> PacketType {
// This call should never fail because only 0 and 1 can be passed to the try_from call
self.packet_id().ptype
}
#[inline]
fn is_tm(&self) -> bool {
self.ptype() == PacketType::Tm
}
#[inline]
fn is_tc(&self) -> bool {
self.ptype() == PacketType::Tc
}
/// Retrieve the secondary header flag. Returns true if a secondary header is present
/// and false if it is not
#[inline]
fn sec_header_flag(&self) -> bool {
self.packet_id().sec_header_flag
}
/// Retrieve Application Process ID
#[inline]
fn apid(&self) -> u16 {
self.packet_id().apid
}
#[inline]
fn ssc(&self) -> u16 {
self.psc().ssc
}
#[inline]
fn sequence_flags(&self) -> SequenceFlags {
// This call should never fail because the mask ensures that only valid values are passed
// into the try_from function
self.psc().seq_flags
}
} Something similar can actually be done for PUS as well. The crate I am currently working on is still WIP and not public yet. I am actually working on a Rust framework supporting small satellite missions. For now, I have decided that My current plan is to put all packet protocols (CCSDS, ECSS PUS, maybe also CFDP and USLP components soon) into a separate package similarly to this Python package: https://pypi.org/project/spacepackets/ . I will check again why exactly version 12.4 did not work for me. Maybe it's also a package management issue. |
oh wow, all of this sounds awesome! If you havent already you should join our discord server as im sure there's others in the community (and similar communities) that would also be interested in this. |
Hi!
I would like to use this dependency when converting my
serde
/postcard
compatible header implementation to this variant for packed serialization. I have some improvementscargo fmt
deku
dependency to0.13
. I also re-tested withcargo test
. I had some issues when converting aserde
compatible header struct to thisdeku
compatible version and then using theto_bytes()
method. Now it seems to workIf you are interested, I can also provide you my
serde
/postcard
compatible implementation of the space packet header, but this would probably require to put the implementation in separateserde
anddeku
submodules because they use differentderive
macros