pub struct GpsTime {
pub year: i16,
pub month: u8,
pub day: u8,
pub hour: u8,
pub minute: u8,
pub second: u8,
pub millisecond: u16,
}Expand description
Represents a GPS Time packet.
This frame is needed for synchronization with a GPS time pulse. The maximum offset of time is +/-10ms.
Fields§
§year: i16§month: u8§day: u8§hour: u8§minute: u8§second: u8§millisecond: u16Implementations§
Trait Implementations§
Source§impl CrsfPacket for GpsTime
impl CrsfPacket for GpsTime
Source§const PACKET_TYPE: PacketType = PacketType::GpsTime
const PACKET_TYPE: PacketType = PacketType::GpsTime
The CRSF frame type identifier for this packet.
Source§const MIN_PAYLOAD_SIZE: usize = 9usize
const MIN_PAYLOAD_SIZE: usize = 9usize
The minimum expected length of the packet’s payload in bytes.
For fixed-size packets, this is the same as the payload size.
fn to_bytes(&self, buffer: &mut [u8]) -> Result<usize, CrsfParsingError>
Source§fn from_bytes(data: &[u8]) -> Result<Self, CrsfParsingError>
fn from_bytes(data: &[u8]) -> Result<Self, CrsfParsingError>
Creates a packet instance from a payload byte slice.
The slice is guaranteed to have a length of at least
MIN_PAYLOAD_SIZE.fn validate_buffer_size(&self, buffer: &[u8]) -> Result<(), CrsfParsingError>
impl StructuralPartialEq for GpsTime
Auto Trait Implementations§
impl Freeze for GpsTime
impl RefUnwindSafe for GpsTime
impl Send for GpsTime
impl Sync for GpsTime
impl Unpin for GpsTime
impl UnwindSafe for GpsTime
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more