Struct canadensis_data_types::uavcan::time::synchronized_timestamp_1_0::SynchronizedTimestamp
source · pub struct SynchronizedTimestamp {
pub microsecond: u64,
}
Expand description
uavcan.time.SynchronizedTimestamp.1.0
Fixed size 7 bytes
Nested data type used for representing a network-wide synchronized timestamp with microsecond resolution. This data type is highly recommended for use both in standard and vendor-specific messages alike.
Fields§
§microsecond: u64
The number of microseconds that have passed since some arbitrary moment in the past. The moment of origin (i.e., the time base) is defined per-application. The current time base in use can be requested from the time synchronization master, see the corresponding service definition.
This value is to never overflow. The value is 56-bit wide because:
-
2^56 microseconds is about 2285 years, which is plenty. A 64-bit microsecond counter would be unnecessarily wide and its overflow interval of 585 thousand years induces a mild existential crisis.
-
Classic-CAN (not FD) transports carry up to 7 bytes of payload per frame. Time sync messages shall use single-frame transfers, which means that the value can’t be wider than 56 bits.
truncated uint56
Always aligned, size 56 bits
Implementations§
Trait Implementations§
source§impl DataType for SynchronizedTimestamp
impl DataType for SynchronizedTimestamp
source§const EXTENT_BYTES: Option<u32> = None
const EXTENT_BYTES: Option<u32> = None
This type is sealed.
source§impl Deserialize for SynchronizedTimestamp
impl Deserialize for SynchronizedTimestamp
source§fn deserialize(cursor: &mut ReadCursor<'_>) -> Result<Self, DeserializeError>where
Self: Sized,
fn deserialize(cursor: &mut ReadCursor<'_>) -> Result<Self, DeserializeError>where Self: Sized,
source§fn deserialize_from_bytes(bytes: &[u8]) -> Result<Self, DeserializeError>where
Self: Sized,
fn deserialize_from_bytes(bytes: &[u8]) -> Result<Self, DeserializeError>where Self: Sized,
deserialize
source§impl Serialize for SynchronizedTimestamp
impl Serialize for SynchronizedTimestamp
source§fn size_bits(&self) -> usize
fn size_bits(&self) -> usize
source§fn serialize(&self, cursor: &mut WriteCursor<'_>)
fn serialize(&self, cursor: &mut WriteCursor<'_>)
source§fn serialize_to_bytes(&self, bytes: &mut [u8])
fn serialize_to_bytes(&self, bytes: &mut [u8])
serialize