add Serialize/Deserialize derives

This commit is contained in:
Robin Müller 2023-01-02 23:32:31 +01:00
parent ec16ee7e6c
commit c03c88a85d
No known key found for this signature in database
GPG Key ID: 71B58F8A3CDFA9AC

View File

@ -79,6 +79,8 @@ use core::marker::PhantomData;
use core::mem::size_of; use core::mem::size_of;
#[cfg(feature = "alloc")] #[cfg(feature = "alloc")]
use delegate::delegate; use delegate::delegate;
#[cfg(feature = "serde")]
use serde::{Deserialize, Serialize};
use spacepackets::ecss::EcssEnumeration; use spacepackets::ecss::EcssEnumeration;
use spacepackets::tc::PusTc; use spacepackets::tc::PusTc;
use spacepackets::tm::{PusTm, PusTmSecondaryHeader}; use spacepackets::tm::{PusTm, PusTmSecondaryHeader};
@ -122,6 +124,7 @@ impl From<Subservices> for u8 {
/// This is a request identifier as specified in 5.4.11.2 c. of the PUS standard /// This is a request identifier as specified in 5.4.11.2 c. of the PUS standard
/// This field equivalent to the first two bytes of the CCSDS space packet header. /// This field equivalent to the first two bytes of the CCSDS space packet header.
#[derive(Debug, Eq, Copy, Clone)] #[derive(Debug, Eq, Copy, Clone)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
pub struct RequestId { pub struct RequestId {
version_number: u8, version_number: u8,
packet_id: PacketId, packet_id: PacketId,