use super::lib::*;
#[cfg_attr(feature = "serde", derive(serde::Serialize))]
#[derive(Debug, Clone)]
pub struct EstimatedHorizontalErrorEllipse {
#[cfg_attr(feature = "serde", serde(rename(serialize = "semi_major")))]
pub semi_major: f32,
#[cfg_attr(feature = "serde", serde(rename(serialize = "semi_minor")))]
pub semi_minor: f32,
#[cfg_attr(feature = "serde", serde(rename(serialize = "orientation")))]
pub orientation: f32,
}
impl WireFormat for EstimatedHorizontalErrorEllipse {
const MIN_LEN: usize =
<f32 as WireFormat>::MIN_LEN + <f32 as WireFormat>::MIN_LEN + <f32 as WireFormat>::MIN_LEN;
fn len(&self) -> usize {
WireFormat::len(&self.semi_major)
+ WireFormat::len(&self.semi_minor)
+ WireFormat::len(&self.orientation)
}
fn write<B: BufMut>(&self, buf: &mut B) {
WireFormat::write(&self.semi_major, buf);
WireFormat::write(&self.semi_minor, buf);
WireFormat::write(&self.orientation, buf);
}
fn parse_unchecked<B: Buf>(buf: &mut B) -> Self {
EstimatedHorizontalErrorEllipse {
semi_major: WireFormat::parse_unchecked(buf),
semi_minor: WireFormat::parse_unchecked(buf),
orientation: WireFormat::parse_unchecked(buf),
}
}
}
#[cfg_attr(feature = "serde", derive(serde::Serialize))]
#[derive(Debug, Clone)]
pub struct MsgAgeCorrections {
#[cfg_attr(feature = "serde", serde(skip_serializing))]
pub sender_id: Option<u16>,
#[cfg_attr(feature = "serde", serde(rename(serialize = "tow")))]
pub tow: u32,
#[cfg_attr(feature = "serde", serde(rename(serialize = "age")))]
pub age: u16,
}
impl ConcreteMessage for MsgAgeCorrections {
const MESSAGE_TYPE: u16 = 528;
const MESSAGE_NAME: &'static str = "MSG_AGE_CORRECTIONS";
}
impl SbpMessage for MsgAgeCorrections {
fn message_name(&self) -> &'static str {
<Self as ConcreteMessage>::MESSAGE_NAME
}
fn message_type(&self) -> u16 {
<Self as ConcreteMessage>::MESSAGE_TYPE
}
fn sender_id(&self) -> Option<u16> {
self.sender_id
}
fn set_sender_id(&mut self, new_id: u16) {
self.sender_id = Some(new_id);
}
fn encoded_len(&self) -> usize {
WireFormat::len(self) + crate::HEADER_LEN + crate::CRC_LEN
}
#[cfg(feature = "swiftnav")]
fn gps_time(&self) -> Option<std::result::Result<time::MessageTime, time::GpsTimeError>> {
let tow_s = (self.tow as f64) / 1000.0;
let gps_time = match time::GpsTime::new(0, tow_s) {
Ok(gps_time) => gps_time.tow(),
Err(e) => return Some(Err(e.into())),
};
Some(Ok(time::MessageTime::Rover(gps_time.into())))
}
}
impl TryFrom<Sbp> for MsgAgeCorrections {
type Error = TryFromSbpError;
fn try_from(msg: Sbp) -> Result<Self, Self::Error> {
match msg {
Sbp::MsgAgeCorrections(m) => Ok(m),
_ => Err(TryFromSbpError),
}
}
}
impl WireFormat for MsgAgeCorrections {
const MIN_LEN: usize = <u32 as WireFormat>::MIN_LEN + <u16 as WireFormat>::MIN_LEN;
fn len(&self) -> usize {
WireFormat::len(&self.tow) + WireFormat::len(&self.age)
}
fn write<B: BufMut>(&self, buf: &mut B) {
WireFormat::write(&self.tow, buf);
WireFormat::write(&self.age, buf);
}
fn parse_unchecked<B: Buf>(buf: &mut B) -> Self {
MsgAgeCorrections {
sender_id: None,
tow: WireFormat::parse_unchecked(buf),
age: WireFormat::parse_unchecked(buf),
}
}
}
#[cfg_attr(feature = "serde", derive(serde::Serialize))]
#[derive(Debug, Clone)]
pub struct MsgBaselineEcef {
#[cfg_attr(feature = "serde", serde(skip_serializing))]
pub sender_id: Option<u16>,
#[cfg_attr(feature = "serde", serde(rename(serialize = "tow")))]
pub tow: u32,
#[cfg_attr(feature = "serde", serde(rename(serialize = "x")))]
pub x: i32,
#[cfg_attr(feature = "serde", serde(rename(serialize = "y")))]
pub y: i32,
#[cfg_attr(feature = "serde", serde(rename(serialize = "z")))]
pub z: i32,
#[cfg_attr(feature = "serde", serde(rename(serialize = "accuracy")))]
pub accuracy: u16,
#[cfg_attr(feature = "serde", serde(rename(serialize = "n_sats")))]
pub n_sats: u8,
#[cfg_attr(feature = "serde", serde(rename(serialize = "flags")))]
pub flags: u8,
}
impl ConcreteMessage for MsgBaselineEcef {
const MESSAGE_TYPE: u16 = 523;
const MESSAGE_NAME: &'static str = "MSG_BASELINE_ECEF";
}
impl SbpMessage for MsgBaselineEcef {
fn message_name(&self) -> &'static str {
<Self as ConcreteMessage>::MESSAGE_NAME
}
fn message_type(&self) -> u16 {
<Self as ConcreteMessage>::MESSAGE_TYPE
}
fn sender_id(&self) -> Option<u16> {
self.sender_id
}
fn set_sender_id(&mut self, new_id: u16) {
self.sender_id = Some(new_id);
}
fn encoded_len(&self) -> usize {
WireFormat::len(self) + crate::HEADER_LEN + crate::CRC_LEN
}
#[cfg(feature = "swiftnav")]
fn gps_time(&self) -> Option<std::result::Result<time::MessageTime, time::GpsTimeError>> {
let tow_s = (self.tow as f64) / 1000.0;
let gps_time = match time::GpsTime::new(0, tow_s) {
Ok(gps_time) => gps_time.tow(),
Err(e) => return Some(Err(e.into())),
};
Some(Ok(time::MessageTime::Rover(gps_time.into())))
}
}
impl TryFrom<Sbp> for MsgBaselineEcef {
type Error = TryFromSbpError;
fn try_from(msg: Sbp) -> Result<Self, Self::Error> {
match msg {
Sbp::MsgBaselineEcef(m) => Ok(m),
_ => Err(TryFromSbpError),
}
}
}
impl WireFormat for MsgBaselineEcef {
const MIN_LEN: usize = <u32 as WireFormat>::MIN_LEN
+ <i32 as WireFormat>::MIN_LEN
+ <i32 as WireFormat>::MIN_LEN
+ <i32 as WireFormat>::MIN_LEN
+ <u16 as WireFormat>::MIN_LEN
+ <u8 as WireFormat>::MIN_LEN
+ <u8 as WireFormat>::MIN_LEN;
fn len(&self) -> usize {
WireFormat::len(&self.tow)
+ WireFormat::len(&self.x)
+ WireFormat::len(&self.y)
+ WireFormat::len(&self.z)
+ WireFormat::len(&self.accuracy)
+ WireFormat::len(&self.n_sats)
+ WireFormat::len(&self.flags)
}
fn write<B: BufMut>(&self, buf: &mut B) {
WireFormat::write(&self.tow, buf);
WireFormat::write(&self.x, buf);
WireFormat::write(&self.y, buf);
WireFormat::write(&self.z, buf);
WireFormat::write(&self.accuracy, buf);
WireFormat::write(&self.n_sats, buf);
WireFormat::write(&self.flags, buf);
}
fn parse_unchecked<B: Buf>(buf: &mut B) -> Self {
MsgBaselineEcef {
sender_id: None,
tow: WireFormat::parse_unchecked(buf),
x: WireFormat::parse_unchecked(buf),
y: WireFormat::parse_unchecked(buf),
z: WireFormat::parse_unchecked(buf),
accuracy: WireFormat::parse_unchecked(buf),
n_sats: WireFormat::parse_unchecked(buf),
flags: WireFormat::parse_unchecked(buf),
}
}
}
#[cfg_attr(feature = "serde", derive(serde::Serialize))]
#[derive(Debug, Clone)]
pub struct MsgBaselineEcefDepA {
#[cfg_attr(feature = "serde", serde(skip_serializing))]
pub sender_id: Option<u16>,
#[cfg_attr(feature = "serde", serde(rename(serialize = "tow")))]
pub tow: u32,
#[cfg_attr(feature = "serde", serde(rename(serialize = "x")))]
pub x: i32,
#[cfg_attr(feature = "serde", serde(rename(serialize = "y")))]
pub y: i32,
#[cfg_attr(feature = "serde", serde(rename(serialize = "z")))]
pub z: i32,
#[cfg_attr(feature = "serde", serde(rename(serialize = "accuracy")))]
pub accuracy: u16,
#[cfg_attr(feature = "serde", serde(rename(serialize = "n_sats")))]
pub n_sats: u8,
#[cfg_attr(feature = "serde", serde(rename(serialize = "flags")))]
pub flags: u8,
}
impl ConcreteMessage for MsgBaselineEcefDepA {
const MESSAGE_TYPE: u16 = 514;
const MESSAGE_NAME: &'static str = "MSG_BASELINE_ECEF_DEP_A";
}
impl SbpMessage for MsgBaselineEcefDepA {
fn message_name(&self) -> &'static str {
<Self as ConcreteMessage>::MESSAGE_NAME
}
fn message_type(&self) -> u16 {
<Self as ConcreteMessage>::MESSAGE_TYPE
}
fn sender_id(&self) -> Option<u16> {
self.sender_id
}
fn set_sender_id(&mut self, new_id: u16) {
self.sender_id = Some(new_id);
}
fn encoded_len(&self) -> usize {
WireFormat::len(self) + crate::HEADER_LEN + crate::CRC_LEN
}
#[cfg(feature = "swiftnav")]
fn gps_time(&self) -> Option<std::result::Result<time::MessageTime, time::GpsTimeError>> {
let tow_s = (self.tow as f64) / 1000.0;
let gps_time = match time::GpsTime::new(0, tow_s) {
Ok(gps_time) => gps_time.tow(),
Err(e) => return Some(Err(e.into())),
};
Some(Ok(time::MessageTime::Rover(gps_time.into())))
}
}
impl TryFrom<Sbp> for MsgBaselineEcefDepA {
type Error = TryFromSbpError;
fn try_from(msg: Sbp) -> Result<Self, Self::Error> {
match msg {
Sbp::MsgBaselineEcefDepA(m) => Ok(m),
_ => Err(TryFromSbpError),
}
}
}
impl WireFormat for MsgBaselineEcefDepA {
const MIN_LEN: usize = <u32 as WireFormat>::MIN_LEN
+ <i32 as WireFormat>::MIN_LEN
+ <i32 as WireFormat>::MIN_LEN
+ <i32 as WireFormat>::MIN_LEN
+ <u16 as WireFormat>::MIN_LEN
+ <u8 as WireFormat>::MIN_LEN
+ <u8 as WireFormat>::MIN_LEN;
fn len(&self) -> usize {
WireFormat::len(&self.tow)
+ WireFormat::len(&self.x)
+ WireFormat::len(&self.y)
+ WireFormat::len(&self.z)
+ WireFormat::len(&self.accuracy)
+ WireFormat::len(&self.n_sats)
+ WireFormat::len(&self.flags)
}
fn write<B: BufMut>(&self, buf: &mut B) {
WireFormat::write(&self.tow, buf);
WireFormat::write(&self.x, buf);
WireFormat::write(&self.y, buf);
WireFormat::write(&self.z, buf);
WireFormat::write(&self.accuracy, buf);
WireFormat::write(&self.n_sats, buf);
WireFormat::write(&self.flags, buf);
}
fn parse_unchecked<B: Buf>(buf: &mut B) -> Self {
MsgBaselineEcefDepA {
sender_id: None,
tow: WireFormat::parse_unchecked(buf),
x: WireFormat::parse_unchecked(buf),
y: WireFormat::parse_unchecked(buf),
z: WireFormat::parse_unchecked(buf),
accuracy: WireFormat::parse_unchecked(buf),
n_sats: WireFormat::parse_unchecked(buf),
flags: WireFormat::parse_unchecked(buf),
}
}
}
#[cfg_attr(feature = "serde", derive(serde::Serialize))]
#[derive(Debug, Clone)]
pub struct MsgBaselineHeadingDepA {
#[cfg_attr(feature = "serde", serde(skip_serializing))]
pub sender_id: Option<u16>,
#[cfg_attr(feature = "serde", serde(rename(serialize = "tow")))]
pub tow: u32,
#[cfg_attr(feature = "serde", serde(rename(serialize = "heading")))]
pub heading: u32,
#[cfg_attr(feature = "serde", serde(rename(serialize = "n_sats")))]
pub n_sats: u8,
#[cfg_attr(feature = "serde", serde(rename(serialize = "flags")))]
pub flags: u8,
}
impl ConcreteMessage for MsgBaselineHeadingDepA {
const MESSAGE_TYPE: u16 = 519;
const MESSAGE_NAME: &'static str = "MSG_BASELINE_HEADING_DEP_A";
}
impl SbpMessage for MsgBaselineHeadingDepA {
fn message_name(&self) -> &'static str {
<Self as ConcreteMessage>::MESSAGE_NAME
}
fn message_type(&self) -> u16 {
<Self as ConcreteMessage>::MESSAGE_TYPE
}
fn sender_id(&self) -> Option<u16> {
self.sender_id
}
fn set_sender_id(&mut self, new_id: u16) {
self.sender_id = Some(new_id);
}
fn encoded_len(&self) -> usize {
WireFormat::len(self) + crate::HEADER_LEN + crate::CRC_LEN
}
#[cfg(feature = "swiftnav")]
fn gps_time(&self) -> Option<std::result::Result<time::MessageTime, time::GpsTimeError>> {
let tow_s = (self.tow as f64) / 1000.0;
let gps_time = match time::GpsTime::new(0, tow_s) {
Ok(gps_time) => gps_time.tow(),
Err(e) => return Some(Err(e.into())),
};
Some(Ok(time::MessageTime::Rover(gps_time.into())))
}
}
impl TryFrom<Sbp> for MsgBaselineHeadingDepA {
type Error = TryFromSbpError;
fn try_from(msg: Sbp) -> Result<Self, Self::Error> {
match msg {
Sbp::MsgBaselineHeadingDepA(m) => Ok(m),
_ => Err(TryFromSbpError),
}
}
}
impl WireFormat for MsgBaselineHeadingDepA {
const MIN_LEN: usize = <u32 as WireFormat>::MIN_LEN
+ <u32 as WireFormat>::MIN_LEN
+ <u8 as WireFormat>::MIN_LEN
+ <u8 as WireFormat>::MIN_LEN;
fn len(&self) -> usize {
WireFormat::len(&self.tow)
+ WireFormat::len(&self.heading)
+ WireFormat::len(&self.n_sats)
+ WireFormat::len(&self.flags)
}
fn write<B: BufMut>(&self, buf: &mut B) {
WireFormat::write(&self.tow, buf);
WireFormat::write(&self.heading, buf);
WireFormat::write(&self.n_sats, buf);
WireFormat::write(&self.flags, buf);
}
fn parse_unchecked<B: Buf>(buf: &mut B) -> Self {
MsgBaselineHeadingDepA {
sender_id: None,
tow: WireFormat::parse_unchecked(buf),
heading: WireFormat::parse_unchecked(buf),
n_sats: WireFormat::parse_unchecked(buf),
flags: WireFormat::parse_unchecked(buf),
}
}
}
#[cfg_attr(feature = "serde", derive(serde::Serialize))]
#[derive(Debug, Clone)]
pub struct MsgBaselineNed {
#[cfg_attr(feature = "serde", serde(skip_serializing))]
pub sender_id: Option<u16>,
#[cfg_attr(feature = "serde", serde(rename(serialize = "tow")))]
pub tow: u32,
#[cfg_attr(feature = "serde", serde(rename(serialize = "n")))]
pub n: i32,
#[cfg_attr(feature = "serde", serde(rename(serialize = "e")))]
pub e: i32,
#[cfg_attr(feature = "serde", serde(rename(serialize = "d")))]
pub d: i32,
#[cfg_attr(feature = "serde", serde(rename(serialize = "h_accuracy")))]
pub h_accuracy: u16,
#[cfg_attr(feature = "serde", serde(rename(serialize = "v_accuracy")))]
pub v_accuracy: u16,
#[cfg_attr(feature = "serde", serde(rename(serialize = "n_sats")))]
pub n_sats: u8,
#[cfg_attr(feature = "serde", serde(rename(serialize = "flags")))]
pub flags: u8,
}
impl ConcreteMessage for MsgBaselineNed {
const MESSAGE_TYPE: u16 = 524;
const MESSAGE_NAME: &'static str = "MSG_BASELINE_NED";
}
impl SbpMessage for MsgBaselineNed {
fn message_name(&self) -> &'static str {
<Self as ConcreteMessage>::MESSAGE_NAME
}
fn message_type(&self) -> u16 {
<Self as ConcreteMessage>::MESSAGE_TYPE
}
fn sender_id(&self) -> Option<u16> {
self.sender_id
}
fn set_sender_id(&mut self, new_id: u16) {
self.sender_id = Some(new_id);
}
fn encoded_len(&self) -> usize {
WireFormat::len(self) + crate::HEADER_LEN + crate::CRC_LEN
}
#[cfg(feature = "swiftnav")]
fn gps_time(&self) -> Option<std::result::Result<time::MessageTime, time::GpsTimeError>> {
let tow_s = (self.tow as f64) / 1000.0;
let gps_time = match time::GpsTime::new(0, tow_s) {
Ok(gps_time) => gps_time.tow(),
Err(e) => return Some(Err(e.into())),
};
Some(Ok(time::MessageTime::Rover(gps_time.into())))
}
}
impl TryFrom<Sbp> for MsgBaselineNed {
type Error = TryFromSbpError;
fn try_from(msg: Sbp) -> Result<Self, Self::Error> {
match msg {
Sbp::MsgBaselineNed(m) => Ok(m),
_ => Err(TryFromSbpError),
}
}
}
impl WireFormat for MsgBaselineNed {
const MIN_LEN: usize = <u32 as WireFormat>::MIN_LEN
+ <i32 as WireFormat>::MIN_LEN
+ <i32 as WireFormat>::MIN_LEN
+ <i32 as WireFormat>::MIN_LEN
+ <u16 as WireFormat>::MIN_LEN
+ <u16 as WireFormat>::MIN_LEN
+ <u8 as WireFormat>::MIN_LEN
+ <u8 as WireFormat>::MIN_LEN;
fn len(&self) -> usize {
WireFormat::len(&self.tow)
+ WireFormat::len(&self.n)
+ WireFormat::len(&self.e)
+ WireFormat::len(&self.d)
+ WireFormat::len(&self.h_accuracy)
+ WireFormat::len(&self.v_accuracy)
+ WireFormat::len(&self.n_sats)
+ WireFormat::len(&self.flags)
}
fn write<B: BufMut>(&self, buf: &mut B) {
WireFormat::write(&self.tow, buf);
WireFormat::write(&self.n, buf);
WireFormat::write(&self.e, buf);
WireFormat::write(&self.d, buf);
WireFormat::write(&self.h_accuracy, buf);
WireFormat::write(&self.v_accuracy, buf);
WireFormat::write(&self.n_sats, buf);
WireFormat::write(&self.flags, buf);
}
fn parse_unchecked<B: Buf>(buf: &mut B) -> Self {
MsgBaselineNed {
sender_id: None,
tow: WireFormat::parse_unchecked(buf),
n: WireFormat::parse_unchecked(buf),
e: WireFormat::parse_unchecked(buf),
d: WireFormat::parse_unchecked(buf),
h_accuracy: WireFormat::parse_unchecked(buf),
v_accuracy: WireFormat::parse_unchecked(buf),
n_sats: WireFormat::parse_unchecked(buf),
flags: WireFormat::parse_unchecked(buf),
}
}
}
#[cfg_attr(feature = "serde", derive(serde::Serialize))]
#[derive(Debug, Clone)]
pub struct MsgBaselineNedDepA {
#[cfg_attr(feature = "serde", serde(skip_serializing))]
pub sender_id: Option<u16>,
#[cfg_attr(feature = "serde", serde(rename(serialize = "tow")))]
pub tow: u32,
#[cfg_attr(feature = "serde", serde(rename(serialize = "n")))]
pub n: i32,
#[cfg_attr(feature = "serde", serde(rename(serialize = "e")))]
pub e: i32,
#[cfg_attr(feature = "serde", serde(rename(serialize = "d")))]
pub d: i32,
#[cfg_attr(feature = "serde", serde(rename(serialize = "h_accuracy")))]
pub h_accuracy: u16,
#[cfg_attr(feature = "serde", serde(rename(serialize = "v_accuracy")))]
pub v_accuracy: u16,
#[cfg_attr(feature = "serde", serde(rename(serialize = "n_sats")))]
pub n_sats: u8,
#[cfg_attr(feature = "serde", serde(rename(serialize = "flags")))]
pub flags: u8,
}
impl ConcreteMessage for MsgBaselineNedDepA {
const MESSAGE_TYPE: u16 = 515;
const MESSAGE_NAME: &'static str = "MSG_BASELINE_NED_DEP_A";
}
impl SbpMessage for MsgBaselineNedDepA {
fn message_name(&self) -> &'static str {
<Self as ConcreteMessage>::MESSAGE_NAME
}
fn message_type(&self) -> u16 {
<Self as ConcreteMessage>::MESSAGE_TYPE
}
fn sender_id(&self) -> Option<u16> {
self.sender_id
}
fn set_sender_id(&mut self, new_id: u16) {
self.sender_id = Some(new_id);
}
fn encoded_len(&self) -> usize {
WireFormat::len(self) + crate::HEADER_LEN + crate::CRC_LEN
}
#[cfg(feature = "swiftnav")]
fn gps_time(&self) -> Option<std::result::Result<time::MessageTime, time::GpsTimeError>> {
let tow_s = (self.tow as f64) / 1000.0;
let gps_time = match time::GpsTime::new(0, tow_s) {
Ok(gps_time) => gps_time.tow(),
Err(e) => return Some(Err(e.into())),
};
Some(Ok(time::MessageTime::Rover(gps_time.into())))
}
}
impl TryFrom<Sbp> for MsgBaselineNedDepA {
type Error = TryFromSbpError;
fn try_from(msg: Sbp) -> Result<Self, Self::Error> {
match msg {
Sbp::MsgBaselineNedDepA(m) => Ok(m),
_ => Err(TryFromSbpError),
}
}
}
impl WireFormat for MsgBaselineNedDepA {
const MIN_LEN: usize = <u32 as WireFormat>::MIN_LEN
+ <i32 as WireFormat>::MIN_LEN
+ <i32 as WireFormat>::MIN_LEN
+ <i32 as WireFormat>::MIN_LEN
+ <u16 as WireFormat>::MIN_LEN
+ <u16 as WireFormat>::MIN_LEN
+ <u8 as WireFormat>::MIN_LEN
+ <u8 as WireFormat>::MIN_LEN;
fn len(&self) -> usize {
WireFormat::len(&self.tow)
+ WireFormat::len(&self.n)
+ WireFormat::len(&self.e)
+ WireFormat::len(&self.d)
+ WireFormat::len(&self.h_accuracy)
+ WireFormat::len(&self.v_accuracy)
+ WireFormat::len(&self.n_sats)
+ WireFormat::len(&self.flags)
}
fn write<B: BufMut>(&self, buf: &mut B) {
WireFormat::write(&self.tow, buf);
WireFormat::write(&self.n, buf);
WireFormat::write(&self.e, buf);
WireFormat::write(&self.d, buf);
WireFormat::write(&self.h_accuracy, buf);
WireFormat::write(&self.v_accuracy, buf);
WireFormat::write(&self.n_sats, buf);
WireFormat::write(&self.flags, buf);
}
fn parse_unchecked<B: Buf>(buf: &mut B) -> Self {
MsgBaselineNedDepA {
sender_id: None,
tow: WireFormat::parse_unchecked(buf),
n: WireFormat::parse_unchecked(buf),
e: WireFormat::parse_unchecked(buf),
d: WireFormat::parse_unchecked(buf),
h_accuracy: WireFormat::parse_unchecked(buf),
v_accuracy: WireFormat::parse_unchecked(buf),
n_sats: WireFormat::parse_unchecked(buf),
flags: WireFormat::parse_unchecked(buf),
}
}
}
#[cfg_attr(feature = "serde", derive(serde::Serialize))]
#[derive(Debug, Clone)]
pub struct MsgDops {
#[cfg_attr(feature = "serde", serde(skip_serializing))]
pub sender_id: Option<u16>,
#[cfg_attr(feature = "serde", serde(rename(serialize = "tow")))]
pub tow: u32,
#[cfg_attr(feature = "serde", serde(rename(serialize = "gdop")))]
pub gdop: u16,
#[cfg_attr(feature = "serde", serde(rename(serialize = "pdop")))]
pub pdop: u16,
#[cfg_attr(feature = "serde", serde(rename(serialize = "tdop")))]
pub tdop: u16,
#[cfg_attr(feature = "serde", serde(rename(serialize = "hdop")))]
pub hdop: u16,
#[cfg_attr(feature = "serde", serde(rename(serialize = "vdop")))]
pub vdop: u16,
#[cfg_attr(feature = "serde", serde(rename(serialize = "flags")))]
pub flags: u8,
}
impl ConcreteMessage for MsgDops {
const MESSAGE_TYPE: u16 = 520;
const MESSAGE_NAME: &'static str = "MSG_DOPS";
}
impl SbpMessage for MsgDops {
fn message_name(&self) -> &'static str {
<Self as ConcreteMessage>::MESSAGE_NAME
}
fn message_type(&self) -> u16 {
<Self as ConcreteMessage>::MESSAGE_TYPE
}
fn sender_id(&self) -> Option<u16> {
self.sender_id
}
fn set_sender_id(&mut self, new_id: u16) {
self.sender_id = Some(new_id);
}
fn encoded_len(&self) -> usize {
WireFormat::len(self) + crate::HEADER_LEN + crate::CRC_LEN
}
#[cfg(feature = "swiftnav")]
fn gps_time(&self) -> Option<std::result::Result<time::MessageTime, time::GpsTimeError>> {
let tow_s = (self.tow as f64) / 1000.0;
let gps_time = match time::GpsTime::new(0, tow_s) {
Ok(gps_time) => gps_time.tow(),
Err(e) => return Some(Err(e.into())),
};
Some(Ok(time::MessageTime::Rover(gps_time.into())))
}
}
impl TryFrom<Sbp> for MsgDops {
type Error = TryFromSbpError;
fn try_from(msg: Sbp) -> Result<Self, Self::Error> {
match msg {
Sbp::MsgDops(m) => Ok(m),
_ => Err(TryFromSbpError),
}
}
}
impl WireFormat for MsgDops {
const MIN_LEN: usize = <u32 as WireFormat>::MIN_LEN
+ <u16 as WireFormat>::MIN_LEN
+ <u16 as WireFormat>::MIN_LEN
+ <u16 as WireFormat>::MIN_LEN
+ <u16 as WireFormat>::MIN_LEN
+ <u16 as WireFormat>::MIN_LEN
+ <u8 as WireFormat>::MIN_LEN;
fn len(&self) -> usize {
WireFormat::len(&self.tow)
+ WireFormat::len(&self.gdop)
+ WireFormat::len(&self.pdop)
+ WireFormat::len(&self.tdop)
+ WireFormat::len(&self.hdop)
+ WireFormat::len(&self.vdop)
+ WireFormat::len(&self.flags)
}
fn write<B: BufMut>(&self, buf: &mut B) {
WireFormat::write(&self.tow, buf);
WireFormat::write(&self.gdop, buf);
WireFormat::write(&self.pdop, buf);
WireFormat::write(&self.tdop, buf);
WireFormat::write(&self.hdop, buf);
WireFormat::write(&self.vdop, buf);
WireFormat::write(&self.flags, buf);
}
fn parse_unchecked<B: Buf>(buf: &mut B) -> Self {
MsgDops {
sender_id: None,
tow: WireFormat::parse_unchecked(buf),
gdop: WireFormat::parse_unchecked(buf),
pdop: WireFormat::parse_unchecked(buf),
tdop: WireFormat::parse_unchecked(buf),
hdop: WireFormat::parse_unchecked(buf),
vdop: WireFormat::parse_unchecked(buf),
flags: WireFormat::parse_unchecked(buf),
}
}
}
#[cfg_attr(feature = "serde", derive(serde::Serialize))]
#[derive(Debug, Clone)]
pub struct MsgDopsDepA {
#[cfg_attr(feature = "serde", serde(skip_serializing))]
pub sender_id: Option<u16>,
#[cfg_attr(feature = "serde", serde(rename(serialize = "tow")))]
pub tow: u32,
#[cfg_attr(feature = "serde", serde(rename(serialize = "gdop")))]
pub gdop: u16,
#[cfg_attr(feature = "serde", serde(rename(serialize = "pdop")))]
pub pdop: u16,
#[cfg_attr(feature = "serde", serde(rename(serialize = "tdop")))]
pub tdop: u16,
#[cfg_attr(feature = "serde", serde(rename(serialize = "hdop")))]
pub hdop: u16,
#[cfg_attr(feature = "serde", serde(rename(serialize = "vdop")))]
pub vdop: u16,
}
impl ConcreteMessage for MsgDopsDepA {
const MESSAGE_TYPE: u16 = 518;
const MESSAGE_NAME: &'static str = "MSG_DOPS_DEP_A";
}
impl SbpMessage for MsgDopsDepA {
fn message_name(&self) -> &'static str {
<Self as ConcreteMessage>::MESSAGE_NAME
}
fn message_type(&self) -> u16 {
<Self as ConcreteMessage>::MESSAGE_TYPE
}
fn sender_id(&self) -> Option<u16> {
self.sender_id
}
fn set_sender_id(&mut self, new_id: u16) {
self.sender_id = Some(new_id);
}
fn encoded_len(&self) -> usize {
WireFormat::len(self) + crate::HEADER_LEN + crate::CRC_LEN
}
#[cfg(feature = "swiftnav")]
fn gps_time(&self) -> Option<std::result::Result<time::MessageTime, time::GpsTimeError>> {
let tow_s = (self.tow as f64) / 1000.0;
let gps_time = match time::GpsTime::new(0, tow_s) {
Ok(gps_time) => gps_time.tow(),
Err(e) => return Some(Err(e.into())),
};
Some(Ok(time::MessageTime::Rover(gps_time.into())))
}
}
impl TryFrom<Sbp> for MsgDopsDepA {
type Error = TryFromSbpError;
fn try_from(msg: Sbp) -> Result<Self, Self::Error> {
match msg {
Sbp::MsgDopsDepA(m) => Ok(m),
_ => Err(TryFromSbpError),
}
}
}
impl WireFormat for MsgDopsDepA {
const MIN_LEN: usize = <u32 as WireFormat>::MIN_LEN
+ <u16 as WireFormat>::MIN_LEN
+ <u16 as WireFormat>::MIN_LEN
+ <u16 as WireFormat>::MIN_LEN
+ <u16 as WireFormat>::MIN_LEN
+ <u16 as WireFormat>::MIN_LEN;
fn len(&self) -> usize {
WireFormat::len(&self.tow)
+ WireFormat::len(&self.gdop)
+ WireFormat::len(&self.pdop)
+ WireFormat::len(&self.tdop)
+ WireFormat::len(&self.hdop)
+ WireFormat::len(&self.vdop)
}
fn write<B: BufMut>(&self, buf: &mut B) {
WireFormat::write(&self.tow, buf);
WireFormat::write(&self.gdop, buf);
WireFormat::write(&self.pdop, buf);
WireFormat::write(&self.tdop, buf);
WireFormat::write(&self.hdop, buf);
WireFormat::write(&self.vdop, buf);
}
fn parse_unchecked<B: Buf>(buf: &mut B) -> Self {
MsgDopsDepA {
sender_id: None,
tow: WireFormat::parse_unchecked(buf),
gdop: WireFormat::parse_unchecked(buf),
pdop: WireFormat::parse_unchecked(buf),
tdop: WireFormat::parse_unchecked(buf),
hdop: WireFormat::parse_unchecked(buf),
vdop: WireFormat::parse_unchecked(buf),
}
}
}
#[cfg_attr(feature = "serde", derive(serde::Serialize))]
#[derive(Debug, Clone)]
pub struct MsgGpsTime {
#[cfg_attr(feature = "serde", serde(skip_serializing))]
pub sender_id: Option<u16>,
#[cfg_attr(feature = "serde", serde(rename(serialize = "wn")))]
pub wn: u16,
#[cfg_attr(feature = "serde", serde(rename(serialize = "tow")))]
pub tow: u32,
#[cfg_attr(feature = "serde", serde(rename(serialize = "ns_residual")))]
pub ns_residual: i32,
#[cfg_attr(feature = "serde", serde(rename(serialize = "flags")))]
pub flags: u8,
}
impl ConcreteMessage for MsgGpsTime {
const MESSAGE_TYPE: u16 = 258;
const MESSAGE_NAME: &'static str = "MSG_GPS_TIME";
}
impl SbpMessage for MsgGpsTime {
fn message_name(&self) -> &'static str {
<Self as ConcreteMessage>::MESSAGE_NAME
}
fn message_type(&self) -> u16 {
<Self as ConcreteMessage>::MESSAGE_TYPE
}
fn sender_id(&self) -> Option<u16> {
self.sender_id
}
fn set_sender_id(&mut self, new_id: u16) {
self.sender_id = Some(new_id);
}
fn encoded_len(&self) -> usize {
WireFormat::len(self) + crate::HEADER_LEN + crate::CRC_LEN
}
#[cfg(feature = "swiftnav")]
fn gps_time(&self) -> Option<std::result::Result<time::MessageTime, time::GpsTimeError>> {
let tow_s = (self.tow as f64) / 1000.0;
#[allow(clippy::useless_conversion)]
let wn: i16 = match self.wn.try_into() {
Ok(wn) => wn,
Err(e) => return Some(Err(e.into())),
};
let gps_time = match time::GpsTime::new(wn, tow_s) {
Ok(gps_time) => gps_time,
Err(e) => return Some(Err(e.into())),
};
Some(Ok(time::MessageTime::Rover(gps_time.into())))
}
}
impl TryFrom<Sbp> for MsgGpsTime {
type Error = TryFromSbpError;
fn try_from(msg: Sbp) -> Result<Self, Self::Error> {
match msg {
Sbp::MsgGpsTime(m) => Ok(m),
_ => Err(TryFromSbpError),
}
}
}
impl WireFormat for MsgGpsTime {
const MIN_LEN: usize = <u16 as WireFormat>::MIN_LEN
+ <u32 as WireFormat>::MIN_LEN
+ <i32 as WireFormat>::MIN_LEN
+ <u8 as WireFormat>::MIN_LEN;
fn len(&self) -> usize {
WireFormat::len(&self.wn)
+ WireFormat::len(&self.tow)
+ WireFormat::len(&self.ns_residual)
+ WireFormat::len(&self.flags)
}
fn write<B: BufMut>(&self, buf: &mut B) {
WireFormat::write(&self.wn, buf);
WireFormat::write(&self.tow, buf);
WireFormat::write(&self.ns_residual, buf);
WireFormat::write(&self.flags, buf);
}
fn parse_unchecked<B: Buf>(buf: &mut B) -> Self {
MsgGpsTime {
sender_id: None,
wn: WireFormat::parse_unchecked(buf),
tow: WireFormat::parse_unchecked(buf),
ns_residual: WireFormat::parse_unchecked(buf),
flags: WireFormat::parse_unchecked(buf),
}
}
}
#[cfg_attr(feature = "serde", derive(serde::Serialize))]
#[derive(Debug, Clone)]
pub struct MsgGpsTimeDepA {
#[cfg_attr(feature = "serde", serde(skip_serializing))]
pub sender_id: Option<u16>,
#[cfg_attr(feature = "serde", serde(rename(serialize = "wn")))]
pub wn: u16,
#[cfg_attr(feature = "serde", serde(rename(serialize = "tow")))]
pub tow: u32,
#[cfg_attr(feature = "serde", serde(rename(serialize = "ns_residual")))]
pub ns_residual: i32,
#[cfg_attr(feature = "serde", serde(rename(serialize = "flags")))]
pub flags: u8,
}
impl ConcreteMessage for MsgGpsTimeDepA {
const MESSAGE_TYPE: u16 = 256;
const MESSAGE_NAME: &'static str = "MSG_GPS_TIME_DEP_A";
}
impl SbpMessage for MsgGpsTimeDepA {
fn message_name(&self) -> &'static str {
<Self as ConcreteMessage>::MESSAGE_NAME
}
fn message_type(&self) -> u16 {
<Self as ConcreteMessage>::MESSAGE_TYPE
}
fn sender_id(&self) -> Option<u16> {
self.sender_id
}
fn set_sender_id(&mut self, new_id: u16) {
self.sender_id = Some(new_id);
}
fn encoded_len(&self) -> usize {
WireFormat::len(self) + crate::HEADER_LEN + crate::CRC_LEN
}
#[cfg(feature = "swiftnav")]
fn gps_time(&self) -> Option<std::result::Result<time::MessageTime, time::GpsTimeError>> {
let tow_s = (self.tow as f64) / 1000.0;
#[allow(clippy::useless_conversion)]
let wn: i16 = match self.wn.try_into() {
Ok(wn) => wn,
Err(e) => return Some(Err(e.into())),
};
let gps_time = match time::GpsTime::new(wn, tow_s) {
Ok(gps_time) => gps_time,
Err(e) => return Some(Err(e.into())),
};
Some(Ok(time::MessageTime::Rover(gps_time.into())))
}
}
impl TryFrom<Sbp> for MsgGpsTimeDepA {
type Error = TryFromSbpError;
fn try_from(msg: Sbp) -> Result<Self, Self::Error> {
match msg {
Sbp::MsgGpsTimeDepA(m) => Ok(m),
_ => Err(TryFromSbpError),
}
}
}
impl WireFormat for MsgGpsTimeDepA {
const MIN_LEN: usize = <u16 as WireFormat>::MIN_LEN
+ <u32 as WireFormat>::MIN_LEN
+ <i32 as WireFormat>::MIN_LEN
+ <u8 as WireFormat>::MIN_LEN;
fn len(&self) -> usize {
WireFormat::len(&self.wn)
+ WireFormat::len(&self.tow)
+ WireFormat::len(&self.ns_residual)
+ WireFormat::len(&self.flags)
}
fn write<B: BufMut>(&self, buf: &mut B) {
WireFormat::write(&self.wn, buf);
WireFormat::write(&self.tow, buf);
WireFormat::write(&self.ns_residual, buf);
WireFormat::write(&self.flags, buf);
}
fn parse_unchecked<B: Buf>(buf: &mut B) -> Self {
MsgGpsTimeDepA {
sender_id: None,
wn: WireFormat::parse_unchecked(buf),
tow: WireFormat::parse_unchecked(buf),
ns_residual: WireFormat::parse_unchecked(buf),
flags: WireFormat::parse_unchecked(buf),
}
}
}
#[cfg_attr(feature = "serde", derive(serde::Serialize))]
#[derive(Debug, Clone)]
pub struct MsgGpsTimeGnss {
#[cfg_attr(feature = "serde", serde(skip_serializing))]
pub sender_id: Option<u16>,
#[cfg_attr(feature = "serde", serde(rename(serialize = "wn")))]
pub wn: u16,
#[cfg_attr(feature = "serde", serde(rename(serialize = "tow")))]
pub tow: u32,
#[cfg_attr(feature = "serde", serde(rename(serialize = "ns_residual")))]
pub ns_residual: i32,
#[cfg_attr(feature = "serde", serde(rename(serialize = "flags")))]
pub flags: u8,
}
impl ConcreteMessage for MsgGpsTimeGnss {
const MESSAGE_TYPE: u16 = 260;
const MESSAGE_NAME: &'static str = "MSG_GPS_TIME_GNSS";
}
impl SbpMessage for MsgGpsTimeGnss {
fn message_name(&self) -> &'static str {
<Self as ConcreteMessage>::MESSAGE_NAME
}
fn message_type(&self) -> u16 {
<Self as ConcreteMessage>::MESSAGE_TYPE
}
fn sender_id(&self) -> Option<u16> {
self.sender_id
}
fn set_sender_id(&mut self, new_id: u16) {
self.sender_id = Some(new_id);
}
fn encoded_len(&self) -> usize {
WireFormat::len(self) + crate::HEADER_LEN + crate::CRC_LEN
}
#[cfg(feature = "swiftnav")]
fn gps_time(&self) -> Option<std::result::Result<time::MessageTime, time::GpsTimeError>> {
let tow_s = (self.tow as f64) / 1000.0;
#[allow(clippy::useless_conversion)]
let wn: i16 = match self.wn.try_into() {
Ok(wn) => wn,
Err(e) => return Some(Err(e.into())),
};
let gps_time = match time::GpsTime::new(wn, tow_s) {
Ok(gps_time) => gps_time,
Err(e) => return Some(Err(e.into())),
};
Some(Ok(time::MessageTime::Rover(gps_time.into())))
}
}
impl TryFrom<Sbp> for MsgGpsTimeGnss {
type Error = TryFromSbpError;
fn try_from(msg: Sbp) -> Result<Self, Self::Error> {
match msg {
Sbp::MsgGpsTimeGnss(m) => Ok(m),
_ => Err(TryFromSbpError),
}
}
}
impl WireFormat for MsgGpsTimeGnss {
const MIN_LEN: usize = <u16 as WireFormat>::MIN_LEN
+ <u32 as WireFormat>::MIN_LEN
+ <i32 as WireFormat>::MIN_LEN
+ <u8 as WireFormat>::MIN_LEN;
fn len(&self) -> usize {
WireFormat::len(&self.wn)
+ WireFormat::len(&self.tow)
+ WireFormat::len(&self.ns_residual)
+ WireFormat::len(&self.flags)
}
fn write<B: BufMut>(&self, buf: &mut B) {
WireFormat::write(&self.wn, buf);
WireFormat::write(&self.tow, buf);
WireFormat::write(&self.ns_residual, buf);
WireFormat::write(&self.flags, buf);
}
fn parse_unchecked<B: Buf>(buf: &mut B) -> Self {
MsgGpsTimeGnss {
sender_id: None,
wn: WireFormat::parse_unchecked(buf),
tow: WireFormat::parse_unchecked(buf),
ns_residual: WireFormat::parse_unchecked(buf),
flags: WireFormat::parse_unchecked(buf),
}
}
}
#[cfg_attr(feature = "serde", derive(serde::Serialize))]
#[derive(Debug, Clone)]
pub struct MsgPosEcef {
#[cfg_attr(feature = "serde", serde(skip_serializing))]
pub sender_id: Option<u16>,
#[cfg_attr(feature = "serde", serde(rename(serialize = "tow")))]
pub tow: u32,
#[cfg_attr(feature = "serde", serde(rename(serialize = "x")))]
pub x: f64,
#[cfg_attr(feature = "serde", serde(rename(serialize = "y")))]
pub y: f64,
#[cfg_attr(feature = "serde", serde(rename(serialize = "z")))]
pub z: f64,
#[cfg_attr(feature = "serde", serde(rename(serialize = "accuracy")))]
pub accuracy: u16,
#[cfg_attr(feature = "serde", serde(rename(serialize = "n_sats")))]
pub n_sats: u8,
#[cfg_attr(feature = "serde", serde(rename(serialize = "flags")))]
pub flags: u8,
}
impl ConcreteMessage for MsgPosEcef {
const MESSAGE_TYPE: u16 = 521;
const MESSAGE_NAME: &'static str = "MSG_POS_ECEF";
}
impl SbpMessage for MsgPosEcef {
fn message_name(&self) -> &'static str {
<Self as ConcreteMessage>::MESSAGE_NAME
}
fn message_type(&self) -> u16 {
<Self as ConcreteMessage>::MESSAGE_TYPE
}
fn sender_id(&self) -> Option<u16> {
self.sender_id
}
fn set_sender_id(&mut self, new_id: u16) {
self.sender_id = Some(new_id);
}
fn encoded_len(&self) -> usize {
WireFormat::len(self) + crate::HEADER_LEN + crate::CRC_LEN
}
#[cfg(feature = "swiftnav")]
fn gps_time(&self) -> Option<std::result::Result<time::MessageTime, time::GpsTimeError>> {
let tow_s = (self.tow as f64) / 1000.0;
let gps_time = match time::GpsTime::new(0, tow_s) {
Ok(gps_time) => gps_time.tow(),
Err(e) => return Some(Err(e.into())),
};
Some(Ok(time::MessageTime::Rover(gps_time.into())))
}
}
impl TryFrom<Sbp> for MsgPosEcef {
type Error = TryFromSbpError;
fn try_from(msg: Sbp) -> Result<Self, Self::Error> {
match msg {
Sbp::MsgPosEcef(m) => Ok(m),
_ => Err(TryFromSbpError),
}
}
}
impl WireFormat for MsgPosEcef {
const MIN_LEN: usize = <u32 as WireFormat>::MIN_LEN
+ <f64 as WireFormat>::MIN_LEN
+ <f64 as WireFormat>::MIN_LEN
+ <f64 as WireFormat>::MIN_LEN
+ <u16 as WireFormat>::MIN_LEN
+ <u8 as WireFormat>::MIN_LEN
+ <u8 as WireFormat>::MIN_LEN;
fn len(&self) -> usize {
WireFormat::len(&self.tow)
+ WireFormat::len(&self.x)
+ WireFormat::len(&self.y)
+ WireFormat::len(&self.z)
+ WireFormat::len(&self.accuracy)
+ WireFormat::len(&self.n_sats)
+ WireFormat::len(&self.flags)
}
fn write<B: BufMut>(&self, buf: &mut B) {
WireFormat::write(&self.tow, buf);
WireFormat::write(&self.x, buf);
WireFormat::write(&self.y, buf);
WireFormat::write(&self.z, buf);
WireFormat::write(&self.accuracy, buf);
WireFormat::write(&self.n_sats, buf);
WireFormat::write(&self.flags, buf);
}
fn parse_unchecked<B: Buf>(buf: &mut B) -> Self {
MsgPosEcef {
sender_id: None,
tow: WireFormat::parse_unchecked(buf),
x: WireFormat::parse_unchecked(buf),
y: WireFormat::parse_unchecked(buf),
z: WireFormat::parse_unchecked(buf),
accuracy: WireFormat::parse_unchecked(buf),
n_sats: WireFormat::parse_unchecked(buf),
flags: WireFormat::parse_unchecked(buf),
}
}
}
#[cfg_attr(feature = "serde", derive(serde::Serialize))]
#[derive(Debug, Clone)]
pub struct MsgPosEcefCov {
#[cfg_attr(feature = "serde", serde(skip_serializing))]
pub sender_id: Option<u16>,
#[cfg_attr(feature = "serde", serde(rename(serialize = "tow")))]
pub tow: u32,
#[cfg_attr(feature = "serde", serde(rename(serialize = "x")))]
pub x: f64,
#[cfg_attr(feature = "serde", serde(rename(serialize = "y")))]
pub y: f64,
#[cfg_attr(feature = "serde", serde(rename(serialize = "z")))]
pub z: f64,
#[cfg_attr(feature = "serde", serde(rename(serialize = "cov_x_x")))]
pub cov_x_x: f32,
#[cfg_attr(feature = "serde", serde(rename(serialize = "cov_x_y")))]
pub cov_x_y: f32,
#[cfg_attr(feature = "serde", serde(rename(serialize = "cov_x_z")))]
pub cov_x_z: f32,
#[cfg_attr(feature = "serde", serde(rename(serialize = "cov_y_y")))]
pub cov_y_y: f32,
#[cfg_attr(feature = "serde", serde(rename(serialize = "cov_y_z")))]
pub cov_y_z: f32,
#[cfg_attr(feature = "serde", serde(rename(serialize = "cov_z_z")))]
pub cov_z_z: f32,
#[cfg_attr(feature = "serde", serde(rename(serialize = "n_sats")))]
pub n_sats: u8,
#[cfg_attr(feature = "serde", serde(rename(serialize = "flags")))]
pub flags: u8,
}
impl ConcreteMessage for MsgPosEcefCov {
const MESSAGE_TYPE: u16 = 532;
const MESSAGE_NAME: &'static str = "MSG_POS_ECEF_COV";
}
impl SbpMessage for MsgPosEcefCov {
fn message_name(&self) -> &'static str {
<Self as ConcreteMessage>::MESSAGE_NAME
}
fn message_type(&self) -> u16 {
<Self as ConcreteMessage>::MESSAGE_TYPE
}
fn sender_id(&self) -> Option<u16> {
self.sender_id
}
fn set_sender_id(&mut self, new_id: u16) {
self.sender_id = Some(new_id);
}
fn encoded_len(&self) -> usize {
WireFormat::len(self) + crate::HEADER_LEN + crate::CRC_LEN
}
#[cfg(feature = "swiftnav")]
fn gps_time(&self) -> Option<std::result::Result<time::MessageTime, time::GpsTimeError>> {
let tow_s = (self.tow as f64) / 1000.0;
let gps_time = match time::GpsTime::new(0, tow_s) {
Ok(gps_time) => gps_time.tow(),
Err(e) => return Some(Err(e.into())),
};
Some(Ok(time::MessageTime::Rover(gps_time.into())))
}
}
impl TryFrom<Sbp> for MsgPosEcefCov {
type Error = TryFromSbpError;
fn try_from(msg: Sbp) -> Result<Self, Self::Error> {
match msg {
Sbp::MsgPosEcefCov(m) => Ok(m),
_ => Err(TryFromSbpError),
}
}
}
impl WireFormat for MsgPosEcefCov {
const MIN_LEN: usize = <u32 as WireFormat>::MIN_LEN
+ <f64 as WireFormat>::MIN_LEN
+ <f64 as WireFormat>::MIN_LEN
+ <f64 as WireFormat>::MIN_LEN
+ <f32 as WireFormat>::MIN_LEN
+ <f32 as WireFormat>::MIN_LEN
+ <f32 as WireFormat>::MIN_LEN
+ <f32 as WireFormat>::MIN_LEN
+ <f32 as WireFormat>::MIN_LEN
+ <f32 as WireFormat>::MIN_LEN
+ <u8 as WireFormat>::MIN_LEN
+ <u8 as WireFormat>::MIN_LEN;
fn len(&self) -> usize {
WireFormat::len(&self.tow)
+ WireFormat::len(&self.x)
+ WireFormat::len(&self.y)
+ WireFormat::len(&self.z)
+ WireFormat::len(&self.cov_x_x)
+ WireFormat::len(&self.cov_x_y)
+ WireFormat::len(&self.cov_x_z)
+ WireFormat::len(&self.cov_y_y)
+ WireFormat::len(&self.cov_y_z)
+ WireFormat::len(&self.cov_z_z)
+ WireFormat::len(&self.n_sats)
+ WireFormat::len(&self.flags)
}
fn write<B: BufMut>(&self, buf: &mut B) {
WireFormat::write(&self.tow, buf);
WireFormat::write(&self.x, buf);
WireFormat::write(&self.y, buf);
WireFormat::write(&self.z, buf);
WireFormat::write(&self.cov_x_x, buf);
WireFormat::write(&self.cov_x_y, buf);
WireFormat::write(&self.cov_x_z, buf);
WireFormat::write(&self.cov_y_y, buf);
WireFormat::write(&self.cov_y_z, buf);
WireFormat::write(&self.cov_z_z, buf);
WireFormat::write(&self.n_sats, buf);
WireFormat::write(&self.flags, buf);
}
fn parse_unchecked<B: Buf>(buf: &mut B) -> Self {
MsgPosEcefCov {
sender_id: None,
tow: WireFormat::parse_unchecked(buf),
x: WireFormat::parse_unchecked(buf),
y: WireFormat::parse_unchecked(buf),
z: WireFormat::parse_unchecked(buf),
cov_x_x: WireFormat::parse_unchecked(buf),
cov_x_y: WireFormat::parse_unchecked(buf),
cov_x_z: WireFormat::parse_unchecked(buf),
cov_y_y: WireFormat::parse_unchecked(buf),
cov_y_z: WireFormat::parse_unchecked(buf),
cov_z_z: WireFormat::parse_unchecked(buf),
n_sats: WireFormat::parse_unchecked(buf),
flags: WireFormat::parse_unchecked(buf),
}
}
}
#[cfg_attr(feature = "serde", derive(serde::Serialize))]
#[derive(Debug, Clone)]
pub struct MsgPosEcefCovGnss {
#[cfg_attr(feature = "serde", serde(skip_serializing))]
pub sender_id: Option<u16>,
#[cfg_attr(feature = "serde", serde(rename(serialize = "tow")))]
pub tow: u32,
#[cfg_attr(feature = "serde", serde(rename(serialize = "x")))]
pub x: f64,
#[cfg_attr(feature = "serde", serde(rename(serialize = "y")))]
pub y: f64,
#[cfg_attr(feature = "serde", serde(rename(serialize = "z")))]
pub z: f64,
#[cfg_attr(feature = "serde", serde(rename(serialize = "cov_x_x")))]
pub cov_x_x: f32,
#[cfg_attr(feature = "serde", serde(rename(serialize = "cov_x_y")))]
pub cov_x_y: f32,
#[cfg_attr(feature = "serde", serde(rename(serialize = "cov_x_z")))]
pub cov_x_z: f32,
#[cfg_attr(feature = "serde", serde(rename(serialize = "cov_y_y")))]
pub cov_y_y: f32,
#[cfg_attr(feature = "serde", serde(rename(serialize = "cov_y_z")))]
pub cov_y_z: f32,
#[cfg_attr(feature = "serde", serde(rename(serialize = "cov_z_z")))]
pub cov_z_z: f32,
#[cfg_attr(feature = "serde", serde(rename(serialize = "n_sats")))]
pub n_sats: u8,
#[cfg_attr(feature = "serde", serde(rename(serialize = "flags")))]
pub flags: u8,
}
impl ConcreteMessage for MsgPosEcefCovGnss {
const MESSAGE_TYPE: u16 = 564;
const MESSAGE_NAME: &'static str = "MSG_POS_ECEF_COV_GNSS";
}
impl SbpMessage for MsgPosEcefCovGnss {
fn message_name(&self) -> &'static str {
<Self as ConcreteMessage>::MESSAGE_NAME
}
fn message_type(&self) -> u16 {
<Self as ConcreteMessage>::MESSAGE_TYPE
}
fn sender_id(&self) -> Option<u16> {
self.sender_id
}
fn set_sender_id(&mut self, new_id: u16) {
self.sender_id = Some(new_id);
}
fn encoded_len(&self) -> usize {
WireFormat::len(self) + crate::HEADER_LEN + crate::CRC_LEN
}
#[cfg(feature = "swiftnav")]
fn gps_time(&self) -> Option<std::result::Result<time::MessageTime, time::GpsTimeError>> {
let tow_s = (self.tow as f64) / 1000.0;
let gps_time = match time::GpsTime::new(0, tow_s) {
Ok(gps_time) => gps_time.tow(),
Err(e) => return Some(Err(e.into())),
};
Some(Ok(time::MessageTime::Rover(gps_time.into())))
}
}
impl TryFrom<Sbp> for MsgPosEcefCovGnss {
type Error = TryFromSbpError;
fn try_from(msg: Sbp) -> Result<Self, Self::Error> {
match msg {
Sbp::MsgPosEcefCovGnss(m) => Ok(m),
_ => Err(TryFromSbpError),
}
}
}
impl WireFormat for MsgPosEcefCovGnss {
const MIN_LEN: usize = <u32 as WireFormat>::MIN_LEN
+ <f64 as WireFormat>::MIN_LEN
+ <f64 as WireFormat>::MIN_LEN
+ <f64 as WireFormat>::MIN_LEN
+ <f32 as WireFormat>::MIN_LEN
+ <f32 as WireFormat>::MIN_LEN
+ <f32 as WireFormat>::MIN_LEN
+ <f32 as WireFormat>::MIN_LEN
+ <f32 as WireFormat>::MIN_LEN
+ <f32 as WireFormat>::MIN_LEN
+ <u8 as WireFormat>::MIN_LEN
+ <u8 as WireFormat>::MIN_LEN;
fn len(&self) -> usize {
WireFormat::len(&self.tow)
+ WireFormat::len(&self.x)
+ WireFormat::len(&self.y)
+ WireFormat::len(&self.z)
+ WireFormat::len(&self.cov_x_x)
+ WireFormat::len(&self.cov_x_y)
+ WireFormat::len(&self.cov_x_z)
+ WireFormat::len(&self.cov_y_y)
+ WireFormat::len(&self.cov_y_z)
+ WireFormat::len(&self.cov_z_z)
+ WireFormat::len(&self.n_sats)
+ WireFormat::len(&self.flags)
}
fn write<B: BufMut>(&self, buf: &mut B) {
WireFormat::write(&self.tow, buf);
WireFormat::write(&self.x, buf);
WireFormat::write(&self.y, buf);
WireFormat::write(&self.z, buf);
WireFormat::write(&self.cov_x_x, buf);
WireFormat::write(&self.cov_x_y, buf);
WireFormat::write(&self.cov_x_z, buf);
WireFormat::write(&self.cov_y_y, buf);
WireFormat::write(&self.cov_y_z, buf);
WireFormat::write(&self.cov_z_z, buf);
WireFormat::write(&self.n_sats, buf);
WireFormat::write(&self.flags, buf);
}
fn parse_unchecked<B: Buf>(buf: &mut B) -> Self {
MsgPosEcefCovGnss {
sender_id: None,
tow: WireFormat::parse_unchecked(buf),
x: WireFormat::parse_unchecked(buf),
y: WireFormat::parse_unchecked(buf),
z: WireFormat::parse_unchecked(buf),
cov_x_x: WireFormat::parse_unchecked(buf),
cov_x_y: WireFormat::parse_unchecked(buf),
cov_x_z: WireFormat::parse_unchecked(buf),
cov_y_y: WireFormat::parse_unchecked(buf),
cov_y_z: WireFormat::parse_unchecked(buf),
cov_z_z: WireFormat::parse_unchecked(buf),
n_sats: WireFormat::parse_unchecked(buf),
flags: WireFormat::parse_unchecked(buf),
}
}
}
#[cfg_attr(feature = "serde", derive(serde::Serialize))]
#[derive(Debug, Clone)]
pub struct MsgPosEcefDepA {
#[cfg_attr(feature = "serde", serde(skip_serializing))]
pub sender_id: Option<u16>,
#[cfg_attr(feature = "serde", serde(rename(serialize = "tow")))]
pub tow: u32,
#[cfg_attr(feature = "serde", serde(rename(serialize = "x")))]
pub x: f64,
#[cfg_attr(feature = "serde", serde(rename(serialize = "y")))]
pub y: f64,
#[cfg_attr(feature = "serde", serde(rename(serialize = "z")))]
pub z: f64,
#[cfg_attr(feature = "serde", serde(rename(serialize = "accuracy")))]
pub accuracy: u16,
#[cfg_attr(feature = "serde", serde(rename(serialize = "n_sats")))]
pub n_sats: u8,
#[cfg_attr(feature = "serde", serde(rename(serialize = "flags")))]
pub flags: u8,
}
impl ConcreteMessage for MsgPosEcefDepA {
const MESSAGE_TYPE: u16 = 512;
const MESSAGE_NAME: &'static str = "MSG_POS_ECEF_DEP_A";
}
impl SbpMessage for MsgPosEcefDepA {
fn message_name(&self) -> &'static str {
<Self as ConcreteMessage>::MESSAGE_NAME
}
fn message_type(&self) -> u16 {
<Self as ConcreteMessage>::MESSAGE_TYPE
}
fn sender_id(&self) -> Option<u16> {
self.sender_id
}
fn set_sender_id(&mut self, new_id: u16) {
self.sender_id = Some(new_id);
}
fn encoded_len(&self) -> usize {
WireFormat::len(self) + crate::HEADER_LEN + crate::CRC_LEN
}
#[cfg(feature = "swiftnav")]
fn gps_time(&self) -> Option<std::result::Result<time::MessageTime, time::GpsTimeError>> {
let tow_s = (self.tow as f64) / 1000.0;
let gps_time = match time::GpsTime::new(0, tow_s) {
Ok(gps_time) => gps_time.tow(),
Err(e) => return Some(Err(e.into())),
};
Some(Ok(time::MessageTime::Rover(gps_time.into())))
}
}
impl TryFrom<Sbp> for MsgPosEcefDepA {
type Error = TryFromSbpError;
fn try_from(msg: Sbp) -> Result<Self, Self::Error> {
match msg {
Sbp::MsgPosEcefDepA(m) => Ok(m),
_ => Err(TryFromSbpError),
}
}
}
impl WireFormat for MsgPosEcefDepA {
const MIN_LEN: usize = <u32 as WireFormat>::MIN_LEN
+ <f64 as WireFormat>::MIN_LEN
+ <f64 as WireFormat>::MIN_LEN
+ <f64 as WireFormat>::MIN_LEN
+ <u16 as WireFormat>::MIN_LEN
+ <u8 as WireFormat>::MIN_LEN
+ <u8 as WireFormat>::MIN_LEN;
fn len(&self) -> usize {
WireFormat::len(&self.tow)
+ WireFormat::len(&self.x)
+ WireFormat::len(&self.y)
+ WireFormat::len(&self.z)
+ WireFormat::len(&self.accuracy)
+ WireFormat::len(&self.n_sats)
+ WireFormat::len(&self.flags)
}
fn write<B: BufMut>(&self, buf: &mut B) {
WireFormat::write(&self.tow, buf);
WireFormat::write(&self.x, buf);
WireFormat::write(&self.y, buf);
WireFormat::write(&self.z, buf);
WireFormat::write(&self.accuracy, buf);
WireFormat::write(&self.n_sats, buf);
WireFormat::write(&self.flags, buf);
}
fn parse_unchecked<B: Buf>(buf: &mut B) -> Self {
MsgPosEcefDepA {
sender_id: None,
tow: WireFormat::parse_unchecked(buf),
x: WireFormat::parse_unchecked(buf),
y: WireFormat::parse_unchecked(buf),
z: WireFormat::parse_unchecked(buf),
accuracy: WireFormat::parse_unchecked(buf),
n_sats: WireFormat::parse_unchecked(buf),
flags: WireFormat::parse_unchecked(buf),
}
}
}
#[cfg_attr(feature = "serde", derive(serde::Serialize))]
#[derive(Debug, Clone)]
pub struct MsgPosEcefGnss {
#[cfg_attr(feature = "serde", serde(skip_serializing))]
pub sender_id: Option<u16>,
#[cfg_attr(feature = "serde", serde(rename(serialize = "tow")))]
pub tow: u32,
#[cfg_attr(feature = "serde", serde(rename(serialize = "x")))]
pub x: f64,
#[cfg_attr(feature = "serde", serde(rename(serialize = "y")))]
pub y: f64,
#[cfg_attr(feature = "serde", serde(rename(serialize = "z")))]
pub z: f64,
#[cfg_attr(feature = "serde", serde(rename(serialize = "accuracy")))]
pub accuracy: u16,
#[cfg_attr(feature = "serde", serde(rename(serialize = "n_sats")))]
pub n_sats: u8,
#[cfg_attr(feature = "serde", serde(rename(serialize = "flags")))]
pub flags: u8,
}
impl ConcreteMessage for MsgPosEcefGnss {
const MESSAGE_TYPE: u16 = 553;
const MESSAGE_NAME: &'static str = "MSG_POS_ECEF_GNSS";
}
impl SbpMessage for MsgPosEcefGnss {
fn message_name(&self) -> &'static str {
<Self as ConcreteMessage>::MESSAGE_NAME
}
fn message_type(&self) -> u16 {
<Self as ConcreteMessage>::MESSAGE_TYPE
}
fn sender_id(&self) -> Option<u16> {
self.sender_id
}
fn set_sender_id(&mut self, new_id: u16) {
self.sender_id = Some(new_id);
}
fn encoded_len(&self) -> usize {
WireFormat::len(self) + crate::HEADER_LEN + crate::CRC_LEN
}
#[cfg(feature = "swiftnav")]
fn gps_time(&self) -> Option<std::result::Result<time::MessageTime, time::GpsTimeError>> {
let tow_s = (self.tow as f64) / 1000.0;
let gps_time = match time::GpsTime::new(0, tow_s) {
Ok(gps_time) => gps_time.tow(),
Err(e) => return Some(Err(e.into())),
};
Some(Ok(time::MessageTime::Rover(gps_time.into())))
}
}
impl TryFrom<Sbp> for MsgPosEcefGnss {
type Error = TryFromSbpError;
fn try_from(msg: Sbp) -> Result<Self, Self::Error> {
match msg {
Sbp::MsgPosEcefGnss(m) => Ok(m),
_ => Err(TryFromSbpError),
}
}
}
impl WireFormat for MsgPosEcefGnss {
const MIN_LEN: usize = <u32 as WireFormat>::MIN_LEN
+ <f64 as WireFormat>::MIN_LEN
+ <f64 as WireFormat>::MIN_LEN
+ <f64 as WireFormat>::MIN_LEN
+ <u16 as WireFormat>::MIN_LEN
+ <u8 as WireFormat>::MIN_LEN
+ <u8 as WireFormat>::MIN_LEN;
fn len(&self) -> usize {
WireFormat::len(&self.tow)
+ WireFormat::len(&self.x)
+ WireFormat::len(&self.y)
+ WireFormat::len(&self.z)
+ WireFormat::len(&self.accuracy)
+ WireFormat::len(&self.n_sats)
+ WireFormat::len(&self.flags)
}
fn write<B: BufMut>(&self, buf: &mut B) {
WireFormat::write(&self.tow, buf);
WireFormat::write(&self.x, buf);
WireFormat::write(&self.y, buf);
WireFormat::write(&self.z, buf);
WireFormat::write(&self.accuracy, buf);
WireFormat::write(&self.n_sats, buf);
WireFormat::write(&self.flags, buf);
}
fn parse_unchecked<B: Buf>(buf: &mut B) -> Self {
MsgPosEcefGnss {
sender_id: None,
tow: WireFormat::parse_unchecked(buf),
x: WireFormat::parse_unchecked(buf),
y: WireFormat::parse_unchecked(buf),
z: WireFormat::parse_unchecked(buf),
accuracy: WireFormat::parse_unchecked(buf),
n_sats: WireFormat::parse_unchecked(buf),
flags: WireFormat::parse_unchecked(buf),
}
}
}
#[cfg_attr(feature = "serde", derive(serde::Serialize))]
#[derive(Debug, Clone)]
pub struct MsgPosLlh {
#[cfg_attr(feature = "serde", serde(skip_serializing))]
pub sender_id: Option<u16>,
#[cfg_attr(feature = "serde", serde(rename(serialize = "tow")))]
pub tow: u32,
#[cfg_attr(feature = "serde", serde(rename(serialize = "lat")))]
pub lat: f64,
#[cfg_attr(feature = "serde", serde(rename(serialize = "lon")))]
pub lon: f64,
#[cfg_attr(feature = "serde", serde(rename(serialize = "height")))]
pub height: f64,
#[cfg_attr(feature = "serde", serde(rename(serialize = "h_accuracy")))]
pub h_accuracy: u16,
#[cfg_attr(feature = "serde", serde(rename(serialize = "v_accuracy")))]
pub v_accuracy: u16,
#[cfg_attr(feature = "serde", serde(rename(serialize = "n_sats")))]
pub n_sats: u8,
#[cfg_attr(feature = "serde", serde(rename(serialize = "flags")))]
pub flags: u8,
}
impl ConcreteMessage for MsgPosLlh {
const MESSAGE_TYPE: u16 = 522;
const MESSAGE_NAME: &'static str = "MSG_POS_LLH";
}
impl SbpMessage for MsgPosLlh {
fn message_name(&self) -> &'static str {
<Self as ConcreteMessage>::MESSAGE_NAME
}
fn message_type(&self) -> u16 {
<Self as ConcreteMessage>::MESSAGE_TYPE
}
fn sender_id(&self) -> Option<u16> {
self.sender_id
}
fn set_sender_id(&mut self, new_id: u16) {
self.sender_id = Some(new_id);
}
fn encoded_len(&self) -> usize {
WireFormat::len(self) + crate::HEADER_LEN + crate::CRC_LEN
}
#[cfg(feature = "swiftnav")]
fn gps_time(&self) -> Option<std::result::Result<time::MessageTime, time::GpsTimeError>> {
let tow_s = (self.tow as f64) / 1000.0;
let gps_time = match time::GpsTime::new(0, tow_s) {
Ok(gps_time) => gps_time.tow(),
Err(e) => return Some(Err(e.into())),
};
Some(Ok(time::MessageTime::Rover(gps_time.into())))
}
}
impl TryFrom<Sbp> for MsgPosLlh {
type Error = TryFromSbpError;
fn try_from(msg: Sbp) -> Result<Self, Self::Error> {
match msg {
Sbp::MsgPosLlh(m) => Ok(m),
_ => Err(TryFromSbpError),
}
}
}
impl WireFormat for MsgPosLlh {
const MIN_LEN: usize = <u32 as WireFormat>::MIN_LEN
+ <f64 as WireFormat>::MIN_LEN
+ <f64 as WireFormat>::MIN_LEN
+ <f64 as WireFormat>::MIN_LEN
+ <u16 as WireFormat>::MIN_LEN
+ <u16 as WireFormat>::MIN_LEN
+ <u8 as WireFormat>::MIN_LEN
+ <u8 as WireFormat>::MIN_LEN;
fn len(&self) -> usize {
WireFormat::len(&self.tow)
+ WireFormat::len(&self.lat)
+ WireFormat::len(&self.lon)
+ WireFormat::len(&self.height)
+ WireFormat::len(&self.h_accuracy)
+ WireFormat::len(&self.v_accuracy)
+ WireFormat::len(&self.n_sats)
+ WireFormat::len(&self.flags)
}
fn write<B: BufMut>(&self, buf: &mut B) {
WireFormat::write(&self.tow, buf);
WireFormat::write(&self.lat, buf);
WireFormat::write(&self.lon, buf);
WireFormat::write(&self.height, buf);
WireFormat::write(&self.h_accuracy, buf);
WireFormat::write(&self.v_accuracy, buf);
WireFormat::write(&self.n_sats, buf);
WireFormat::write(&self.flags, buf);
}
fn parse_unchecked<B: Buf>(buf: &mut B) -> Self {
MsgPosLlh {
sender_id: None,
tow: WireFormat::parse_unchecked(buf),
lat: WireFormat::parse_unchecked(buf),
lon: WireFormat::parse_unchecked(buf),
height: WireFormat::parse_unchecked(buf),
h_accuracy: WireFormat::parse_unchecked(buf),
v_accuracy: WireFormat::parse_unchecked(buf),
n_sats: WireFormat::parse_unchecked(buf),
flags: WireFormat::parse_unchecked(buf),
}
}
}
#[cfg_attr(feature = "serde", derive(serde::Serialize))]
#[derive(Debug, Clone)]
pub struct MsgPosLlhAcc {
#[cfg_attr(feature = "serde", serde(skip_serializing))]
pub sender_id: Option<u16>,
#[cfg_attr(feature = "serde", serde(rename(serialize = "tow")))]
pub tow: u32,
#[cfg_attr(feature = "serde", serde(rename(serialize = "lat")))]
pub lat: f64,
#[cfg_attr(feature = "serde", serde(rename(serialize = "lon")))]
pub lon: f64,
#[cfg_attr(feature = "serde", serde(rename(serialize = "height")))]
pub height: f64,
#[cfg_attr(feature = "serde", serde(rename(serialize = "orthometric_height")))]
pub orthometric_height: f64,
#[cfg_attr(feature = "serde", serde(rename(serialize = "h_accuracy")))]
pub h_accuracy: f32,
#[cfg_attr(feature = "serde", serde(rename(serialize = "v_accuracy")))]
pub v_accuracy: f32,
#[cfg_attr(feature = "serde", serde(rename(serialize = "ct_accuracy")))]
pub ct_accuracy: f32,
#[cfg_attr(feature = "serde", serde(rename(serialize = "at_accuracy")))]
pub at_accuracy: f32,
#[cfg_attr(feature = "serde", serde(rename(serialize = "h_ellipse")))]
pub h_ellipse: EstimatedHorizontalErrorEllipse,
#[cfg_attr(feature = "serde", serde(rename(serialize = "confidence_and_geoid")))]
pub confidence_and_geoid: u8,
#[cfg_attr(feature = "serde", serde(rename(serialize = "n_sats")))]
pub n_sats: u8,
#[cfg_attr(feature = "serde", serde(rename(serialize = "flags")))]
pub flags: u8,
}
impl ConcreteMessage for MsgPosLlhAcc {
const MESSAGE_TYPE: u16 = 536;
const MESSAGE_NAME: &'static str = "MSG_POS_LLH_ACC";
}
impl SbpMessage for MsgPosLlhAcc {
fn message_name(&self) -> &'static str {
<Self as ConcreteMessage>::MESSAGE_NAME
}
fn message_type(&self) -> u16 {
<Self as ConcreteMessage>::MESSAGE_TYPE
}
fn sender_id(&self) -> Option<u16> {
self.sender_id
}
fn set_sender_id(&mut self, new_id: u16) {
self.sender_id = Some(new_id);
}
fn encoded_len(&self) -> usize {
WireFormat::len(self) + crate::HEADER_LEN + crate::CRC_LEN
}
#[cfg(feature = "swiftnav")]
fn gps_time(&self) -> Option<std::result::Result<time::MessageTime, time::GpsTimeError>> {
let tow_s = (self.tow as f64) / 1000.0;
let gps_time = match time::GpsTime::new(0, tow_s) {
Ok(gps_time) => gps_time.tow(),
Err(e) => return Some(Err(e.into())),
};
Some(Ok(time::MessageTime::Rover(gps_time.into())))
}
}
impl TryFrom<Sbp> for MsgPosLlhAcc {
type Error = TryFromSbpError;
fn try_from(msg: Sbp) -> Result<Self, Self::Error> {
match msg {
Sbp::MsgPosLlhAcc(m) => Ok(m),
_ => Err(TryFromSbpError),
}
}
}
impl WireFormat for MsgPosLlhAcc {
const MIN_LEN: usize = <u32 as WireFormat>::MIN_LEN
+ <f64 as WireFormat>::MIN_LEN
+ <f64 as WireFormat>::MIN_LEN
+ <f64 as WireFormat>::MIN_LEN
+ <f64 as WireFormat>::MIN_LEN
+ <f32 as WireFormat>::MIN_LEN
+ <f32 as WireFormat>::MIN_LEN
+ <f32 as WireFormat>::MIN_LEN
+ <f32 as WireFormat>::MIN_LEN
+ <EstimatedHorizontalErrorEllipse as WireFormat>::MIN_LEN
+ <u8 as WireFormat>::MIN_LEN
+ <u8 as WireFormat>::MIN_LEN
+ <u8 as WireFormat>::MIN_LEN;
fn len(&self) -> usize {
WireFormat::len(&self.tow)
+ WireFormat::len(&self.lat)
+ WireFormat::len(&self.lon)
+ WireFormat::len(&self.height)
+ WireFormat::len(&self.orthometric_height)
+ WireFormat::len(&self.h_accuracy)
+ WireFormat::len(&self.v_accuracy)
+ WireFormat::len(&self.ct_accuracy)
+ WireFormat::len(&self.at_accuracy)
+ WireFormat::len(&self.h_ellipse)
+ WireFormat::len(&self.confidence_and_geoid)
+ WireFormat::len(&self.n_sats)
+ WireFormat::len(&self.flags)
}
fn write<B: BufMut>(&self, buf: &mut B) {
WireFormat::write(&self.tow, buf);
WireFormat::write(&self.lat, buf);
WireFormat::write(&self.lon, buf);
WireFormat::write(&self.height, buf);
WireFormat::write(&self.orthometric_height, buf);
WireFormat::write(&self.h_accuracy, buf);
WireFormat::write(&self.v_accuracy, buf);
WireFormat::write(&self.ct_accuracy, buf);
WireFormat::write(&self.at_accuracy, buf);
WireFormat::write(&self.h_ellipse, buf);
WireFormat::write(&self.confidence_and_geoid, buf);
WireFormat::write(&self.n_sats, buf);
WireFormat::write(&self.flags, buf);
}
fn parse_unchecked<B: Buf>(buf: &mut B) -> Self {
MsgPosLlhAcc {
sender_id: None,
tow: WireFormat::parse_unchecked(buf),
lat: WireFormat::parse_unchecked(buf),
lon: WireFormat::parse_unchecked(buf),
height: WireFormat::parse_unchecked(buf),
orthometric_height: WireFormat::parse_unchecked(buf),
h_accuracy: WireFormat::parse_unchecked(buf),
v_accuracy: WireFormat::parse_unchecked(buf),
ct_accuracy: WireFormat::parse_unchecked(buf),
at_accuracy: WireFormat::parse_unchecked(buf),
h_ellipse: WireFormat::parse_unchecked(buf),
confidence_and_geoid: WireFormat::parse_unchecked(buf),
n_sats: WireFormat::parse_unchecked(buf),
flags: WireFormat::parse_unchecked(buf),
}
}
}
#[cfg_attr(feature = "serde", derive(serde::Serialize))]
#[derive(Debug, Clone)]
pub struct MsgPosLlhCov {
#[cfg_attr(feature = "serde", serde(skip_serializing))]
pub sender_id: Option<u16>,
#[cfg_attr(feature = "serde", serde(rename(serialize = "tow")))]
pub tow: u32,
#[cfg_attr(feature = "serde", serde(rename(serialize = "lat")))]
pub lat: f64,
#[cfg_attr(feature = "serde", serde(rename(serialize = "lon")))]
pub lon: f64,
#[cfg_attr(feature = "serde", serde(rename(serialize = "height")))]
pub height: f64,
#[cfg_attr(feature = "serde", serde(rename(serialize = "cov_n_n")))]
pub cov_n_n: f32,
#[cfg_attr(feature = "serde", serde(rename(serialize = "cov_n_e")))]
pub cov_n_e: f32,
#[cfg_attr(feature = "serde", serde(rename(serialize = "cov_n_d")))]
pub cov_n_d: f32,
#[cfg_attr(feature = "serde", serde(rename(serialize = "cov_e_e")))]
pub cov_e_e: f32,
#[cfg_attr(feature = "serde", serde(rename(serialize = "cov_e_d")))]
pub cov_e_d: f32,
#[cfg_attr(feature = "serde", serde(rename(serialize = "cov_d_d")))]
pub cov_d_d: f32,
#[cfg_attr(feature = "serde", serde(rename(serialize = "n_sats")))]
pub n_sats: u8,
#[cfg_attr(feature = "serde", serde(rename(serialize = "flags")))]
pub flags: u8,
}
impl ConcreteMessage for MsgPosLlhCov {
const MESSAGE_TYPE: u16 = 529;
const MESSAGE_NAME: &'static str = "MSG_POS_LLH_COV";
}
impl SbpMessage for MsgPosLlhCov {
fn message_name(&self) -> &'static str {
<Self as ConcreteMessage>::MESSAGE_NAME
}
fn message_type(&self) -> u16 {
<Self as ConcreteMessage>::MESSAGE_TYPE
}
fn sender_id(&self) -> Option<u16> {
self.sender_id
}
fn set_sender_id(&mut self, new_id: u16) {
self.sender_id = Some(new_id);
}
fn encoded_len(&self) -> usize {
WireFormat::len(self) + crate::HEADER_LEN + crate::CRC_LEN
}
#[cfg(feature = "swiftnav")]
fn gps_time(&self) -> Option<std::result::Result<time::MessageTime, time::GpsTimeError>> {
let tow_s = (self.tow as f64) / 1000.0;
let gps_time = match time::GpsTime::new(0, tow_s) {
Ok(gps_time) => gps_time.tow(),
Err(e) => return Some(Err(e.into())),
};
Some(Ok(time::MessageTime::Rover(gps_time.into())))
}
}
impl TryFrom<Sbp> for MsgPosLlhCov {
type Error = TryFromSbpError;
fn try_from(msg: Sbp) -> Result<Self, Self::Error> {
match msg {
Sbp::MsgPosLlhCov(m) => Ok(m),
_ => Err(TryFromSbpError),
}
}
}
impl WireFormat for MsgPosLlhCov {
const MIN_LEN: usize = <u32 as WireFormat>::MIN_LEN
+ <f64 as WireFormat>::MIN_LEN
+ <f64 as WireFormat>::MIN_LEN
+ <f64 as WireFormat>::MIN_LEN
+ <f32 as WireFormat>::MIN_LEN
+ <f32 as WireFormat>::MIN_LEN
+ <f32 as WireFormat>::MIN_LEN
+ <f32 as WireFormat>::MIN_LEN
+ <f32 as WireFormat>::MIN_LEN
+ <f32 as WireFormat>::MIN_LEN
+ <u8 as WireFormat>::MIN_LEN
+ <u8 as WireFormat>::MIN_LEN;
fn len(&self) -> usize {
WireFormat::len(&self.tow)
+ WireFormat::len(&self.lat)
+ WireFormat::len(&self.lon)
+ WireFormat::len(&self.height)
+ WireFormat::len(&self.cov_n_n)
+ WireFormat::len(&self.cov_n_e)
+ WireFormat::len(&self.cov_n_d)
+ WireFormat::len(&self.cov_e_e)
+ WireFormat::len(&self.cov_e_d)
+ WireFormat::len(&self.cov_d_d)
+ WireFormat::len(&self.n_sats)
+ WireFormat::len(&self.flags)
}
fn write<B: BufMut>(&self, buf: &mut B) {
WireFormat::write(&self.tow, buf);
WireFormat::write(&self.lat, buf);
WireFormat::write(&self.lon, buf);
WireFormat::write(&self.height, buf);
WireFormat::write(&self.cov_n_n, buf);
WireFormat::write(&self.cov_n_e, buf);
WireFormat::write(&self.cov_n_d, buf);
WireFormat::write(&self.cov_e_e, buf);
WireFormat::write(&self.cov_e_d, buf);
WireFormat::write(&self.cov_d_d, buf);
WireFormat::write(&self.n_sats, buf);
WireFormat::write(&self.flags, buf);
}
fn parse_unchecked<B: Buf>(buf: &mut B) -> Self {
MsgPosLlhCov {
sender_id: None,
tow: WireFormat::parse_unchecked(buf),
lat: WireFormat::parse_unchecked(buf),
lon: WireFormat::parse_unchecked(buf),
height: WireFormat::parse_unchecked(buf),
cov_n_n: WireFormat::parse_unchecked(buf),
cov_n_e: WireFormat::parse_unchecked(buf),
cov_n_d: WireFormat::parse_unchecked(buf),
cov_e_e: WireFormat::parse_unchecked(buf),
cov_e_d: WireFormat::parse_unchecked(buf),
cov_d_d: WireFormat::parse_unchecked(buf),
n_sats: WireFormat::parse_unchecked(buf),
flags: WireFormat::parse_unchecked(buf),
}
}
}
#[cfg_attr(feature = "serde", derive(serde::Serialize))]
#[derive(Debug, Clone)]
pub struct MsgPosLlhCovGnss {
#[cfg_attr(feature = "serde", serde(skip_serializing))]
pub sender_id: Option<u16>,
#[cfg_attr(feature = "serde", serde(rename(serialize = "tow")))]
pub tow: u32,
#[cfg_attr(feature = "serde", serde(rename(serialize = "lat")))]
pub lat: f64,
#[cfg_attr(feature = "serde", serde(rename(serialize = "lon")))]
pub lon: f64,
#[cfg_attr(feature = "serde", serde(rename(serialize = "height")))]
pub height: f64,
#[cfg_attr(feature = "serde", serde(rename(serialize = "cov_n_n")))]
pub cov_n_n: f32,
#[cfg_attr(feature = "serde", serde(rename(serialize = "cov_n_e")))]
pub cov_n_e: f32,
#[cfg_attr(feature = "serde", serde(rename(serialize = "cov_n_d")))]
pub cov_n_d: f32,
#[cfg_attr(feature = "serde", serde(rename(serialize = "cov_e_e")))]
pub cov_e_e: f32,
#[cfg_attr(feature = "serde", serde(rename(serialize = "cov_e_d")))]
pub cov_e_d: f32,
#[cfg_attr(feature = "serde", serde(rename(serialize = "cov_d_d")))]
pub cov_d_d: f32,
#[cfg_attr(feature = "serde", serde(rename(serialize = "n_sats")))]
pub n_sats: u8,
#[cfg_attr(feature = "serde", serde(rename(serialize = "flags")))]
pub flags: u8,
}
impl ConcreteMessage for MsgPosLlhCovGnss {
const MESSAGE_TYPE: u16 = 561;
const MESSAGE_NAME: &'static str = "MSG_POS_LLH_COV_GNSS";
}
impl SbpMessage for MsgPosLlhCovGnss {
fn message_name(&self) -> &'static str {
<Self as ConcreteMessage>::MESSAGE_NAME
}
fn message_type(&self) -> u16 {
<Self as ConcreteMessage>::MESSAGE_TYPE
}
fn sender_id(&self) -> Option<u16> {
self.sender_id
}
fn set_sender_id(&mut self, new_id: u16) {
self.sender_id = Some(new_id);
}
fn encoded_len(&self) -> usize {
WireFormat::len(self) + crate::HEADER_LEN + crate::CRC_LEN
}
#[cfg(feature = "swiftnav")]
fn gps_time(&self) -> Option<std::result::Result<time::MessageTime, time::GpsTimeError>> {
let tow_s = (self.tow as f64) / 1000.0;
let gps_time = match time::GpsTime::new(0, tow_s) {
Ok(gps_time) => gps_time.tow(),
Err(e) => return Some(Err(e.into())),
};
Some(Ok(time::MessageTime::Rover(gps_time.into())))
}
}
impl TryFrom<Sbp> for MsgPosLlhCovGnss {
type Error = TryFromSbpError;
fn try_from(msg: Sbp) -> Result<Self, Self::Error> {
match msg {
Sbp::MsgPosLlhCovGnss(m) => Ok(m),
_ => Err(TryFromSbpError),
}
}
}
impl WireFormat for MsgPosLlhCovGnss {
const MIN_LEN: usize = <u32 as WireFormat>::MIN_LEN
+ <f64 as WireFormat>::MIN_LEN
+ <f64 as WireFormat>::MIN_LEN
+ <f64 as WireFormat>::MIN_LEN
+ <f32 as WireFormat>::MIN_LEN
+ <f32 as WireFormat>::MIN_LEN
+ <f32 as WireFormat>::MIN_LEN
+ <f32 as WireFormat>::MIN_LEN
+ <f32 as WireFormat>::MIN_LEN
+ <f32 as WireFormat>::MIN_LEN
+ <u8 as WireFormat>::MIN_LEN
+ <u8 as WireFormat>::MIN_LEN;
fn len(&self) -> usize {
WireFormat::len(&self.tow)
+ WireFormat::len(&self.lat)
+ WireFormat::len(&self.lon)
+ WireFormat::len(&self.height)
+ WireFormat::len(&self.cov_n_n)
+ WireFormat::len(&self.cov_n_e)
+ WireFormat::len(&self.cov_n_d)
+ WireFormat::len(&self.cov_e_e)
+ WireFormat::len(&self.cov_e_d)
+ WireFormat::len(&self.cov_d_d)
+ WireFormat::len(&self.n_sats)
+ WireFormat::len(&self.flags)
}
fn write<B: BufMut>(&self, buf: &mut B) {
WireFormat::write(&self.tow, buf);
WireFormat::write(&self.lat, buf);
WireFormat::write(&self.lon, buf);
WireFormat::write(&self.height, buf);
WireFormat::write(&self.cov_n_n, buf);
WireFormat::write(&self.cov_n_e, buf);
WireFormat::write(&self.cov_n_d, buf);
WireFormat::write(&self.cov_e_e, buf);
WireFormat::write(&self.cov_e_d, buf);
WireFormat::write(&self.cov_d_d, buf);
WireFormat::write(&self.n_sats, buf);
WireFormat::write(&self.flags, buf);
}
fn parse_unchecked<B: Buf>(buf: &mut B) -> Self {
MsgPosLlhCovGnss {
sender_id: None,
tow: WireFormat::parse_unchecked(buf),
lat: WireFormat::parse_unchecked(buf),
lon: WireFormat::parse_unchecked(buf),
height: WireFormat::parse_unchecked(buf),
cov_n_n: WireFormat::parse_unchecked(buf),
cov_n_e: WireFormat::parse_unchecked(buf),
cov_n_d: WireFormat::parse_unchecked(buf),
cov_e_e: WireFormat::parse_unchecked(buf),
cov_e_d: WireFormat::parse_unchecked(buf),
cov_d_d: WireFormat::parse_unchecked(buf),
n_sats: WireFormat::parse_unchecked(buf),
flags: WireFormat::parse_unchecked(buf),
}
}
}
#[cfg_attr(feature = "serde", derive(serde::Serialize))]
#[derive(Debug, Clone)]
pub struct MsgPosLlhDepA {
#[cfg_attr(feature = "serde", serde(skip_serializing))]
pub sender_id: Option<u16>,
#[cfg_attr(feature = "serde", serde(rename(serialize = "tow")))]
pub tow: u32,
#[cfg_attr(feature = "serde", serde(rename(serialize = "lat")))]
pub lat: f64,
#[cfg_attr(feature = "serde", serde(rename(serialize = "lon")))]
pub lon: f64,
#[cfg_attr(feature = "serde", serde(rename(serialize = "height")))]
pub height: f64,
#[cfg_attr(feature = "serde", serde(rename(serialize = "h_accuracy")))]
pub h_accuracy: u16,
#[cfg_attr(feature = "serde", serde(rename(serialize = "v_accuracy")))]
pub v_accuracy: u16,
#[cfg_attr(feature = "serde", serde(rename(serialize = "n_sats")))]
pub n_sats: u8,
#[cfg_attr(feature = "serde", serde(rename(serialize = "flags")))]
pub flags: u8,
}
impl ConcreteMessage for MsgPosLlhDepA {
const MESSAGE_TYPE: u16 = 513;
const MESSAGE_NAME: &'static str = "MSG_POS_LLH_DEP_A";
}
impl SbpMessage for MsgPosLlhDepA {
fn message_name(&self) -> &'static str {
<Self as ConcreteMessage>::MESSAGE_NAME
}
fn message_type(&self) -> u16 {
<Self as ConcreteMessage>::MESSAGE_TYPE
}
fn sender_id(&self) -> Option<u16> {
self.sender_id
}
fn set_sender_id(&mut self, new_id: u16) {
self.sender_id = Some(new_id);
}
fn encoded_len(&self) -> usize {
WireFormat::len(self) + crate::HEADER_LEN + crate::CRC_LEN
}
#[cfg(feature = "swiftnav")]
fn gps_time(&self) -> Option<std::result::Result<time::MessageTime, time::GpsTimeError>> {
let tow_s = (self.tow as f64) / 1000.0;
let gps_time = match time::GpsTime::new(0, tow_s) {
Ok(gps_time) => gps_time.tow(),
Err(e) => return Some(Err(e.into())),
};
Some(Ok(time::MessageTime::Rover(gps_time.into())))
}
}
impl TryFrom<Sbp> for MsgPosLlhDepA {
type Error = TryFromSbpError;
fn try_from(msg: Sbp) -> Result<Self, Self::Error> {
match msg {
Sbp::MsgPosLlhDepA(m) => Ok(m),
_ => Err(TryFromSbpError),
}
}
}
impl WireFormat for MsgPosLlhDepA {
const MIN_LEN: usize = <u32 as WireFormat>::MIN_LEN
+ <f64 as WireFormat>::MIN_LEN
+ <f64 as WireFormat>::MIN_LEN
+ <f64 as WireFormat>::MIN_LEN
+ <u16 as WireFormat>::MIN_LEN
+ <u16 as WireFormat>::MIN_LEN
+ <u8 as WireFormat>::MIN_LEN
+ <u8 as WireFormat>::MIN_LEN;
fn len(&self) -> usize {
WireFormat::len(&self.tow)
+ WireFormat::len(&self.lat)
+ WireFormat::len(&self.lon)
+ WireFormat::len(&self.height)
+ WireFormat::len(&self.h_accuracy)
+ WireFormat::len(&self.v_accuracy)
+ WireFormat::len(&self.n_sats)
+ WireFormat::len(&self.flags)
}
fn write<B: BufMut>(&self, buf: &mut B) {
WireFormat::write(&self.tow, buf);
WireFormat::write(&self.lat, buf);
WireFormat::write(&self.lon, buf);
WireFormat::write(&self.height, buf);
WireFormat::write(&self.h_accuracy, buf);
WireFormat::write(&self.v_accuracy, buf);
WireFormat::write(&self.n_sats, buf);
WireFormat::write(&self.flags, buf);
}
fn parse_unchecked<B: Buf>(buf: &mut B) -> Self {
MsgPosLlhDepA {
sender_id: None,
tow: WireFormat::parse_unchecked(buf),
lat: WireFormat::parse_unchecked(buf),
lon: WireFormat::parse_unchecked(buf),
height: WireFormat::parse_unchecked(buf),
h_accuracy: WireFormat::parse_unchecked(buf),
v_accuracy: WireFormat::parse_unchecked(buf),
n_sats: WireFormat::parse_unchecked(buf),
flags: WireFormat::parse_unchecked(buf),
}
}
}
#[cfg_attr(feature = "serde", derive(serde::Serialize))]
#[derive(Debug, Clone)]
pub struct MsgPosLlhGnss {
#[cfg_attr(feature = "serde", serde(skip_serializing))]
pub sender_id: Option<u16>,
#[cfg_attr(feature = "serde", serde(rename(serialize = "tow")))]
pub tow: u32,
#[cfg_attr(feature = "serde", serde(rename(serialize = "lat")))]
pub lat: f64,
#[cfg_attr(feature = "serde", serde(rename(serialize = "lon")))]
pub lon: f64,
#[cfg_attr(feature = "serde", serde(rename(serialize = "height")))]
pub height: f64,
#[cfg_attr(feature = "serde", serde(rename(serialize = "h_accuracy")))]
pub h_accuracy: u16,
#[cfg_attr(feature = "serde", serde(rename(serialize = "v_accuracy")))]
pub v_accuracy: u16,
#[cfg_attr(feature = "serde", serde(rename(serialize = "n_sats")))]
pub n_sats: u8,
#[cfg_attr(feature = "serde", serde(rename(serialize = "flags")))]
pub flags: u8,
}
impl ConcreteMessage for MsgPosLlhGnss {
const MESSAGE_TYPE: u16 = 554;
const MESSAGE_NAME: &'static str = "MSG_POS_LLH_GNSS";
}
impl SbpMessage for MsgPosLlhGnss {
fn message_name(&self) -> &'static str {
<Self as ConcreteMessage>::MESSAGE_NAME
}
fn message_type(&self) -> u16 {
<Self as ConcreteMessage>::MESSAGE_TYPE
}
fn sender_id(&self) -> Option<u16> {
self.sender_id
}
fn set_sender_id(&mut self, new_id: u16) {
self.sender_id = Some(new_id);
}
fn encoded_len(&self) -> usize {
WireFormat::len(self) + crate::HEADER_LEN + crate::CRC_LEN
}
#[cfg(feature = "swiftnav")]
fn gps_time(&self) -> Option<std::result::Result<time::MessageTime, time::GpsTimeError>> {
let tow_s = (self.tow as f64) / 1000.0;
let gps_time = match time::GpsTime::new(0, tow_s) {
Ok(gps_time) => gps_time.tow(),
Err(e) => return Some(Err(e.into())),
};
Some(Ok(time::MessageTime::Rover(gps_time.into())))
}
}
impl TryFrom<Sbp> for MsgPosLlhGnss {
type Error = TryFromSbpError;
fn try_from(msg: Sbp) -> Result<Self, Self::Error> {
match msg {
Sbp::MsgPosLlhGnss(m) => Ok(m),
_ => Err(TryFromSbpError),
}
}
}
impl WireFormat for MsgPosLlhGnss {
const MIN_LEN: usize = <u32 as WireFormat>::MIN_LEN
+ <f64 as WireFormat>::MIN_LEN
+ <f64 as WireFormat>::MIN_LEN
+ <f64 as WireFormat>::MIN_LEN
+ <u16 as WireFormat>::MIN_LEN
+ <u16 as WireFormat>::MIN_LEN
+ <u8 as WireFormat>::MIN_LEN
+ <u8 as WireFormat>::MIN_LEN;
fn len(&self) -> usize {
WireFormat::len(&self.tow)
+ WireFormat::len(&self.lat)
+ WireFormat::len(&self.lon)
+ WireFormat::len(&self.height)
+ WireFormat::len(&self.h_accuracy)
+ WireFormat::len(&self.v_accuracy)
+ WireFormat::len(&self.n_sats)
+ WireFormat::len(&self.flags)
}
fn write<B: BufMut>(&self, buf: &mut B) {
WireFormat::write(&self.tow, buf);
WireFormat::write(&self.lat, buf);
WireFormat::write(&self.lon, buf);
WireFormat::write(&self.height, buf);
WireFormat::write(&self.h_accuracy, buf);
WireFormat::write(&self.v_accuracy, buf);
WireFormat::write(&self.n_sats, buf);
WireFormat::write(&self.flags, buf);
}
fn parse_unchecked<B: Buf>(buf: &mut B) -> Self {
MsgPosLlhGnss {
sender_id: None,
tow: WireFormat::parse_unchecked(buf),
lat: WireFormat::parse_unchecked(buf),
lon: WireFormat::parse_unchecked(buf),
height: WireFormat::parse_unchecked(buf),
h_accuracy: WireFormat::parse_unchecked(buf),
v_accuracy: WireFormat::parse_unchecked(buf),
n_sats: WireFormat::parse_unchecked(buf),
flags: WireFormat::parse_unchecked(buf),
}
}
}
#[cfg_attr(feature = "serde", derive(serde::Serialize))]
#[derive(Debug, Clone)]
pub struct MsgProtectionLevel {
#[cfg_attr(feature = "serde", serde(skip_serializing))]
pub sender_id: Option<u16>,
#[cfg_attr(feature = "serde", serde(rename(serialize = "tow")))]
pub tow: u32,
#[cfg_attr(feature = "serde", serde(rename(serialize = "wn")))]
pub wn: i16,
#[cfg_attr(feature = "serde", serde(rename(serialize = "hpl")))]
pub hpl: u16,
#[cfg_attr(feature = "serde", serde(rename(serialize = "vpl")))]
pub vpl: u16,
#[cfg_attr(feature = "serde", serde(rename(serialize = "atpl")))]
pub atpl: u16,
#[cfg_attr(feature = "serde", serde(rename(serialize = "ctpl")))]
pub ctpl: u16,
#[cfg_attr(feature = "serde", serde(rename(serialize = "hvpl")))]
pub hvpl: u16,
#[cfg_attr(feature = "serde", serde(rename(serialize = "vvpl")))]
pub vvpl: u16,
#[cfg_attr(feature = "serde", serde(rename(serialize = "hopl")))]
pub hopl: u16,
#[cfg_attr(feature = "serde", serde(rename(serialize = "popl")))]
pub popl: u16,
#[cfg_attr(feature = "serde", serde(rename(serialize = "ropl")))]
pub ropl: u16,
#[cfg_attr(feature = "serde", serde(rename(serialize = "lat")))]
pub lat: f64,
#[cfg_attr(feature = "serde", serde(rename(serialize = "lon")))]
pub lon: f64,
#[cfg_attr(feature = "serde", serde(rename(serialize = "height")))]
pub height: f64,
#[cfg_attr(feature = "serde", serde(rename(serialize = "v_x")))]
pub v_x: i32,
#[cfg_attr(feature = "serde", serde(rename(serialize = "v_y")))]
pub v_y: i32,
#[cfg_attr(feature = "serde", serde(rename(serialize = "v_z")))]
pub v_z: i32,
#[cfg_attr(feature = "serde", serde(rename(serialize = "roll")))]
pub roll: i32,
#[cfg_attr(feature = "serde", serde(rename(serialize = "pitch")))]
pub pitch: i32,
#[cfg_attr(feature = "serde", serde(rename(serialize = "heading")))]
pub heading: i32,
#[cfg_attr(feature = "serde", serde(rename(serialize = "flags")))]
pub flags: u32,
}
impl ConcreteMessage for MsgProtectionLevel {
const MESSAGE_TYPE: u16 = 535;
const MESSAGE_NAME: &'static str = "MSG_PROTECTION_LEVEL";
}
impl SbpMessage for MsgProtectionLevel {
fn message_name(&self) -> &'static str {
<Self as ConcreteMessage>::MESSAGE_NAME
}
fn message_type(&self) -> u16 {
<Self as ConcreteMessage>::MESSAGE_TYPE
}
fn sender_id(&self) -> Option<u16> {
self.sender_id
}
fn set_sender_id(&mut self, new_id: u16) {
self.sender_id = Some(new_id);
}
fn encoded_len(&self) -> usize {
WireFormat::len(self) + crate::HEADER_LEN + crate::CRC_LEN
}
#[cfg(feature = "swiftnav")]
fn gps_time(&self) -> Option<std::result::Result<time::MessageTime, time::GpsTimeError>> {
let tow_s = (self.tow as f64) / 1000.0;
#[allow(clippy::useless_conversion)]
let wn: i16 = match self.wn.try_into() {
Ok(wn) => wn,
Err(e) => return Some(Err(e.into())),
};
let gps_time = match time::GpsTime::new(wn, tow_s) {
Ok(gps_time) => gps_time,
Err(e) => return Some(Err(e.into())),
};
Some(Ok(time::MessageTime::Rover(gps_time.into())))
}
}
impl TryFrom<Sbp> for MsgProtectionLevel {
type Error = TryFromSbpError;
fn try_from(msg: Sbp) -> Result<Self, Self::Error> {
match msg {
Sbp::MsgProtectionLevel(m) => Ok(m),
_ => Err(TryFromSbpError),
}
}
}
impl WireFormat for MsgProtectionLevel {
const MIN_LEN: usize = <u32 as WireFormat>::MIN_LEN
+ <i16 as WireFormat>::MIN_LEN
+ <u16 as WireFormat>::MIN_LEN
+ <u16 as WireFormat>::MIN_LEN
+ <u16 as WireFormat>::MIN_LEN
+ <u16 as WireFormat>::MIN_LEN
+ <u16 as WireFormat>::MIN_LEN
+ <u16 as WireFormat>::MIN_LEN
+ <u16 as WireFormat>::MIN_LEN
+ <u16 as WireFormat>::MIN_LEN
+ <u16 as WireFormat>::MIN_LEN
+ <f64 as WireFormat>::MIN_LEN
+ <f64 as WireFormat>::MIN_LEN
+ <f64 as WireFormat>::MIN_LEN
+ <i32 as WireFormat>::MIN_LEN
+ <i32 as WireFormat>::MIN_LEN
+ <i32 as WireFormat>::MIN_LEN
+ <i32 as WireFormat>::MIN_LEN
+ <i32 as WireFormat>::MIN_LEN
+ <i32 as WireFormat>::MIN_LEN
+ <u32 as WireFormat>::MIN_LEN;
fn len(&self) -> usize {
WireFormat::len(&self.tow)
+ WireFormat::len(&self.wn)
+ WireFormat::len(&self.hpl)
+ WireFormat::len(&self.vpl)
+ WireFormat::len(&self.atpl)
+ WireFormat::len(&self.ctpl)
+ WireFormat::len(&self.hvpl)
+ WireFormat::len(&self.vvpl)
+ WireFormat::len(&self.hopl)
+ WireFormat::len(&self.popl)
+ WireFormat::len(&self.ropl)
+ WireFormat::len(&self.lat)
+ WireFormat::len(&self.lon)
+ WireFormat::len(&self.height)
+ WireFormat::len(&self.v_x)
+ WireFormat::len(&self.v_y)
+ WireFormat::len(&self.v_z)
+ WireFormat::len(&self.roll)
+ WireFormat::len(&self.pitch)
+ WireFormat::len(&self.heading)
+ WireFormat::len(&self.flags)
}
fn write<B: BufMut>(&self, buf: &mut B) {
WireFormat::write(&self.tow, buf);
WireFormat::write(&self.wn, buf);
WireFormat::write(&self.hpl, buf);
WireFormat::write(&self.vpl, buf);
WireFormat::write(&self.atpl, buf);
WireFormat::write(&self.ctpl, buf);
WireFormat::write(&self.hvpl, buf);
WireFormat::write(&self.vvpl, buf);
WireFormat::write(&self.hopl, buf);
WireFormat::write(&self.popl, buf);
WireFormat::write(&self.ropl, buf);
WireFormat::write(&self.lat, buf);
WireFormat::write(&self.lon, buf);
WireFormat::write(&self.height, buf);
WireFormat::write(&self.v_x, buf);
WireFormat::write(&self.v_y, buf);
WireFormat::write(&self.v_z, buf);
WireFormat::write(&self.roll, buf);
WireFormat::write(&self.pitch, buf);
WireFormat::write(&self.heading, buf);
WireFormat::write(&self.flags, buf);
}
fn parse_unchecked<B: Buf>(buf: &mut B) -> Self {
MsgProtectionLevel {
sender_id: None,
tow: WireFormat::parse_unchecked(buf),
wn: WireFormat::parse_unchecked(buf),
hpl: WireFormat::parse_unchecked(buf),
vpl: WireFormat::parse_unchecked(buf),
atpl: WireFormat::parse_unchecked(buf),
ctpl: WireFormat::parse_unchecked(buf),
hvpl: WireFormat::parse_unchecked(buf),
vvpl: WireFormat::parse_unchecked(buf),
hopl: WireFormat::parse_unchecked(buf),
popl: WireFormat::parse_unchecked(buf),
ropl: WireFormat::parse_unchecked(buf),
lat: WireFormat::parse_unchecked(buf),
lon: WireFormat::parse_unchecked(buf),
height: WireFormat::parse_unchecked(buf),
v_x: WireFormat::parse_unchecked(buf),
v_y: WireFormat::parse_unchecked(buf),
v_z: WireFormat::parse_unchecked(buf),
roll: WireFormat::parse_unchecked(buf),
pitch: WireFormat::parse_unchecked(buf),
heading: WireFormat::parse_unchecked(buf),
flags: WireFormat::parse_unchecked(buf),
}
}
}
#[cfg_attr(feature = "serde", derive(serde::Serialize))]
#[derive(Debug, Clone)]
pub struct MsgProtectionLevelDepA {
#[cfg_attr(feature = "serde", serde(skip_serializing))]
pub sender_id: Option<u16>,
#[cfg_attr(feature = "serde", serde(rename(serialize = "tow")))]
pub tow: u32,
#[cfg_attr(feature = "serde", serde(rename(serialize = "vpl")))]
pub vpl: u16,
#[cfg_attr(feature = "serde", serde(rename(serialize = "hpl")))]
pub hpl: u16,
#[cfg_attr(feature = "serde", serde(rename(serialize = "lat")))]
pub lat: f64,
#[cfg_attr(feature = "serde", serde(rename(serialize = "lon")))]
pub lon: f64,
#[cfg_attr(feature = "serde", serde(rename(serialize = "height")))]
pub height: f64,
#[cfg_attr(feature = "serde", serde(rename(serialize = "flags")))]
pub flags: u8,
}
impl ConcreteMessage for MsgProtectionLevelDepA {
const MESSAGE_TYPE: u16 = 534;
const MESSAGE_NAME: &'static str = "MSG_PROTECTION_LEVEL_DEP_A";
}
impl SbpMessage for MsgProtectionLevelDepA {
fn message_name(&self) -> &'static str {
<Self as ConcreteMessage>::MESSAGE_NAME
}
fn message_type(&self) -> u16 {
<Self as ConcreteMessage>::MESSAGE_TYPE
}
fn sender_id(&self) -> Option<u16> {
self.sender_id
}
fn set_sender_id(&mut self, new_id: u16) {
self.sender_id = Some(new_id);
}
fn encoded_len(&self) -> usize {
WireFormat::len(self) + crate::HEADER_LEN + crate::CRC_LEN
}
#[cfg(feature = "swiftnav")]
fn gps_time(&self) -> Option<std::result::Result<time::MessageTime, time::GpsTimeError>> {
let tow_s = (self.tow as f64) / 1000.0;
let gps_time = match time::GpsTime::new(0, tow_s) {
Ok(gps_time) => gps_time.tow(),
Err(e) => return Some(Err(e.into())),
};
Some(Ok(time::MessageTime::Rover(gps_time.into())))
}
}
impl TryFrom<Sbp> for MsgProtectionLevelDepA {
type Error = TryFromSbpError;
fn try_from(msg: Sbp) -> Result<Self, Self::Error> {
match msg {
Sbp::MsgProtectionLevelDepA(m) => Ok(m),
_ => Err(TryFromSbpError),
}
}
}
impl WireFormat for MsgProtectionLevelDepA {
const MIN_LEN: usize = <u32 as WireFormat>::MIN_LEN
+ <u16 as WireFormat>::MIN_LEN
+ <u16 as WireFormat>::MIN_LEN
+ <f64 as WireFormat>::MIN_LEN
+ <f64 as WireFormat>::MIN_LEN
+ <f64 as WireFormat>::MIN_LEN
+ <u8 as WireFormat>::MIN_LEN;
fn len(&self) -> usize {
WireFormat::len(&self.tow)
+ WireFormat::len(&self.vpl)
+ WireFormat::len(&self.hpl)
+ WireFormat::len(&self.lat)
+ WireFormat::len(&self.lon)
+ WireFormat::len(&self.height)
+ WireFormat::len(&self.flags)
}
fn write<B: BufMut>(&self, buf: &mut B) {
WireFormat::write(&self.tow, buf);
WireFormat::write(&self.vpl, buf);
WireFormat::write(&self.hpl, buf);
WireFormat::write(&self.lat, buf);
WireFormat::write(&self.lon, buf);
WireFormat::write(&self.height, buf);
WireFormat::write(&self.flags, buf);
}
fn parse_unchecked<B: Buf>(buf: &mut B) -> Self {
MsgProtectionLevelDepA {
sender_id: None,
tow: WireFormat::parse_unchecked(buf),
vpl: WireFormat::parse_unchecked(buf),
hpl: WireFormat::parse_unchecked(buf),
lat: WireFormat::parse_unchecked(buf),
lon: WireFormat::parse_unchecked(buf),
height: WireFormat::parse_unchecked(buf),
flags: WireFormat::parse_unchecked(buf),
}
}
}
#[cfg_attr(feature = "serde", derive(serde::Serialize))]
#[derive(Debug, Clone)]
pub struct MsgUtcTime {
#[cfg_attr(feature = "serde", serde(skip_serializing))]
pub sender_id: Option<u16>,
#[cfg_attr(feature = "serde", serde(rename(serialize = "flags")))]
pub flags: u8,
#[cfg_attr(feature = "serde", serde(rename(serialize = "tow")))]
pub tow: u32,
#[cfg_attr(feature = "serde", serde(rename(serialize = "year")))]
pub year: u16,
#[cfg_attr(feature = "serde", serde(rename(serialize = "month")))]
pub month: u8,
#[cfg_attr(feature = "serde", serde(rename(serialize = "day")))]
pub day: u8,
#[cfg_attr(feature = "serde", serde(rename(serialize = "hours")))]
pub hours: u8,
#[cfg_attr(feature = "serde", serde(rename(serialize = "minutes")))]
pub minutes: u8,
#[cfg_attr(feature = "serde", serde(rename(serialize = "seconds")))]
pub seconds: u8,
#[cfg_attr(feature = "serde", serde(rename(serialize = "ns")))]
pub ns: u32,
}
impl ConcreteMessage for MsgUtcTime {
const MESSAGE_TYPE: u16 = 259;
const MESSAGE_NAME: &'static str = "MSG_UTC_TIME";
}
impl SbpMessage for MsgUtcTime {
fn message_name(&self) -> &'static str {
<Self as ConcreteMessage>::MESSAGE_NAME
}
fn message_type(&self) -> u16 {
<Self as ConcreteMessage>::MESSAGE_TYPE
}
fn sender_id(&self) -> Option<u16> {
self.sender_id
}
fn set_sender_id(&mut self, new_id: u16) {
self.sender_id = Some(new_id);
}
fn encoded_len(&self) -> usize {
WireFormat::len(self) + crate::HEADER_LEN + crate::CRC_LEN
}
#[cfg(feature = "swiftnav")]
fn gps_time(&self) -> Option<std::result::Result<time::MessageTime, time::GpsTimeError>> {
let tow_s = (self.tow as f64) / 1000.0;
let gps_time = match time::GpsTime::new(0, tow_s) {
Ok(gps_time) => gps_time.tow(),
Err(e) => return Some(Err(e.into())),
};
Some(Ok(time::MessageTime::Rover(gps_time.into())))
}
}
impl TryFrom<Sbp> for MsgUtcTime {
type Error = TryFromSbpError;
fn try_from(msg: Sbp) -> Result<Self, Self::Error> {
match msg {
Sbp::MsgUtcTime(m) => Ok(m),
_ => Err(TryFromSbpError),
}
}
}
impl WireFormat for MsgUtcTime {
const MIN_LEN: usize = <u8 as WireFormat>::MIN_LEN
+ <u32 as WireFormat>::MIN_LEN
+ <u16 as WireFormat>::MIN_LEN
+ <u8 as WireFormat>::MIN_LEN
+ <u8 as WireFormat>::MIN_LEN
+ <u8 as WireFormat>::MIN_LEN
+ <u8 as WireFormat>::MIN_LEN
+ <u8 as WireFormat>::MIN_LEN
+ <u32 as WireFormat>::MIN_LEN;
fn len(&self) -> usize {
WireFormat::len(&self.flags)
+ WireFormat::len(&self.tow)
+ WireFormat::len(&self.year)
+ WireFormat::len(&self.month)
+ WireFormat::len(&self.day)
+ WireFormat::len(&self.hours)
+ WireFormat::len(&self.minutes)
+ WireFormat::len(&self.seconds)
+ WireFormat::len(&self.ns)
}
fn write<B: BufMut>(&self, buf: &mut B) {
WireFormat::write(&self.flags, buf);
WireFormat::write(&self.tow, buf);
WireFormat::write(&self.year, buf);
WireFormat::write(&self.month, buf);
WireFormat::write(&self.day, buf);
WireFormat::write(&self.hours, buf);
WireFormat::write(&self.minutes, buf);
WireFormat::write(&self.seconds, buf);
WireFormat::write(&self.ns, buf);
}
fn parse_unchecked<B: Buf>(buf: &mut B) -> Self {
MsgUtcTime {
sender_id: None,
flags: WireFormat::parse_unchecked(buf),
tow: WireFormat::parse_unchecked(buf),
year: WireFormat::parse_unchecked(buf),
month: WireFormat::parse_unchecked(buf),
day: WireFormat::parse_unchecked(buf),
hours: WireFormat::parse_unchecked(buf),
minutes: WireFormat::parse_unchecked(buf),
seconds: WireFormat::parse_unchecked(buf),
ns: WireFormat::parse_unchecked(buf),
}
}
}
#[cfg_attr(feature = "serde", derive(serde::Serialize))]
#[derive(Debug, Clone)]
pub struct MsgUtcTimeGnss {
#[cfg_attr(feature = "serde", serde(skip_serializing))]
pub sender_id: Option<u16>,
#[cfg_attr(feature = "serde", serde(rename(serialize = "flags")))]
pub flags: u8,
#[cfg_attr(feature = "serde", serde(rename(serialize = "tow")))]
pub tow: u32,
#[cfg_attr(feature = "serde", serde(rename(serialize = "year")))]
pub year: u16,
#[cfg_attr(feature = "serde", serde(rename(serialize = "month")))]
pub month: u8,
#[cfg_attr(feature = "serde", serde(rename(serialize = "day")))]
pub day: u8,
#[cfg_attr(feature = "serde", serde(rename(serialize = "hours")))]
pub hours: u8,
#[cfg_attr(feature = "serde", serde(rename(serialize = "minutes")))]
pub minutes: u8,
#[cfg_attr(feature = "serde", serde(rename(serialize = "seconds")))]
pub seconds: u8,
#[cfg_attr(feature = "serde", serde(rename(serialize = "ns")))]
pub ns: u32,
}
impl ConcreteMessage for MsgUtcTimeGnss {
const MESSAGE_TYPE: u16 = 261;
const MESSAGE_NAME: &'static str = "MSG_UTC_TIME_GNSS";
}
impl SbpMessage for MsgUtcTimeGnss {
fn message_name(&self) -> &'static str {
<Self as ConcreteMessage>::MESSAGE_NAME
}
fn message_type(&self) -> u16 {
<Self as ConcreteMessage>::MESSAGE_TYPE
}
fn sender_id(&self) -> Option<u16> {
self.sender_id
}
fn set_sender_id(&mut self, new_id: u16) {
self.sender_id = Some(new_id);
}
fn encoded_len(&self) -> usize {
WireFormat::len(self) + crate::HEADER_LEN + crate::CRC_LEN
}
#[cfg(feature = "swiftnav")]
fn gps_time(&self) -> Option<std::result::Result<time::MessageTime, time::GpsTimeError>> {
let tow_s = (self.tow as f64) / 1000.0;
let gps_time = match time::GpsTime::new(0, tow_s) {
Ok(gps_time) => gps_time.tow(),
Err(e) => return Some(Err(e.into())),
};
Some(Ok(time::MessageTime::Rover(gps_time.into())))
}
}
impl TryFrom<Sbp> for MsgUtcTimeGnss {
type Error = TryFromSbpError;
fn try_from(msg: Sbp) -> Result<Self, Self::Error> {
match msg {
Sbp::MsgUtcTimeGnss(m) => Ok(m),
_ => Err(TryFromSbpError),
}
}
}
impl WireFormat for MsgUtcTimeGnss {
const MIN_LEN: usize = <u8 as WireFormat>::MIN_LEN
+ <u32 as WireFormat>::MIN_LEN
+ <u16 as WireFormat>::MIN_LEN
+ <u8 as WireFormat>::MIN_LEN
+ <u8 as WireFormat>::MIN_LEN
+ <u8 as WireFormat>::MIN_LEN
+ <u8 as WireFormat>::MIN_LEN
+ <u8 as WireFormat>::MIN_LEN
+ <u32 as WireFormat>::MIN_LEN;
fn len(&self) -> usize {
WireFormat::len(&self.flags)
+ WireFormat::len(&self.tow)
+ WireFormat::len(&self.year)
+ WireFormat::len(&self.month)
+ WireFormat::len(&self.day)
+ WireFormat::len(&self.hours)
+ WireFormat::len(&self.minutes)
+ WireFormat::len(&self.seconds)
+ WireFormat::len(&self.ns)
}
fn write<B: BufMut>(&self, buf: &mut B) {
WireFormat::write(&self.flags, buf);
WireFormat::write(&self.tow, buf);
WireFormat::write(&self.year, buf);
WireFormat::write(&self.month, buf);
WireFormat::write(&self.day, buf);
WireFormat::write(&self.hours, buf);
WireFormat::write(&self.minutes, buf);
WireFormat::write(&self.seconds, buf);
WireFormat::write(&self.ns, buf);
}
fn parse_unchecked<B: Buf>(buf: &mut B) -> Self {
MsgUtcTimeGnss {
sender_id: None,
flags: WireFormat::parse_unchecked(buf),
tow: WireFormat::parse_unchecked(buf),
year: WireFormat::parse_unchecked(buf),
month: WireFormat::parse_unchecked(buf),
day: WireFormat::parse_unchecked(buf),
hours: WireFormat::parse_unchecked(buf),
minutes: WireFormat::parse_unchecked(buf),
seconds: WireFormat::parse_unchecked(buf),
ns: WireFormat::parse_unchecked(buf),
}
}
}
#[cfg_attr(feature = "serde", derive(serde::Serialize))]
#[derive(Debug, Clone)]
pub struct MsgVelBody {
#[cfg_attr(feature = "serde", serde(skip_serializing))]
pub sender_id: Option<u16>,
#[cfg_attr(feature = "serde", serde(rename(serialize = "tow")))]
pub tow: u32,
#[cfg_attr(feature = "serde", serde(rename(serialize = "x")))]
pub x: i32,
#[cfg_attr(feature = "serde", serde(rename(serialize = "y")))]
pub y: i32,
#[cfg_attr(feature = "serde", serde(rename(serialize = "z")))]
pub z: i32,
#[cfg_attr(feature = "serde", serde(rename(serialize = "cov_x_x")))]
pub cov_x_x: f32,
#[cfg_attr(feature = "serde", serde(rename(serialize = "cov_x_y")))]
pub cov_x_y: f32,
#[cfg_attr(feature = "serde", serde(rename(serialize = "cov_x_z")))]
pub cov_x_z: f32,
#[cfg_attr(feature = "serde", serde(rename(serialize = "cov_y_y")))]
pub cov_y_y: f32,
#[cfg_attr(feature = "serde", serde(rename(serialize = "cov_y_z")))]
pub cov_y_z: f32,
#[cfg_attr(feature = "serde", serde(rename(serialize = "cov_z_z")))]
pub cov_z_z: f32,
#[cfg_attr(feature = "serde", serde(rename(serialize = "n_sats")))]
pub n_sats: u8,
#[cfg_attr(feature = "serde", serde(rename(serialize = "flags")))]
pub flags: u8,
}
impl ConcreteMessage for MsgVelBody {
const MESSAGE_TYPE: u16 = 531;
const MESSAGE_NAME: &'static str = "MSG_VEL_BODY";
}
impl SbpMessage for MsgVelBody {
fn message_name(&self) -> &'static str {
<Self as ConcreteMessage>::MESSAGE_NAME
}
fn message_type(&self) -> u16 {
<Self as ConcreteMessage>::MESSAGE_TYPE
}
fn sender_id(&self) -> Option<u16> {
self.sender_id
}
fn set_sender_id(&mut self, new_id: u16) {
self.sender_id = Some(new_id);
}
fn encoded_len(&self) -> usize {
WireFormat::len(self) + crate::HEADER_LEN + crate::CRC_LEN
}
#[cfg(feature = "swiftnav")]
fn gps_time(&self) -> Option<std::result::Result<time::MessageTime, time::GpsTimeError>> {
let tow_s = (self.tow as f64) / 1000.0;
let gps_time = match time::GpsTime::new(0, tow_s) {
Ok(gps_time) => gps_time.tow(),
Err(e) => return Some(Err(e.into())),
};
Some(Ok(time::MessageTime::Rover(gps_time.into())))
}
}
impl TryFrom<Sbp> for MsgVelBody {
type Error = TryFromSbpError;
fn try_from(msg: Sbp) -> Result<Self, Self::Error> {
match msg {
Sbp::MsgVelBody(m) => Ok(m),
_ => Err(TryFromSbpError),
}
}
}
impl WireFormat for MsgVelBody {
const MIN_LEN: usize = <u32 as WireFormat>::MIN_LEN
+ <i32 as WireFormat>::MIN_LEN
+ <i32 as WireFormat>::MIN_LEN
+ <i32 as WireFormat>::MIN_LEN
+ <f32 as WireFormat>::MIN_LEN
+ <f32 as WireFormat>::MIN_LEN
+ <f32 as WireFormat>::MIN_LEN
+ <f32 as WireFormat>::MIN_LEN
+ <f32 as WireFormat>::MIN_LEN
+ <f32 as WireFormat>::MIN_LEN
+ <u8 as WireFormat>::MIN_LEN
+ <u8 as WireFormat>::MIN_LEN;
fn len(&self) -> usize {
WireFormat::len(&self.tow)
+ WireFormat::len(&self.x)
+ WireFormat::len(&self.y)
+ WireFormat::len(&self.z)
+ WireFormat::len(&self.cov_x_x)
+ WireFormat::len(&self.cov_x_y)
+ WireFormat::len(&self.cov_x_z)
+ WireFormat::len(&self.cov_y_y)
+ WireFormat::len(&self.cov_y_z)
+ WireFormat::len(&self.cov_z_z)
+ WireFormat::len(&self.n_sats)
+ WireFormat::len(&self.flags)
}
fn write<B: BufMut>(&self, buf: &mut B) {
WireFormat::write(&self.tow, buf);
WireFormat::write(&self.x, buf);
WireFormat::write(&self.y, buf);
WireFormat::write(&self.z, buf);
WireFormat::write(&self.cov_x_x, buf);
WireFormat::write(&self.cov_x_y, buf);
WireFormat::write(&self.cov_x_z, buf);
WireFormat::write(&self.cov_y_y, buf);
WireFormat::write(&self.cov_y_z, buf);
WireFormat::write(&self.cov_z_z, buf);
WireFormat::write(&self.n_sats, buf);
WireFormat::write(&self.flags, buf);
}
fn parse_unchecked<B: Buf>(buf: &mut B) -> Self {
MsgVelBody {
sender_id: None,
tow: WireFormat::parse_unchecked(buf),
x: WireFormat::parse_unchecked(buf),
y: WireFormat::parse_unchecked(buf),
z: WireFormat::parse_unchecked(buf),
cov_x_x: WireFormat::parse_unchecked(buf),
cov_x_y: WireFormat::parse_unchecked(buf),
cov_x_z: WireFormat::parse_unchecked(buf),
cov_y_y: WireFormat::parse_unchecked(buf),
cov_y_z: WireFormat::parse_unchecked(buf),
cov_z_z: WireFormat::parse_unchecked(buf),
n_sats: WireFormat::parse_unchecked(buf),
flags: WireFormat::parse_unchecked(buf),
}
}
}
#[cfg_attr(feature = "serde", derive(serde::Serialize))]
#[derive(Debug, Clone)]
pub struct MsgVelEcef {
#[cfg_attr(feature = "serde", serde(skip_serializing))]
pub sender_id: Option<u16>,
#[cfg_attr(feature = "serde", serde(rename(serialize = "tow")))]
pub tow: u32,
#[cfg_attr(feature = "serde", serde(rename(serialize = "x")))]
pub x: i32,
#[cfg_attr(feature = "serde", serde(rename(serialize = "y")))]
pub y: i32,
#[cfg_attr(feature = "serde", serde(rename(serialize = "z")))]
pub z: i32,
#[cfg_attr(feature = "serde", serde(rename(serialize = "accuracy")))]
pub accuracy: u16,
#[cfg_attr(feature = "serde", serde(rename(serialize = "n_sats")))]
pub n_sats: u8,
#[cfg_attr(feature = "serde", serde(rename(serialize = "flags")))]
pub flags: u8,
}
impl ConcreteMessage for MsgVelEcef {
const MESSAGE_TYPE: u16 = 525;
const MESSAGE_NAME: &'static str = "MSG_VEL_ECEF";
}
impl SbpMessage for MsgVelEcef {
fn message_name(&self) -> &'static str {
<Self as ConcreteMessage>::MESSAGE_NAME
}
fn message_type(&self) -> u16 {
<Self as ConcreteMessage>::MESSAGE_TYPE
}
fn sender_id(&self) -> Option<u16> {
self.sender_id
}
fn set_sender_id(&mut self, new_id: u16) {
self.sender_id = Some(new_id);
}
fn encoded_len(&self) -> usize {
WireFormat::len(self) + crate::HEADER_LEN + crate::CRC_LEN
}
#[cfg(feature = "swiftnav")]
fn gps_time(&self) -> Option<std::result::Result<time::MessageTime, time::GpsTimeError>> {
let tow_s = (self.tow as f64) / 1000.0;
let gps_time = match time::GpsTime::new(0, tow_s) {
Ok(gps_time) => gps_time.tow(),
Err(e) => return Some(Err(e.into())),
};
Some(Ok(time::MessageTime::Rover(gps_time.into())))
}
}
impl TryFrom<Sbp> for MsgVelEcef {
type Error = TryFromSbpError;
fn try_from(msg: Sbp) -> Result<Self, Self::Error> {
match msg {
Sbp::MsgVelEcef(m) => Ok(m),
_ => Err(TryFromSbpError),
}
}
}
impl WireFormat for MsgVelEcef {
const MIN_LEN: usize = <u32 as WireFormat>::MIN_LEN
+ <i32 as WireFormat>::MIN_LEN
+ <i32 as WireFormat>::MIN_LEN
+ <i32 as WireFormat>::MIN_LEN
+ <u16 as WireFormat>::MIN_LEN
+ <u8 as WireFormat>::MIN_LEN
+ <u8 as WireFormat>::MIN_LEN;
fn len(&self) -> usize {
WireFormat::len(&self.tow)
+ WireFormat::len(&self.x)
+ WireFormat::len(&self.y)
+ WireFormat::len(&self.z)
+ WireFormat::len(&self.accuracy)
+ WireFormat::len(&self.n_sats)
+ WireFormat::len(&self.flags)
}
fn write<B: BufMut>(&self, buf: &mut B) {
WireFormat::write(&self.tow, buf);
WireFormat::write(&self.x, buf);
WireFormat::write(&self.y, buf);
WireFormat::write(&self.z, buf);
WireFormat::write(&self.accuracy, buf);
WireFormat::write(&self.n_sats, buf);
WireFormat::write(&self.flags, buf);
}
fn parse_unchecked<B: Buf>(buf: &mut B) -> Self {
MsgVelEcef {
sender_id: None,
tow: WireFormat::parse_unchecked(buf),
x: WireFormat::parse_unchecked(buf),
y: WireFormat::parse_unchecked(buf),
z: WireFormat::parse_unchecked(buf),
accuracy: WireFormat::parse_unchecked(buf),
n_sats: WireFormat::parse_unchecked(buf),
flags: WireFormat::parse_unchecked(buf),
}
}
}
#[cfg_attr(feature = "serde", derive(serde::Serialize))]
#[derive(Debug, Clone)]
pub struct MsgVelEcefCov {
#[cfg_attr(feature = "serde", serde(skip_serializing))]
pub sender_id: Option<u16>,
#[cfg_attr(feature = "serde", serde(rename(serialize = "tow")))]
pub tow: u32,
#[cfg_attr(feature = "serde", serde(rename(serialize = "x")))]
pub x: i32,
#[cfg_attr(feature = "serde", serde(rename(serialize = "y")))]
pub y: i32,
#[cfg_attr(feature = "serde", serde(rename(serialize = "z")))]
pub z: i32,
#[cfg_attr(feature = "serde", serde(rename(serialize = "cov_x_x")))]
pub cov_x_x: f32,
#[cfg_attr(feature = "serde", serde(rename(serialize = "cov_x_y")))]
pub cov_x_y: f32,
#[cfg_attr(feature = "serde", serde(rename(serialize = "cov_x_z")))]
pub cov_x_z: f32,
#[cfg_attr(feature = "serde", serde(rename(serialize = "cov_y_y")))]
pub cov_y_y: f32,
#[cfg_attr(feature = "serde", serde(rename(serialize = "cov_y_z")))]
pub cov_y_z: f32,
#[cfg_attr(feature = "serde", serde(rename(serialize = "cov_z_z")))]
pub cov_z_z: f32,
#[cfg_attr(feature = "serde", serde(rename(serialize = "n_sats")))]
pub n_sats: u8,
#[cfg_attr(feature = "serde", serde(rename(serialize = "flags")))]
pub flags: u8,
}
impl ConcreteMessage for MsgVelEcefCov {
const MESSAGE_TYPE: u16 = 533;
const MESSAGE_NAME: &'static str = "MSG_VEL_ECEF_COV";
}
impl SbpMessage for MsgVelEcefCov {
fn message_name(&self) -> &'static str {
<Self as ConcreteMessage>::MESSAGE_NAME
}
fn message_type(&self) -> u16 {
<Self as ConcreteMessage>::MESSAGE_TYPE
}
fn sender_id(&self) -> Option<u16> {
self.sender_id
}
fn set_sender_id(&mut self, new_id: u16) {
self.sender_id = Some(new_id);
}
fn encoded_len(&self) -> usize {
WireFormat::len(self) + crate::HEADER_LEN + crate::CRC_LEN
}
#[cfg(feature = "swiftnav")]
fn gps_time(&self) -> Option<std::result::Result<time::MessageTime, time::GpsTimeError>> {
let tow_s = (self.tow as f64) / 1000.0;
let gps_time = match time::GpsTime::new(0, tow_s) {
Ok(gps_time) => gps_time.tow(),
Err(e) => return Some(Err(e.into())),
};
Some(Ok(time::MessageTime::Rover(gps_time.into())))
}
}
impl TryFrom<Sbp> for MsgVelEcefCov {
type Error = TryFromSbpError;
fn try_from(msg: Sbp) -> Result<Self, Self::Error> {
match msg {
Sbp::MsgVelEcefCov(m) => Ok(m),
_ => Err(TryFromSbpError),
}
}
}
impl WireFormat for MsgVelEcefCov {
const MIN_LEN: usize = <u32 as WireFormat>::MIN_LEN
+ <i32 as WireFormat>::MIN_LEN
+ <i32 as WireFormat>::MIN_LEN
+ <i32 as WireFormat>::MIN_LEN
+ <f32 as WireFormat>::MIN_LEN
+ <f32 as WireFormat>::MIN_LEN
+ <f32 as WireFormat>::MIN_LEN
+ <f32 as WireFormat>::MIN_LEN
+ <f32 as WireFormat>::MIN_LEN
+ <f32 as WireFormat>::MIN_LEN
+ <u8 as WireFormat>::MIN_LEN
+ <u8 as WireFormat>::MIN_LEN;
fn len(&self) -> usize {
WireFormat::len(&self.tow)
+ WireFormat::len(&self.x)
+ WireFormat::len(&self.y)
+ WireFormat::len(&self.z)
+ WireFormat::len(&self.cov_x_x)
+ WireFormat::len(&self.cov_x_y)
+ WireFormat::len(&self.cov_x_z)
+ WireFormat::len(&self.cov_y_y)
+ WireFormat::len(&self.cov_y_z)
+ WireFormat::len(&self.cov_z_z)
+ WireFormat::len(&self.n_sats)
+ WireFormat::len(&self.flags)
}
fn write<B: BufMut>(&self, buf: &mut B) {
WireFormat::write(&self.tow, buf);
WireFormat::write(&self.x, buf);
WireFormat::write(&self.y, buf);
WireFormat::write(&self.z, buf);
WireFormat::write(&self.cov_x_x, buf);
WireFormat::write(&self.cov_x_y, buf);
WireFormat::write(&self.cov_x_z, buf);
WireFormat::write(&self.cov_y_y, buf);
WireFormat::write(&self.cov_y_z, buf);
WireFormat::write(&self.cov_z_z, buf);
WireFormat::write(&self.n_sats, buf);
WireFormat::write(&self.flags, buf);
}
fn parse_unchecked<B: Buf>(buf: &mut B) -> Self {
MsgVelEcefCov {
sender_id: None,
tow: WireFormat::parse_unchecked(buf),
x: WireFormat::parse_unchecked(buf),
y: WireFormat::parse_unchecked(buf),
z: WireFormat::parse_unchecked(buf),
cov_x_x: WireFormat::parse_unchecked(buf),
cov_x_y: WireFormat::parse_unchecked(buf),
cov_x_z: WireFormat::parse_unchecked(buf),
cov_y_y: WireFormat::parse_unchecked(buf),
cov_y_z: WireFormat::parse_unchecked(buf),
cov_z_z: WireFormat::parse_unchecked(buf),
n_sats: WireFormat::parse_unchecked(buf),
flags: WireFormat::parse_unchecked(buf),
}
}
}
#[cfg_attr(feature = "serde", derive(serde::Serialize))]
#[derive(Debug, Clone)]
pub struct MsgVelEcefCovGnss {
#[cfg_attr(feature = "serde", serde(skip_serializing))]
pub sender_id: Option<u16>,
#[cfg_attr(feature = "serde", serde(rename(serialize = "tow")))]
pub tow: u32,
#[cfg_attr(feature = "serde", serde(rename(serialize = "x")))]
pub x: i32,
#[cfg_attr(feature = "serde", serde(rename(serialize = "y")))]
pub y: i32,
#[cfg_attr(feature = "serde", serde(rename(serialize = "z")))]
pub z: i32,
#[cfg_attr(feature = "serde", serde(rename(serialize = "cov_x_x")))]
pub cov_x_x: f32,
#[cfg_attr(feature = "serde", serde(rename(serialize = "cov_x_y")))]
pub cov_x_y: f32,
#[cfg_attr(feature = "serde", serde(rename(serialize = "cov_x_z")))]
pub cov_x_z: f32,
#[cfg_attr(feature = "serde", serde(rename(serialize = "cov_y_y")))]
pub cov_y_y: f32,
#[cfg_attr(feature = "serde", serde(rename(serialize = "cov_y_z")))]
pub cov_y_z: f32,
#[cfg_attr(feature = "serde", serde(rename(serialize = "cov_z_z")))]
pub cov_z_z: f32,
#[cfg_attr(feature = "serde", serde(rename(serialize = "n_sats")))]
pub n_sats: u8,
#[cfg_attr(feature = "serde", serde(rename(serialize = "flags")))]
pub flags: u8,
}
impl ConcreteMessage for MsgVelEcefCovGnss {
const MESSAGE_TYPE: u16 = 565;
const MESSAGE_NAME: &'static str = "MSG_VEL_ECEF_COV_GNSS";
}
impl SbpMessage for MsgVelEcefCovGnss {
fn message_name(&self) -> &'static str {
<Self as ConcreteMessage>::MESSAGE_NAME
}
fn message_type(&self) -> u16 {
<Self as ConcreteMessage>::MESSAGE_TYPE
}
fn sender_id(&self) -> Option<u16> {
self.sender_id
}
fn set_sender_id(&mut self, new_id: u16) {
self.sender_id = Some(new_id);
}
fn encoded_len(&self) -> usize {
WireFormat::len(self) + crate::HEADER_LEN + crate::CRC_LEN
}
#[cfg(feature = "swiftnav")]
fn gps_time(&self) -> Option<std::result::Result<time::MessageTime, time::GpsTimeError>> {
let tow_s = (self.tow as f64) / 1000.0;
let gps_time = match time::GpsTime::new(0, tow_s) {
Ok(gps_time) => gps_time.tow(),
Err(e) => return Some(Err(e.into())),
};
Some(Ok(time::MessageTime::Rover(gps_time.into())))
}
}
impl TryFrom<Sbp> for MsgVelEcefCovGnss {
type Error = TryFromSbpError;
fn try_from(msg: Sbp) -> Result<Self, Self::Error> {
match msg {
Sbp::MsgVelEcefCovGnss(m) => Ok(m),
_ => Err(TryFromSbpError),
}
}
}
impl WireFormat for MsgVelEcefCovGnss {
const MIN_LEN: usize = <u32 as WireFormat>::MIN_LEN
+ <i32 as WireFormat>::MIN_LEN
+ <i32 as WireFormat>::MIN_LEN
+ <i32 as WireFormat>::MIN_LEN
+ <f32 as WireFormat>::MIN_LEN
+ <f32 as WireFormat>::MIN_LEN
+ <f32 as WireFormat>::MIN_LEN
+ <f32 as WireFormat>::MIN_LEN
+ <f32 as WireFormat>::MIN_LEN
+ <f32 as WireFormat>::MIN_LEN
+ <u8 as WireFormat>::MIN_LEN
+ <u8 as WireFormat>::MIN_LEN;
fn len(&self) -> usize {
WireFormat::len(&self.tow)
+ WireFormat::len(&self.x)
+ WireFormat::len(&self.y)
+ WireFormat::len(&self.z)
+ WireFormat::len(&self.cov_x_x)
+ WireFormat::len(&self.cov_x_y)
+ WireFormat::len(&self.cov_x_z)
+ WireFormat::len(&self.cov_y_y)
+ WireFormat::len(&self.cov_y_z)
+ WireFormat::len(&self.cov_z_z)
+ WireFormat::len(&self.n_sats)
+ WireFormat::len(&self.flags)
}
fn write<B: BufMut>(&self, buf: &mut B) {
WireFormat::write(&self.tow, buf);
WireFormat::write(&self.x, buf);
WireFormat::write(&self.y, buf);
WireFormat::write(&self.z, buf);
WireFormat::write(&self.cov_x_x, buf);
WireFormat::write(&self.cov_x_y, buf);
WireFormat::write(&self.cov_x_z, buf);
WireFormat::write(&self.cov_y_y, buf);
WireFormat::write(&self.cov_y_z, buf);
WireFormat::write(&self.cov_z_z, buf);
WireFormat::write(&self.n_sats, buf);
WireFormat::write(&self.flags, buf);
}
fn parse_unchecked<B: Buf>(buf: &mut B) -> Self {
MsgVelEcefCovGnss {
sender_id: None,
tow: WireFormat::parse_unchecked(buf),
x: WireFormat::parse_unchecked(buf),
y: WireFormat::parse_unchecked(buf),
z: WireFormat::parse_unchecked(buf),
cov_x_x: WireFormat::parse_unchecked(buf),
cov_x_y: WireFormat::parse_unchecked(buf),
cov_x_z: WireFormat::parse_unchecked(buf),
cov_y_y: WireFormat::parse_unchecked(buf),
cov_y_z: WireFormat::parse_unchecked(buf),
cov_z_z: WireFormat::parse_unchecked(buf),
n_sats: WireFormat::parse_unchecked(buf),
flags: WireFormat::parse_unchecked(buf),
}
}
}
#[cfg_attr(feature = "serde", derive(serde::Serialize))]
#[derive(Debug, Clone)]
pub struct MsgVelEcefDepA {
#[cfg_attr(feature = "serde", serde(skip_serializing))]
pub sender_id: Option<u16>,
#[cfg_attr(feature = "serde", serde(rename(serialize = "tow")))]
pub tow: u32,
#[cfg_attr(feature = "serde", serde(rename(serialize = "x")))]
pub x: i32,
#[cfg_attr(feature = "serde", serde(rename(serialize = "y")))]
pub y: i32,
#[cfg_attr(feature = "serde", serde(rename(serialize = "z")))]
pub z: i32,
#[cfg_attr(feature = "serde", serde(rename(serialize = "accuracy")))]
pub accuracy: u16,
#[cfg_attr(feature = "serde", serde(rename(serialize = "n_sats")))]
pub n_sats: u8,
#[cfg_attr(feature = "serde", serde(rename(serialize = "flags")))]
pub flags: u8,
}
impl ConcreteMessage for MsgVelEcefDepA {
const MESSAGE_TYPE: u16 = 516;
const MESSAGE_NAME: &'static str = "MSG_VEL_ECEF_DEP_A";
}
impl SbpMessage for MsgVelEcefDepA {
fn message_name(&self) -> &'static str {
<Self as ConcreteMessage>::MESSAGE_NAME
}
fn message_type(&self) -> u16 {
<Self as ConcreteMessage>::MESSAGE_TYPE
}
fn sender_id(&self) -> Option<u16> {
self.sender_id
}
fn set_sender_id(&mut self, new_id: u16) {
self.sender_id = Some(new_id);
}
fn encoded_len(&self) -> usize {
WireFormat::len(self) + crate::HEADER_LEN + crate::CRC_LEN
}
#[cfg(feature = "swiftnav")]
fn gps_time(&self) -> Option<std::result::Result<time::MessageTime, time::GpsTimeError>> {
let tow_s = (self.tow as f64) / 1000.0;
let gps_time = match time::GpsTime::new(0, tow_s) {
Ok(gps_time) => gps_time.tow(),
Err(e) => return Some(Err(e.into())),
};
Some(Ok(time::MessageTime::Rover(gps_time.into())))
}
}
impl TryFrom<Sbp> for MsgVelEcefDepA {
type Error = TryFromSbpError;
fn try_from(msg: Sbp) -> Result<Self, Self::Error> {
match msg {
Sbp::MsgVelEcefDepA(m) => Ok(m),
_ => Err(TryFromSbpError),
}
}
}
impl WireFormat for MsgVelEcefDepA {
const MIN_LEN: usize = <u32 as WireFormat>::MIN_LEN
+ <i32 as WireFormat>::MIN_LEN
+ <i32 as WireFormat>::MIN_LEN
+ <i32 as WireFormat>::MIN_LEN
+ <u16 as WireFormat>::MIN_LEN
+ <u8 as WireFormat>::MIN_LEN
+ <u8 as WireFormat>::MIN_LEN;
fn len(&self) -> usize {
WireFormat::len(&self.tow)
+ WireFormat::len(&self.x)
+ WireFormat::len(&self.y)
+ WireFormat::len(&self.z)
+ WireFormat::len(&self.accuracy)
+ WireFormat::len(&self.n_sats)
+ WireFormat::len(&self.flags)
}
fn write<B: BufMut>(&self, buf: &mut B) {
WireFormat::write(&self.tow, buf);
WireFormat::write(&self.x, buf);
WireFormat::write(&self.y, buf);
WireFormat::write(&self.z, buf);
WireFormat::write(&self.accuracy, buf);
WireFormat::write(&self.n_sats, buf);
WireFormat::write(&self.flags, buf);
}
fn parse_unchecked<B: Buf>(buf: &mut B) -> Self {
MsgVelEcefDepA {
sender_id: None,
tow: WireFormat::parse_unchecked(buf),
x: WireFormat::parse_unchecked(buf),
y: WireFormat::parse_unchecked(buf),
z: WireFormat::parse_unchecked(buf),
accuracy: WireFormat::parse_unchecked(buf),
n_sats: WireFormat::parse_unchecked(buf),
flags: WireFormat::parse_unchecked(buf),
}
}
}
#[cfg_attr(feature = "serde", derive(serde::Serialize))]
#[derive(Debug, Clone)]
pub struct MsgVelEcefGnss {
#[cfg_attr(feature = "serde", serde(skip_serializing))]
pub sender_id: Option<u16>,
#[cfg_attr(feature = "serde", serde(rename(serialize = "tow")))]
pub tow: u32,
#[cfg_attr(feature = "serde", serde(rename(serialize = "x")))]
pub x: i32,
#[cfg_attr(feature = "serde", serde(rename(serialize = "y")))]
pub y: i32,
#[cfg_attr(feature = "serde", serde(rename(serialize = "z")))]
pub z: i32,
#[cfg_attr(feature = "serde", serde(rename(serialize = "accuracy")))]
pub accuracy: u16,
#[cfg_attr(feature = "serde", serde(rename(serialize = "n_sats")))]
pub n_sats: u8,
#[cfg_attr(feature = "serde", serde(rename(serialize = "flags")))]
pub flags: u8,
}
impl ConcreteMessage for MsgVelEcefGnss {
const MESSAGE_TYPE: u16 = 557;
const MESSAGE_NAME: &'static str = "MSG_VEL_ECEF_GNSS";
}
impl SbpMessage for MsgVelEcefGnss {
fn message_name(&self) -> &'static str {
<Self as ConcreteMessage>::MESSAGE_NAME
}
fn message_type(&self) -> u16 {
<Self as ConcreteMessage>::MESSAGE_TYPE
}
fn sender_id(&self) -> Option<u16> {
self.sender_id
}
fn set_sender_id(&mut self, new_id: u16) {
self.sender_id = Some(new_id);
}
fn encoded_len(&self) -> usize {
WireFormat::len(self) + crate::HEADER_LEN + crate::CRC_LEN
}
#[cfg(feature = "swiftnav")]
fn gps_time(&self) -> Option<std::result::Result<time::MessageTime, time::GpsTimeError>> {
let tow_s = (self.tow as f64) / 1000.0;
let gps_time = match time::GpsTime::new(0, tow_s) {
Ok(gps_time) => gps_time.tow(),
Err(e) => return Some(Err(e.into())),
};
Some(Ok(time::MessageTime::Rover(gps_time.into())))
}
}
impl TryFrom<Sbp> for MsgVelEcefGnss {
type Error = TryFromSbpError;
fn try_from(msg: Sbp) -> Result<Self, Self::Error> {
match msg {
Sbp::MsgVelEcefGnss(m) => Ok(m),
_ => Err(TryFromSbpError),
}
}
}
impl WireFormat for MsgVelEcefGnss {
const MIN_LEN: usize = <u32 as WireFormat>::MIN_LEN
+ <i32 as WireFormat>::MIN_LEN
+ <i32 as WireFormat>::MIN_LEN
+ <i32 as WireFormat>::MIN_LEN
+ <u16 as WireFormat>::MIN_LEN
+ <u8 as WireFormat>::MIN_LEN
+ <u8 as WireFormat>::MIN_LEN;
fn len(&self) -> usize {
WireFormat::len(&self.tow)
+ WireFormat::len(&self.x)
+ WireFormat::len(&self.y)
+ WireFormat::len(&self.z)
+ WireFormat::len(&self.accuracy)
+ WireFormat::len(&self.n_sats)
+ WireFormat::len(&self.flags)
}
fn write<B: BufMut>(&self, buf: &mut B) {
WireFormat::write(&self.tow, buf);
WireFormat::write(&self.x, buf);
WireFormat::write(&self.y, buf);
WireFormat::write(&self.z, buf);
WireFormat::write(&self.accuracy, buf);
WireFormat::write(&self.n_sats, buf);
WireFormat::write(&self.flags, buf);
}
fn parse_unchecked<B: Buf>(buf: &mut B) -> Self {
MsgVelEcefGnss {
sender_id: None,
tow: WireFormat::parse_unchecked(buf),
x: WireFormat::parse_unchecked(buf),
y: WireFormat::parse_unchecked(buf),
z: WireFormat::parse_unchecked(buf),
accuracy: WireFormat::parse_unchecked(buf),
n_sats: WireFormat::parse_unchecked(buf),
flags: WireFormat::parse_unchecked(buf),
}
}
}
#[cfg_attr(feature = "serde", derive(serde::Serialize))]
#[derive(Debug, Clone)]
pub struct MsgVelNed {
#[cfg_attr(feature = "serde", serde(skip_serializing))]
pub sender_id: Option<u16>,
#[cfg_attr(feature = "serde", serde(rename(serialize = "tow")))]
pub tow: u32,
#[cfg_attr(feature = "serde", serde(rename(serialize = "n")))]
pub n: i32,
#[cfg_attr(feature = "serde", serde(rename(serialize = "e")))]
pub e: i32,
#[cfg_attr(feature = "serde", serde(rename(serialize = "d")))]
pub d: i32,
#[cfg_attr(feature = "serde", serde(rename(serialize = "h_accuracy")))]
pub h_accuracy: u16,
#[cfg_attr(feature = "serde", serde(rename(serialize = "v_accuracy")))]
pub v_accuracy: u16,
#[cfg_attr(feature = "serde", serde(rename(serialize = "n_sats")))]
pub n_sats: u8,
#[cfg_attr(feature = "serde", serde(rename(serialize = "flags")))]
pub flags: u8,
}
impl ConcreteMessage for MsgVelNed {
const MESSAGE_TYPE: u16 = 526;
const MESSAGE_NAME: &'static str = "MSG_VEL_NED";
}
impl SbpMessage for MsgVelNed {
fn message_name(&self) -> &'static str {
<Self as ConcreteMessage>::MESSAGE_NAME
}
fn message_type(&self) -> u16 {
<Self as ConcreteMessage>::MESSAGE_TYPE
}
fn sender_id(&self) -> Option<u16> {
self.sender_id
}
fn set_sender_id(&mut self, new_id: u16) {
self.sender_id = Some(new_id);
}
fn encoded_len(&self) -> usize {
WireFormat::len(self) + crate::HEADER_LEN + crate::CRC_LEN
}
#[cfg(feature = "swiftnav")]
fn gps_time(&self) -> Option<std::result::Result<time::MessageTime, time::GpsTimeError>> {
let tow_s = (self.tow as f64) / 1000.0;
let gps_time = match time::GpsTime::new(0, tow_s) {
Ok(gps_time) => gps_time.tow(),
Err(e) => return Some(Err(e.into())),
};
Some(Ok(time::MessageTime::Rover(gps_time.into())))
}
}
impl TryFrom<Sbp> for MsgVelNed {
type Error = TryFromSbpError;
fn try_from(msg: Sbp) -> Result<Self, Self::Error> {
match msg {
Sbp::MsgVelNed(m) => Ok(m),
_ => Err(TryFromSbpError),
}
}
}
impl WireFormat for MsgVelNed {
const MIN_LEN: usize = <u32 as WireFormat>::MIN_LEN
+ <i32 as WireFormat>::MIN_LEN
+ <i32 as WireFormat>::MIN_LEN
+ <i32 as WireFormat>::MIN_LEN
+ <u16 as WireFormat>::MIN_LEN
+ <u16 as WireFormat>::MIN_LEN
+ <u8 as WireFormat>::MIN_LEN
+ <u8 as WireFormat>::MIN_LEN;
fn len(&self) -> usize {
WireFormat::len(&self.tow)
+ WireFormat::len(&self.n)
+ WireFormat::len(&self.e)
+ WireFormat::len(&self.d)
+ WireFormat::len(&self.h_accuracy)
+ WireFormat::len(&self.v_accuracy)
+ WireFormat::len(&self.n_sats)
+ WireFormat::len(&self.flags)
}
fn write<B: BufMut>(&self, buf: &mut B) {
WireFormat::write(&self.tow, buf);
WireFormat::write(&self.n, buf);
WireFormat::write(&self.e, buf);
WireFormat::write(&self.d, buf);
WireFormat::write(&self.h_accuracy, buf);
WireFormat::write(&self.v_accuracy, buf);
WireFormat::write(&self.n_sats, buf);
WireFormat::write(&self.flags, buf);
}
fn parse_unchecked<B: Buf>(buf: &mut B) -> Self {
MsgVelNed {
sender_id: None,
tow: WireFormat::parse_unchecked(buf),
n: WireFormat::parse_unchecked(buf),
e: WireFormat::parse_unchecked(buf),
d: WireFormat::parse_unchecked(buf),
h_accuracy: WireFormat::parse_unchecked(buf),
v_accuracy: WireFormat::parse_unchecked(buf),
n_sats: WireFormat::parse_unchecked(buf),
flags: WireFormat::parse_unchecked(buf),
}
}
}
#[cfg_attr(feature = "serde", derive(serde::Serialize))]
#[derive(Debug, Clone)]
pub struct MsgVelNedCov {
#[cfg_attr(feature = "serde", serde(skip_serializing))]
pub sender_id: Option<u16>,
#[cfg_attr(feature = "serde", serde(rename(serialize = "tow")))]
pub tow: u32,
#[cfg_attr(feature = "serde", serde(rename(serialize = "n")))]
pub n: i32,
#[cfg_attr(feature = "serde", serde(rename(serialize = "e")))]
pub e: i32,
#[cfg_attr(feature = "serde", serde(rename(serialize = "d")))]
pub d: i32,
#[cfg_attr(feature = "serde", serde(rename(serialize = "cov_n_n")))]
pub cov_n_n: f32,
#[cfg_attr(feature = "serde", serde(rename(serialize = "cov_n_e")))]
pub cov_n_e: f32,
#[cfg_attr(feature = "serde", serde(rename(serialize = "cov_n_d")))]
pub cov_n_d: f32,
#[cfg_attr(feature = "serde", serde(rename(serialize = "cov_e_e")))]
pub cov_e_e: f32,
#[cfg_attr(feature = "serde", serde(rename(serialize = "cov_e_d")))]
pub cov_e_d: f32,
#[cfg_attr(feature = "serde", serde(rename(serialize = "cov_d_d")))]
pub cov_d_d: f32,
#[cfg_attr(feature = "serde", serde(rename(serialize = "n_sats")))]
pub n_sats: u8,
#[cfg_attr(feature = "serde", serde(rename(serialize = "flags")))]
pub flags: u8,
}
impl ConcreteMessage for MsgVelNedCov {
const MESSAGE_TYPE: u16 = 530;
const MESSAGE_NAME: &'static str = "MSG_VEL_NED_COV";
}
impl SbpMessage for MsgVelNedCov {
fn message_name(&self) -> &'static str {
<Self as ConcreteMessage>::MESSAGE_NAME
}
fn message_type(&self) -> u16 {
<Self as ConcreteMessage>::MESSAGE_TYPE
}
fn sender_id(&self) -> Option<u16> {
self.sender_id
}
fn set_sender_id(&mut self, new_id: u16) {
self.sender_id = Some(new_id);
}
fn encoded_len(&self) -> usize {
WireFormat::len(self) + crate::HEADER_LEN + crate::CRC_LEN
}
#[cfg(feature = "swiftnav")]
fn gps_time(&self) -> Option<std::result::Result<time::MessageTime, time::GpsTimeError>> {
let tow_s = (self.tow as f64) / 1000.0;
let gps_time = match time::GpsTime::new(0, tow_s) {
Ok(gps_time) => gps_time.tow(),
Err(e) => return Some(Err(e.into())),
};
Some(Ok(time::MessageTime::Rover(gps_time.into())))
}
}
impl TryFrom<Sbp> for MsgVelNedCov {
type Error = TryFromSbpError;
fn try_from(msg: Sbp) -> Result<Self, Self::Error> {
match msg {
Sbp::MsgVelNedCov(m) => Ok(m),
_ => Err(TryFromSbpError),
}
}
}
impl WireFormat for MsgVelNedCov {
const MIN_LEN: usize = <u32 as WireFormat>::MIN_LEN
+ <i32 as WireFormat>::MIN_LEN
+ <i32 as WireFormat>::MIN_LEN
+ <i32 as WireFormat>::MIN_LEN
+ <f32 as WireFormat>::MIN_LEN
+ <f32 as WireFormat>::MIN_LEN
+ <f32 as WireFormat>::MIN_LEN
+ <f32 as WireFormat>::MIN_LEN
+ <f32 as WireFormat>::MIN_LEN
+ <f32 as WireFormat>::MIN_LEN
+ <u8 as WireFormat>::MIN_LEN
+ <u8 as WireFormat>::MIN_LEN;
fn len(&self) -> usize {
WireFormat::len(&self.tow)
+ WireFormat::len(&self.n)
+ WireFormat::len(&self.e)
+ WireFormat::len(&self.d)
+ WireFormat::len(&self.cov_n_n)
+ WireFormat::len(&self.cov_n_e)
+ WireFormat::len(&self.cov_n_d)
+ WireFormat::len(&self.cov_e_e)
+ WireFormat::len(&self.cov_e_d)
+ WireFormat::len(&self.cov_d_d)
+ WireFormat::len(&self.n_sats)
+ WireFormat::len(&self.flags)
}
fn write<B: BufMut>(&self, buf: &mut B) {
WireFormat::write(&self.tow, buf);
WireFormat::write(&self.n, buf);
WireFormat::write(&self.e, buf);
WireFormat::write(&self.d, buf);
WireFormat::write(&self.cov_n_n, buf);
WireFormat::write(&self.cov_n_e, buf);
WireFormat::write(&self.cov_n_d, buf);
WireFormat::write(&self.cov_e_e, buf);
WireFormat::write(&self.cov_e_d, buf);
WireFormat::write(&self.cov_d_d, buf);
WireFormat::write(&self.n_sats, buf);
WireFormat::write(&self.flags, buf);
}
fn parse_unchecked<B: Buf>(buf: &mut B) -> Self {
MsgVelNedCov {
sender_id: None,
tow: WireFormat::parse_unchecked(buf),
n: WireFormat::parse_unchecked(buf),
e: WireFormat::parse_unchecked(buf),
d: WireFormat::parse_unchecked(buf),
cov_n_n: WireFormat::parse_unchecked(buf),
cov_n_e: WireFormat::parse_unchecked(buf),
cov_n_d: WireFormat::parse_unchecked(buf),
cov_e_e: WireFormat::parse_unchecked(buf),
cov_e_d: WireFormat::parse_unchecked(buf),
cov_d_d: WireFormat::parse_unchecked(buf),
n_sats: WireFormat::parse_unchecked(buf),
flags: WireFormat::parse_unchecked(buf),
}
}
}
#[cfg_attr(feature = "serde", derive(serde::Serialize))]
#[derive(Debug, Clone)]
pub struct MsgVelNedCovGnss {
#[cfg_attr(feature = "serde", serde(skip_serializing))]
pub sender_id: Option<u16>,
#[cfg_attr(feature = "serde", serde(rename(serialize = "tow")))]
pub tow: u32,
#[cfg_attr(feature = "serde", serde(rename(serialize = "n")))]
pub n: i32,
#[cfg_attr(feature = "serde", serde(rename(serialize = "e")))]
pub e: i32,
#[cfg_attr(feature = "serde", serde(rename(serialize = "d")))]
pub d: i32,
#[cfg_attr(feature = "serde", serde(rename(serialize = "cov_n_n")))]
pub cov_n_n: f32,
#[cfg_attr(feature = "serde", serde(rename(serialize = "cov_n_e")))]
pub cov_n_e: f32,
#[cfg_attr(feature = "serde", serde(rename(serialize = "cov_n_d")))]
pub cov_n_d: f32,
#[cfg_attr(feature = "serde", serde(rename(serialize = "cov_e_e")))]
pub cov_e_e: f32,
#[cfg_attr(feature = "serde", serde(rename(serialize = "cov_e_d")))]
pub cov_e_d: f32,
#[cfg_attr(feature = "serde", serde(rename(serialize = "cov_d_d")))]
pub cov_d_d: f32,
#[cfg_attr(feature = "serde", serde(rename(serialize = "n_sats")))]
pub n_sats: u8,
#[cfg_attr(feature = "serde", serde(rename(serialize = "flags")))]
pub flags: u8,
}
impl ConcreteMessage for MsgVelNedCovGnss {
const MESSAGE_TYPE: u16 = 562;
const MESSAGE_NAME: &'static str = "MSG_VEL_NED_COV_GNSS";
}
impl SbpMessage for MsgVelNedCovGnss {
fn message_name(&self) -> &'static str {
<Self as ConcreteMessage>::MESSAGE_NAME
}
fn message_type(&self) -> u16 {
<Self as ConcreteMessage>::MESSAGE_TYPE
}
fn sender_id(&self) -> Option<u16> {
self.sender_id
}
fn set_sender_id(&mut self, new_id: u16) {
self.sender_id = Some(new_id);
}
fn encoded_len(&self) -> usize {
WireFormat::len(self) + crate::HEADER_LEN + crate::CRC_LEN
}
#[cfg(feature = "swiftnav")]
fn gps_time(&self) -> Option<std::result::Result<time::MessageTime, time::GpsTimeError>> {
let tow_s = (self.tow as f64) / 1000.0;
let gps_time = match time::GpsTime::new(0, tow_s) {
Ok(gps_time) => gps_time.tow(),
Err(e) => return Some(Err(e.into())),
};
Some(Ok(time::MessageTime::Rover(gps_time.into())))
}
}
impl TryFrom<Sbp> for MsgVelNedCovGnss {
type Error = TryFromSbpError;
fn try_from(msg: Sbp) -> Result<Self, Self::Error> {
match msg {
Sbp::MsgVelNedCovGnss(m) => Ok(m),
_ => Err(TryFromSbpError),
}
}
}
impl WireFormat for MsgVelNedCovGnss {
const MIN_LEN: usize = <u32 as WireFormat>::MIN_LEN
+ <i32 as WireFormat>::MIN_LEN
+ <i32 as WireFormat>::MIN_LEN
+ <i32 as WireFormat>::MIN_LEN
+ <f32 as WireFormat>::MIN_LEN
+ <f32 as WireFormat>::MIN_LEN
+ <f32 as WireFormat>::MIN_LEN
+ <f32 as WireFormat>::MIN_LEN
+ <f32 as WireFormat>::MIN_LEN
+ <f32 as WireFormat>::MIN_LEN
+ <u8 as WireFormat>::MIN_LEN
+ <u8 as WireFormat>::MIN_LEN;
fn len(&self) -> usize {
WireFormat::len(&self.tow)
+ WireFormat::len(&self.n)
+ WireFormat::len(&self.e)
+ WireFormat::len(&self.d)
+ WireFormat::len(&self.cov_n_n)
+ WireFormat::len(&self.cov_n_e)
+ WireFormat::len(&self.cov_n_d)
+ WireFormat::len(&self.cov_e_e)
+ WireFormat::len(&self.cov_e_d)
+ WireFormat::len(&self.cov_d_d)
+ WireFormat::len(&self.n_sats)
+ WireFormat::len(&self.flags)
}
fn write<B: BufMut>(&self, buf: &mut B) {
WireFormat::write(&self.tow, buf);
WireFormat::write(&self.n, buf);
WireFormat::write(&self.e, buf);
WireFormat::write(&self.d, buf);
WireFormat::write(&self.cov_n_n, buf);
WireFormat::write(&self.cov_n_e, buf);
WireFormat::write(&self.cov_n_d, buf);
WireFormat::write(&self.cov_e_e, buf);
WireFormat::write(&self.cov_e_d, buf);
WireFormat::write(&self.cov_d_d, buf);
WireFormat::write(&self.n_sats, buf);
WireFormat::write(&self.flags, buf);
}
fn parse_unchecked<B: Buf>(buf: &mut B) -> Self {
MsgVelNedCovGnss {
sender_id: None,
tow: WireFormat::parse_unchecked(buf),
n: WireFormat::parse_unchecked(buf),
e: WireFormat::parse_unchecked(buf),
d: WireFormat::parse_unchecked(buf),
cov_n_n: WireFormat::parse_unchecked(buf),
cov_n_e: WireFormat::parse_unchecked(buf),
cov_n_d: WireFormat::parse_unchecked(buf),
cov_e_e: WireFormat::parse_unchecked(buf),
cov_e_d: WireFormat::parse_unchecked(buf),
cov_d_d: WireFormat::parse_unchecked(buf),
n_sats: WireFormat::parse_unchecked(buf),
flags: WireFormat::parse_unchecked(buf),
}
}
}
#[cfg_attr(feature = "serde", derive(serde::Serialize))]
#[derive(Debug, Clone)]
pub struct MsgVelNedDepA {
#[cfg_attr(feature = "serde", serde(skip_serializing))]
pub sender_id: Option<u16>,
#[cfg_attr(feature = "serde", serde(rename(serialize = "tow")))]
pub tow: u32,
#[cfg_attr(feature = "serde", serde(rename(serialize = "n")))]
pub n: i32,
#[cfg_attr(feature = "serde", serde(rename(serialize = "e")))]
pub e: i32,
#[cfg_attr(feature = "serde", serde(rename(serialize = "d")))]
pub d: i32,
#[cfg_attr(feature = "serde", serde(rename(serialize = "h_accuracy")))]
pub h_accuracy: u16,
#[cfg_attr(feature = "serde", serde(rename(serialize = "v_accuracy")))]
pub v_accuracy: u16,
#[cfg_attr(feature = "serde", serde(rename(serialize = "n_sats")))]
pub n_sats: u8,
#[cfg_attr(feature = "serde", serde(rename(serialize = "flags")))]
pub flags: u8,
}
impl ConcreteMessage for MsgVelNedDepA {
const MESSAGE_TYPE: u16 = 517;
const MESSAGE_NAME: &'static str = "MSG_VEL_NED_DEP_A";
}
impl SbpMessage for MsgVelNedDepA {
fn message_name(&self) -> &'static str {
<Self as ConcreteMessage>::MESSAGE_NAME
}
fn message_type(&self) -> u16 {
<Self as ConcreteMessage>::MESSAGE_TYPE
}
fn sender_id(&self) -> Option<u16> {
self.sender_id
}
fn set_sender_id(&mut self, new_id: u16) {
self.sender_id = Some(new_id);
}
fn encoded_len(&self) -> usize {
WireFormat::len(self) + crate::HEADER_LEN + crate::CRC_LEN
}
#[cfg(feature = "swiftnav")]
fn gps_time(&self) -> Option<std::result::Result<time::MessageTime, time::GpsTimeError>> {
let tow_s = (self.tow as f64) / 1000.0;
let gps_time = match time::GpsTime::new(0, tow_s) {
Ok(gps_time) => gps_time.tow(),
Err(e) => return Some(Err(e.into())),
};
Some(Ok(time::MessageTime::Rover(gps_time.into())))
}
}
impl TryFrom<Sbp> for MsgVelNedDepA {
type Error = TryFromSbpError;
fn try_from(msg: Sbp) -> Result<Self, Self::Error> {
match msg {
Sbp::MsgVelNedDepA(m) => Ok(m),
_ => Err(TryFromSbpError),
}
}
}
impl WireFormat for MsgVelNedDepA {
const MIN_LEN: usize = <u32 as WireFormat>::MIN_LEN
+ <i32 as WireFormat>::MIN_LEN
+ <i32 as WireFormat>::MIN_LEN
+ <i32 as WireFormat>::MIN_LEN
+ <u16 as WireFormat>::MIN_LEN
+ <u16 as WireFormat>::MIN_LEN
+ <u8 as WireFormat>::MIN_LEN
+ <u8 as WireFormat>::MIN_LEN;
fn len(&self) -> usize {
WireFormat::len(&self.tow)
+ WireFormat::len(&self.n)
+ WireFormat::len(&self.e)
+ WireFormat::len(&self.d)
+ WireFormat::len(&self.h_accuracy)
+ WireFormat::len(&self.v_accuracy)
+ WireFormat::len(&self.n_sats)
+ WireFormat::len(&self.flags)
}
fn write<B: BufMut>(&self, buf: &mut B) {
WireFormat::write(&self.tow, buf);
WireFormat::write(&self.n, buf);
WireFormat::write(&self.e, buf);
WireFormat::write(&self.d, buf);
WireFormat::write(&self.h_accuracy, buf);
WireFormat::write(&self.v_accuracy, buf);
WireFormat::write(&self.n_sats, buf);
WireFormat::write(&self.flags, buf);
}
fn parse_unchecked<B: Buf>(buf: &mut B) -> Self {
MsgVelNedDepA {
sender_id: None,
tow: WireFormat::parse_unchecked(buf),
n: WireFormat::parse_unchecked(buf),
e: WireFormat::parse_unchecked(buf),
d: WireFormat::parse_unchecked(buf),
h_accuracy: WireFormat::parse_unchecked(buf),
v_accuracy: WireFormat::parse_unchecked(buf),
n_sats: WireFormat::parse_unchecked(buf),
flags: WireFormat::parse_unchecked(buf),
}
}
}
#[cfg_attr(feature = "serde", derive(serde::Serialize))]
#[derive(Debug, Clone)]
pub struct MsgVelNedGnss {
#[cfg_attr(feature = "serde", serde(skip_serializing))]
pub sender_id: Option<u16>,
#[cfg_attr(feature = "serde", serde(rename(serialize = "tow")))]
pub tow: u32,
#[cfg_attr(feature = "serde", serde(rename(serialize = "n")))]
pub n: i32,
#[cfg_attr(feature = "serde", serde(rename(serialize = "e")))]
pub e: i32,
#[cfg_attr(feature = "serde", serde(rename(serialize = "d")))]
pub d: i32,
#[cfg_attr(feature = "serde", serde(rename(serialize = "h_accuracy")))]
pub h_accuracy: u16,
#[cfg_attr(feature = "serde", serde(rename(serialize = "v_accuracy")))]
pub v_accuracy: u16,
#[cfg_attr(feature = "serde", serde(rename(serialize = "n_sats")))]
pub n_sats: u8,
#[cfg_attr(feature = "serde", serde(rename(serialize = "flags")))]
pub flags: u8,
}
impl ConcreteMessage for MsgVelNedGnss {
const MESSAGE_TYPE: u16 = 558;
const MESSAGE_NAME: &'static str = "MSG_VEL_NED_GNSS";
}
impl SbpMessage for MsgVelNedGnss {
fn message_name(&self) -> &'static str {
<Self as ConcreteMessage>::MESSAGE_NAME
}
fn message_type(&self) -> u16 {
<Self as ConcreteMessage>::MESSAGE_TYPE
}
fn sender_id(&self) -> Option<u16> {
self.sender_id
}
fn set_sender_id(&mut self, new_id: u16) {
self.sender_id = Some(new_id);
}
fn encoded_len(&self) -> usize {
WireFormat::len(self) + crate::HEADER_LEN + crate::CRC_LEN
}
#[cfg(feature = "swiftnav")]
fn gps_time(&self) -> Option<std::result::Result<time::MessageTime, time::GpsTimeError>> {
let tow_s = (self.tow as f64) / 1000.0;
let gps_time = match time::GpsTime::new(0, tow_s) {
Ok(gps_time) => gps_time.tow(),
Err(e) => return Some(Err(e.into())),
};
Some(Ok(time::MessageTime::Rover(gps_time.into())))
}
}
impl TryFrom<Sbp> for MsgVelNedGnss {
type Error = TryFromSbpError;
fn try_from(msg: Sbp) -> Result<Self, Self::Error> {
match msg {
Sbp::MsgVelNedGnss(m) => Ok(m),
_ => Err(TryFromSbpError),
}
}
}
impl WireFormat for MsgVelNedGnss {
const MIN_LEN: usize = <u32 as WireFormat>::MIN_LEN
+ <i32 as WireFormat>::MIN_LEN
+ <i32 as WireFormat>::MIN_LEN
+ <i32 as WireFormat>::MIN_LEN
+ <u16 as WireFormat>::MIN_LEN
+ <u16 as WireFormat>::MIN_LEN
+ <u8 as WireFormat>::MIN_LEN
+ <u8 as WireFormat>::MIN_LEN;
fn len(&self) -> usize {
WireFormat::len(&self.tow)
+ WireFormat::len(&self.n)
+ WireFormat::len(&self.e)
+ WireFormat::len(&self.d)
+ WireFormat::len(&self.h_accuracy)
+ WireFormat::len(&self.v_accuracy)
+ WireFormat::len(&self.n_sats)
+ WireFormat::len(&self.flags)
}
fn write<B: BufMut>(&self, buf: &mut B) {
WireFormat::write(&self.tow, buf);
WireFormat::write(&self.n, buf);
WireFormat::write(&self.e, buf);
WireFormat::write(&self.d, buf);
WireFormat::write(&self.h_accuracy, buf);
WireFormat::write(&self.v_accuracy, buf);
WireFormat::write(&self.n_sats, buf);
WireFormat::write(&self.flags, buf);
}
fn parse_unchecked<B: Buf>(buf: &mut B) -> Self {
MsgVelNedGnss {
sender_id: None,
tow: WireFormat::parse_unchecked(buf),
n: WireFormat::parse_unchecked(buf),
e: WireFormat::parse_unchecked(buf),
d: WireFormat::parse_unchecked(buf),
h_accuracy: WireFormat::parse_unchecked(buf),
v_accuracy: WireFormat::parse_unchecked(buf),
n_sats: WireFormat::parse_unchecked(buf),
flags: WireFormat::parse_unchecked(buf),
}
}
}