pub struct Timesync {
pub tc1: i64,
pub ts1: i64,
pub target_system: u8,
pub target_component: u8,
}Expand description
MAVLink TIMESYNC message.
The minimum supported MAVLink version is MAVLink 1.
§Description
Time synchronization message.
The message is used for both timesync requests and
responses.
The request is sent with ts1=syncing component timestamp and tc1=0,
and may be broadcast or targeted to a specific system/component.
The response is
sent with ts1=syncing component timestamp (mirror back unchanged), and tc1=responding component timestamp, with the target_system and target_component set to ids
of the original request.
Systems can determine if they are receiving a request or
response based on the value of tc.
If the response has target_system==target_component==0
the remote system has not been updated to use the component IDs and cannot reliably
timesync; the requestor may report an error.
Timestamps are UNIX Epoch time or time
since system boot in nanoseconds (the timestamp format can be inferred by checking
for the magnitude of the number; generally it doesn’t matter as only the offset
is used).
The message sequence is repeated numerous times with results being filtered/averaged
to estimate the offset.
See also: https://mavlink.io/en/services/timesync.html.
§Encoding/Decoding
Message encoding/decoding are provided by implementing core::convert::TryFrom<Payload> for
Timesync (encoding) and [IntoPayload] (decoding) traits.
These traits are implemented by Message proc macro.
Fields§
§tc1: i64MAVLink field tc1.
Time sync timestamp 1. Syncing: 0. Responding: Timestamp of responding component.
ts1: i64MAVLink field ts1.
Time sync timestamp 2. Timestamp of syncing component (mirrored in response).
target_system: u8MAVLink field target_system.
Target system id. Request: 0 (broadcast) or id of specific system. Response must contain system id of the requesting component.
target_component: u8MAVLink field target_component.
Target component id. Request: 0 (broadcast) or id of specific component. Response must contain component id of the requesting component.
Implementations§
Source§impl Timesync
impl Timesync
Sourcepub const fn spec() -> MessageInfo
pub const fn spec() -> MessageInfo
Returns specification for this message.
Sourcepub const fn message_id() -> u32
pub const fn message_id() -> u32
Message ID.
Sourcepub const fn min_supported_mavlink_version() -> MavLinkVersion
pub const fn min_supported_mavlink_version() -> MavLinkVersion
Minimum supported MAVLink version for this message.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Timesync
impl<'de> Deserialize<'de> for Timesync
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<Timesync, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<Timesync, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Source§impl IntoPayload for Timesync
impl IntoPayload for Timesync
Source§impl MessageSpec for Timesync
impl MessageSpec for Timesync
Source§impl MessageSpecStatic for Timesync
impl MessageSpecStatic for Timesync
Source§fn spec() -> MessageInfo
fn spec() -> MessageInfo
Source§fn message_id() -> u32
fn message_id() -> u32
ID.Source§fn min_supported_mavlink_version() -> MavLinkVersion
fn min_supported_mavlink_version() -> MavLinkVersion
Source§impl NamedType for Timesync
impl NamedType for Timesync
fn sid() -> SpectaID
Source§fn named_data_type(
type_map: &mut TypeCollection,
generics: &[DataType],
) -> NamedDataType
fn named_data_type( type_map: &mut TypeCollection, generics: &[DataType], ) -> NamedDataType
Source§fn definition_named_data_type(type_map: &mut TypeCollection) -> NamedDataType
fn definition_named_data_type(type_map: &mut TypeCollection) -> NamedDataType
Source§impl Serialize for Timesync
impl Serialize for Timesync
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Source§impl Type for Timesync
impl Type for Timesync
Source§fn inline(type_map: &mut TypeCollection, generics: Generics<'_>) -> DataType
fn inline(type_map: &mut TypeCollection, generics: Generics<'_>) -> DataType
Source§fn reference(type_map: &mut TypeCollection, generics: &[DataType]) -> Reference
fn reference(type_map: &mut TypeCollection, generics: &[DataType]) -> Reference
definition will be put into the type map.