From a3e4b48557f54592abdd8decddbbf9df34cbd98e Mon Sep 17 00:00:00 2001 From: adrian-kong Date: Mon, 28 Nov 2022 10:39:27 +1100 Subject: [PATCH 1/7] initial draft --- .../resources/rust/sbp_messages_mod.rs | 14 +- .../resources/rust/sbp_messages_template.rs | 13 + generator/sbpg/targets/rust.py | 2 + rust/sbp/src/messages/acquisition.rs | 78 +++ rust/sbp/src/messages/bootload.rs | 78 +++ rust/sbp/src/messages/ext_events.rs | 13 + rust/sbp/src/messages/file_io.rs | 117 ++++ rust/sbp/src/messages/flash.rs | 130 +++++ rust/sbp/src/messages/imu.rs | 26 + rust/sbp/src/messages/integrity.rs | 78 +++ rust/sbp/src/messages/linux.rs | 143 +++++ rust/sbp/src/messages/logging.rs | 39 ++ rust/sbp/src/messages/mag.rs | 13 + rust/sbp/src/messages/mod.rs | 14 +- rust/sbp/src/messages/navigation.rs | 533 ++++++++++++++++++ rust/sbp/src/messages/ndb.rs | 13 + rust/sbp/src/messages/observation.rs | 494 ++++++++++++++++ rust/sbp/src/messages/orientation.rs | 52 ++ rust/sbp/src/messages/piksi.rs | 325 +++++++++++ rust/sbp/src/messages/sbas.rs | 13 + rust/sbp/src/messages/settings.rs | 130 +++++ rust/sbp/src/messages/signing.rs | 39 ++ rust/sbp/src/messages/solution_meta.rs | 26 + rust/sbp/src/messages/ssr.rs | 234 ++++++++ rust/sbp/src/messages/system.rs | 169 ++++++ rust/sbp/src/messages/tracking.rs | 117 ++++ rust/sbp/src/messages/user.rs | 13 + rust/sbp/src/messages/vehicle.rs | 26 + 28 files changed, 2940 insertions(+), 2 deletions(-) diff --git a/generator/sbpg/targets/resources/rust/sbp_messages_mod.rs b/generator/sbpg/targets/resources/rust/sbp_messages_mod.rs index 9690ea2c92..3b9bc68b5f 100644 --- a/generator/sbpg/targets/resources/rust/sbp_messages_mod.rs +++ b/generator/sbpg/targets/resources/rust/sbp_messages_mod.rs @@ -33,7 +33,9 @@ mod lib { pub use crate::time; pub use crate::wire_format::{PayloadParseError, WireFormat}; - pub use super::{ConcreteMessage, Sbp, SbpMessage, TryFromSbpError}; + pub use super::{ + ConcreteMessage, FriendlyName, MessageDisplay, Sbp, SbpMessage, TryFromSbpError, + }; pub use bytes::{Buf, BufMut}; @@ -96,6 +98,16 @@ pub trait ConcreteMessage: SbpMessage + TryFrom { const MESSAGE_NAME: &'static str; } +/// Friendly name representation of Sbp message +pub trait FriendlyName { + fn friendly_name() -> &'static str; +} + +/// Enriched fields display of Sbp messages +pub trait MessageDisplay { + fn message_display(&self) -> String; +} + /// The error returned when using [TryFrom] to convert [Sbp] to the wrong message type. #[derive(Debug, Clone)] pub struct TryFromSbpError; diff --git a/generator/sbpg/targets/resources/rust/sbp_messages_template.rs b/generator/sbpg/targets/resources/rust/sbp_messages_template.rs index 26cb13a4f3..f818a8a455 100644 --- a/generator/sbpg/targets/resources/rust/sbp_messages_template.rs +++ b/generator/sbpg/targets/resources/rust/sbp_messages_template.rs @@ -149,6 +149,19 @@ impl TryFrom for (((m.msg_name))) { } } } + +impl FriendlyName for (((m.msg_name))) { + fn friendly_name() -> &'static str { + "(((m.friendly_name)))" + } +} + +impl MessageDisplay for (((m.msg_name))) { + #[allow(clippy::useless_format)] + fn message_display(&self) -> String { + format!("(((m.message_display)))") + } +} ((* endif *)) impl WireFormat for (((m.msg_name))) { diff --git a/generator/sbpg/targets/rust.py b/generator/sbpg/targets/rust.py index 891e41c0f8..32d5c10099 100644 --- a/generator/sbpg/targets/rust.py +++ b/generator/sbpg/targets/rust.py @@ -370,6 +370,8 @@ def __init__(self, msg, package, package_specs): if len(field.bitfield) > 0: self.has_bitfield = True self.gps_time_fn = gps_time_fn(self) + self.message_display = getattr(msg, "message_display", "") + self.friendly_name = getattr(msg, "friendly_name", "") class PackageItem(object): diff --git a/rust/sbp/src/messages/acquisition.rs b/rust/sbp/src/messages/acquisition.rs index c00920b628..b04952eb83 100644 --- a/rust/sbp/src/messages/acquisition.rs +++ b/rust/sbp/src/messages/acquisition.rs @@ -318,6 +318,19 @@ pub mod msg_acq_result { } } + impl FriendlyName for MsgAcqResult { + fn friendly_name() -> &'static str { + "" + } + } + + impl MessageDisplay for MsgAcqResult { + #[allow(clippy::useless_format)] + fn message_display(&self) -> String { + format!("") + } + } + impl WireFormat for MsgAcqResult { const MIN_LEN: usize = ::MIN_LEN + ::MIN_LEN @@ -414,6 +427,19 @@ pub mod msg_acq_result_dep_a { } } + impl FriendlyName for MsgAcqResultDepA { + fn friendly_name() -> &'static str { + "" + } + } + + impl MessageDisplay for MsgAcqResultDepA { + #[allow(clippy::useless_format)] + fn message_display(&self) -> String { + format!("") + } + } + impl WireFormat for MsgAcqResultDepA { const MIN_LEN: usize = ::MIN_LEN + ::MIN_LEN @@ -509,6 +535,19 @@ pub mod msg_acq_result_dep_b { } } + impl FriendlyName for MsgAcqResultDepB { + fn friendly_name() -> &'static str { + "" + } + } + + impl MessageDisplay for MsgAcqResultDepB { + #[allow(clippy::useless_format)] + fn message_display(&self) -> String { + format!("") + } + } + impl WireFormat for MsgAcqResultDepB { const MIN_LEN: usize = ::MIN_LEN + ::MIN_LEN @@ -603,6 +642,19 @@ pub mod msg_acq_result_dep_c { } } + impl FriendlyName for MsgAcqResultDepC { + fn friendly_name() -> &'static str { + "" + } + } + + impl MessageDisplay for MsgAcqResultDepC { + #[allow(clippy::useless_format)] + fn message_display(&self) -> String { + format!("") + } + } + impl WireFormat for MsgAcqResultDepC { const MIN_LEN: usize = ::MIN_LEN + ::MIN_LEN @@ -689,6 +741,19 @@ pub mod msg_acq_sv_profile { } } + impl FriendlyName for MsgAcqSvProfile { + fn friendly_name() -> &'static str { + "" + } + } + + impl MessageDisplay for MsgAcqSvProfile { + #[allow(clippy::useless_format)] + fn message_display(&self) -> String { + format!("") + } + } + impl WireFormat for MsgAcqSvProfile { const MIN_LEN: usize = as WireFormat>::MIN_LEN; fn len(&self) -> usize { @@ -762,6 +827,19 @@ pub mod msg_acq_sv_profile_dep { } } + impl FriendlyName for MsgAcqSvProfileDep { + fn friendly_name() -> &'static str { + "" + } + } + + impl MessageDisplay for MsgAcqSvProfileDep { + #[allow(clippy::useless_format)] + fn message_display(&self) -> String { + format!("") + } + } + impl WireFormat for MsgAcqSvProfileDep { const MIN_LEN: usize = as WireFormat>::MIN_LEN; fn len(&self) -> usize { diff --git a/rust/sbp/src/messages/bootload.rs b/rust/sbp/src/messages/bootload.rs index 61e105280c..bcd317c674 100644 --- a/rust/sbp/src/messages/bootload.rs +++ b/rust/sbp/src/messages/bootload.rs @@ -79,6 +79,19 @@ pub mod msg_bootloader_handshake_dep_a { } } + impl FriendlyName for MsgBootloaderHandshakeDepA { + fn friendly_name() -> &'static str { + "" + } + } + + impl MessageDisplay for MsgBootloaderHandshakeDepA { + #[allow(clippy::useless_format)] + fn message_display(&self) -> String { + format!("") + } + } + impl WireFormat for MsgBootloaderHandshakeDepA { const MIN_LEN: usize = as WireFormat>::MIN_LEN; fn len(&self) -> usize { @@ -150,6 +163,19 @@ pub mod msg_bootloader_handshake_req { } } + impl FriendlyName for MsgBootloaderHandshakeReq { + fn friendly_name() -> &'static str { + "" + } + } + + impl MessageDisplay for MsgBootloaderHandshakeReq { + #[allow(clippy::useless_format)] + fn message_display(&self) -> String { + format!("") + } + } + impl WireFormat for MsgBootloaderHandshakeReq { const MIN_LEN: usize = 0; fn len(&self) -> usize { @@ -265,6 +291,19 @@ pub mod msg_bootloader_handshake_resp { } } + impl FriendlyName for MsgBootloaderHandshakeResp { + fn friendly_name() -> &'static str { + "" + } + } + + impl MessageDisplay for MsgBootloaderHandshakeResp { + #[allow(clippy::useless_format)] + fn message_display(&self) -> String { + format!("") + } + } + impl WireFormat for MsgBootloaderHandshakeResp { const MIN_LEN: usize = ::MIN_LEN + , Unterminated> as WireFormat>::MIN_LEN; @@ -340,6 +379,19 @@ pub mod msg_bootloader_jump_to_app { } } + impl FriendlyName for MsgBootloaderJumpToApp { + fn friendly_name() -> &'static str { + "" + } + } + + impl MessageDisplay for MsgBootloaderJumpToApp { + #[allow(clippy::useless_format)] + fn message_display(&self) -> String { + format!("") + } + } + impl WireFormat for MsgBootloaderJumpToApp { const MIN_LEN: usize = ::MIN_LEN; fn len(&self) -> usize { @@ -414,6 +466,19 @@ pub mod msg_nap_device_dna_req { } } + impl FriendlyName for MsgNapDeviceDnaReq { + fn friendly_name() -> &'static str { + "" + } + } + + impl MessageDisplay for MsgNapDeviceDnaReq { + #[allow(clippy::useless_format)] + fn message_display(&self) -> String { + format!("") + } + } + impl WireFormat for MsgNapDeviceDnaReq { const MIN_LEN: usize = 0; fn len(&self) -> usize { @@ -486,6 +551,19 @@ pub mod msg_nap_device_dna_resp { } } + impl FriendlyName for MsgNapDeviceDnaResp { + fn friendly_name() -> &'static str { + "" + } + } + + impl MessageDisplay for MsgNapDeviceDnaResp { + #[allow(clippy::useless_format)] + fn message_display(&self) -> String { + format!("") + } + } + impl WireFormat for MsgNapDeviceDnaResp { const MIN_LEN: usize = <[u8; 8] as WireFormat>::MIN_LEN; fn len(&self) -> usize { diff --git a/rust/sbp/src/messages/ext_events.rs b/rust/sbp/src/messages/ext_events.rs index 34e0ca7009..b7543a112e 100644 --- a/rust/sbp/src/messages/ext_events.rs +++ b/rust/sbp/src/messages/ext_events.rs @@ -129,6 +129,19 @@ pub mod msg_ext_event { } } + impl FriendlyName for MsgExtEvent { + fn friendly_name() -> &'static str { + "" + } + } + + impl MessageDisplay for MsgExtEvent { + #[allow(clippy::useless_format)] + fn message_display(&self) -> String { + format!("") + } + } + impl WireFormat for MsgExtEvent { const MIN_LEN: usize = ::MIN_LEN + ::MIN_LEN diff --git a/rust/sbp/src/messages/file_io.rs b/rust/sbp/src/messages/file_io.rs index 204697a7ac..3416a0f4ff 100644 --- a/rust/sbp/src/messages/file_io.rs +++ b/rust/sbp/src/messages/file_io.rs @@ -88,6 +88,19 @@ pub mod msg_fileio_config_req { } } + impl FriendlyName for MsgFileioConfigReq { + fn friendly_name() -> &'static str { + "" + } + } + + impl MessageDisplay for MsgFileioConfigReq { + #[allow(clippy::useless_format)] + fn message_display(&self) -> String { + format!("") + } + } + impl WireFormat for MsgFileioConfigReq { const MIN_LEN: usize = ::MIN_LEN; fn len(&self) -> usize { @@ -173,6 +186,19 @@ pub mod msg_fileio_config_resp { } } + impl FriendlyName for MsgFileioConfigResp { + fn friendly_name() -> &'static str { + "" + } + } + + impl MessageDisplay for MsgFileioConfigResp { + #[allow(clippy::useless_format)] + fn message_display(&self) -> String { + format!("") + } + } + impl WireFormat for MsgFileioConfigResp { const MIN_LEN: usize = ::MIN_LEN + ::MIN_LEN @@ -271,6 +297,19 @@ pub mod msg_fileio_read_dir_req { } } + impl FriendlyName for MsgFileioReadDirReq { + fn friendly_name() -> &'static str { + "" + } + } + + impl MessageDisplay for MsgFileioReadDirReq { + #[allow(clippy::useless_format)] + fn message_display(&self) -> String { + format!("") + } + } + impl WireFormat for MsgFileioReadDirReq { const MIN_LEN: usize = ::MIN_LEN + ::MIN_LEN @@ -358,6 +397,19 @@ pub mod msg_fileio_read_dir_resp { } } + impl FriendlyName for MsgFileioReadDirResp { + fn friendly_name() -> &'static str { + "" + } + } + + impl MessageDisplay for MsgFileioReadDirResp { + #[allow(clippy::useless_format)] + fn message_display(&self) -> String { + format!("") + } + } + impl WireFormat for MsgFileioReadDirResp { const MIN_LEN: usize = ::MIN_LEN + as WireFormat>::MIN_LEN; fn len(&self) -> usize { @@ -447,6 +499,19 @@ pub mod msg_fileio_read_req { } } + impl FriendlyName for MsgFileioReadReq { + fn friendly_name() -> &'static str { + "" + } + } + + impl MessageDisplay for MsgFileioReadReq { + #[allow(clippy::useless_format)] + fn message_display(&self) -> String { + format!("") + } + } + impl WireFormat for MsgFileioReadReq { const MIN_LEN: usize = ::MIN_LEN + ::MIN_LEN @@ -537,6 +602,19 @@ pub mod msg_fileio_read_resp { } } + impl FriendlyName for MsgFileioReadResp { + fn friendly_name() -> &'static str { + "" + } + } + + impl MessageDisplay for MsgFileioReadResp { + #[allow(clippy::useless_format)] + fn message_display(&self) -> String { + format!("") + } + } + impl WireFormat for MsgFileioReadResp { const MIN_LEN: usize = ::MIN_LEN + as WireFormat>::MIN_LEN; fn len(&self) -> usize { @@ -614,6 +692,19 @@ pub mod msg_fileio_remove { } } + impl FriendlyName for MsgFileioRemove { + fn friendly_name() -> &'static str { + "" + } + } + + impl MessageDisplay for MsgFileioRemove { + #[allow(clippy::useless_format)] + fn message_display(&self) -> String { + format!("") + } + } + impl WireFormat for MsgFileioRemove { const MIN_LEN: usize = , NullTerminated> as WireFormat>::MIN_LEN; fn len(&self) -> usize { @@ -701,6 +792,19 @@ pub mod msg_fileio_write_req { } } + impl FriendlyName for MsgFileioWriteReq { + fn friendly_name() -> &'static str { + "" + } + } + + impl MessageDisplay for MsgFileioWriteReq { + #[allow(clippy::useless_format)] + fn message_display(&self) -> String { + format!("") + } + } + impl WireFormat for MsgFileioWriteReq { const MIN_LEN: usize = ::MIN_LEN + ::MIN_LEN @@ -788,6 +892,19 @@ pub mod msg_fileio_write_resp { } } + impl FriendlyName for MsgFileioWriteResp { + fn friendly_name() -> &'static str { + "" + } + } + + impl MessageDisplay for MsgFileioWriteResp { + #[allow(clippy::useless_format)] + fn message_display(&self) -> String { + format!("") + } + } + impl WireFormat for MsgFileioWriteResp { const MIN_LEN: usize = ::MIN_LEN; fn len(&self) -> usize { diff --git a/rust/sbp/src/messages/flash.rs b/rust/sbp/src/messages/flash.rs index c5137b8fd3..e163a45e1d 100644 --- a/rust/sbp/src/messages/flash.rs +++ b/rust/sbp/src/messages/flash.rs @@ -101,6 +101,19 @@ pub mod msg_flash_done { } } + impl FriendlyName for MsgFlashDone { + fn friendly_name() -> &'static str { + "" + } + } + + impl MessageDisplay for MsgFlashDone { + #[allow(clippy::useless_format)] + fn message_display(&self) -> String { + format!("") + } + } + impl WireFormat for MsgFlashDone { const MIN_LEN: usize = ::MIN_LEN; fn len(&self) -> usize { @@ -245,6 +258,19 @@ pub mod msg_flash_erase { } } + impl FriendlyName for MsgFlashErase { + fn friendly_name() -> &'static str { + "" + } + } + + impl MessageDisplay for MsgFlashErase { + #[allow(clippy::useless_format)] + fn message_display(&self) -> String { + format!("") + } + } + impl WireFormat for MsgFlashErase { const MIN_LEN: usize = ::MIN_LEN + ::MIN_LEN; fn len(&self) -> usize { @@ -378,6 +404,19 @@ pub mod msg_flash_program { } } + impl FriendlyName for MsgFlashProgram { + fn friendly_name() -> &'static str { + "" + } + } + + impl MessageDisplay for MsgFlashProgram { + #[allow(clippy::useless_format)] + fn message_display(&self) -> String { + format!("") + } + } + impl WireFormat for MsgFlashProgram { const MIN_LEN: usize = ::MIN_LEN + <[u8; 3] as WireFormat>::MIN_LEN @@ -519,6 +558,19 @@ pub mod msg_flash_read_req { } } + impl FriendlyName for MsgFlashReadReq { + fn friendly_name() -> &'static str { + "" + } + } + + impl MessageDisplay for MsgFlashReadReq { + #[allow(clippy::useless_format)] + fn message_display(&self) -> String { + format!("") + } + } + impl WireFormat for MsgFlashReadReq { const MIN_LEN: usize = ::MIN_LEN + <[u8; 3] as WireFormat>::MIN_LEN @@ -656,6 +708,19 @@ pub mod msg_flash_read_resp { } } + impl FriendlyName for MsgFlashReadResp { + fn friendly_name() -> &'static str { + "" + } + } + + impl MessageDisplay for MsgFlashReadResp { + #[allow(clippy::useless_format)] + fn message_display(&self) -> String { + format!("") + } + } + impl WireFormat for MsgFlashReadResp { const MIN_LEN: usize = ::MIN_LEN + <[u8; 3] as WireFormat>::MIN_LEN @@ -767,6 +832,19 @@ pub mod msg_m25_flash_write_status { } } + impl FriendlyName for MsgM25FlashWriteStatus { + fn friendly_name() -> &'static str { + "" + } + } + + impl MessageDisplay for MsgM25FlashWriteStatus { + #[allow(clippy::useless_format)] + fn message_display(&self) -> String { + format!("") + } + } + impl WireFormat for MsgM25FlashWriteStatus { const MIN_LEN: usize = <[u8; 1] as WireFormat>::MIN_LEN; fn len(&self) -> usize { @@ -840,6 +918,19 @@ pub mod msg_stm_flash_lock_sector { } } + impl FriendlyName for MsgStmFlashLockSector { + fn friendly_name() -> &'static str { + "" + } + } + + impl MessageDisplay for MsgStmFlashLockSector { + #[allow(clippy::useless_format)] + fn message_display(&self) -> String { + format!("") + } + } + impl WireFormat for MsgStmFlashLockSector { const MIN_LEN: usize = ::MIN_LEN; fn len(&self) -> usize { @@ -913,6 +1004,19 @@ pub mod msg_stm_flash_unlock_sector { } } + impl FriendlyName for MsgStmFlashUnlockSector { + fn friendly_name() -> &'static str { + "" + } + } + + impl MessageDisplay for MsgStmFlashUnlockSector { + #[allow(clippy::useless_format)] + fn message_display(&self) -> String { + format!("") + } + } + impl WireFormat for MsgStmFlashUnlockSector { const MIN_LEN: usize = ::MIN_LEN; fn len(&self) -> usize { @@ -985,6 +1089,19 @@ pub mod msg_stm_unique_id_req { } } + impl FriendlyName for MsgStmUniqueIdReq { + fn friendly_name() -> &'static str { + "" + } + } + + impl MessageDisplay for MsgStmUniqueIdReq { + #[allow(clippy::useless_format)] + fn message_display(&self) -> String { + format!("") + } + } + impl WireFormat for MsgStmUniqueIdReq { const MIN_LEN: usize = 0; fn len(&self) -> usize { @@ -1055,6 +1172,19 @@ pub mod msg_stm_unique_id_resp { } } + impl FriendlyName for MsgStmUniqueIdResp { + fn friendly_name() -> &'static str { + "" + } + } + + impl MessageDisplay for MsgStmUniqueIdResp { + #[allow(clippy::useless_format)] + fn message_display(&self) -> String { + format!("") + } + } + impl WireFormat for MsgStmUniqueIdResp { const MIN_LEN: usize = <[u8; 12] as WireFormat>::MIN_LEN; fn len(&self) -> usize { diff --git a/rust/sbp/src/messages/imu.rs b/rust/sbp/src/messages/imu.rs index 2890e58aab..d0381166d0 100644 --- a/rust/sbp/src/messages/imu.rs +++ b/rust/sbp/src/messages/imu.rs @@ -123,6 +123,19 @@ pub mod msg_imu_aux { } } + impl FriendlyName for MsgImuAux { + fn friendly_name() -> &'static str { + "" + } + } + + impl MessageDisplay for MsgImuAux { + #[allow(clippy::useless_format)] + fn message_display(&self) -> String { + format!("") + } + } + impl WireFormat for MsgImuAux { const MIN_LEN: usize = ::MIN_LEN + ::MIN_LEN @@ -399,6 +412,19 @@ pub mod msg_imu_raw { } } + impl FriendlyName for MsgImuRaw { + fn friendly_name() -> &'static str { + "" + } + } + + impl MessageDisplay for MsgImuRaw { + #[allow(clippy::useless_format)] + fn message_display(&self) -> String { + format!("") + } + } + impl WireFormat for MsgImuRaw { const MIN_LEN: usize = ::MIN_LEN + ::MIN_LEN diff --git a/rust/sbp/src/messages/integrity.rs b/rust/sbp/src/messages/integrity.rs index 4b68795a8c..7f4c9678c7 100644 --- a/rust/sbp/src/messages/integrity.rs +++ b/rust/sbp/src/messages/integrity.rs @@ -350,6 +350,19 @@ pub mod msg_ssr_flag_high_level { } } + impl FriendlyName for MsgSsrFlagHighLevel { + fn friendly_name() -> &'static str { + "" + } + } + + impl MessageDisplay for MsgSsrFlagHighLevel { + #[allow(clippy::useless_format)] + fn message_display(&self) -> String { + format!("") + } + } + impl WireFormat for MsgSsrFlagHighLevel { const MIN_LEN: usize = ::MIN_LEN + ::MIN_LEN @@ -757,6 +770,19 @@ pub mod msg_ssr_flag_iono_grid_points { } } + impl FriendlyName for MsgSsrFlagIonoGridPoints { + fn friendly_name() -> &'static str { + "" + } + } + + impl MessageDisplay for MsgSsrFlagIonoGridPoints { + #[allow(clippy::useless_format)] + fn message_display(&self) -> String { + format!("") + } + } + impl WireFormat for MsgSsrFlagIonoGridPoints { const MIN_LEN: usize = ::MIN_LEN + ::MIN_LEN @@ -843,6 +869,19 @@ pub mod msg_ssr_flag_iono_grid_point_sat_los { } } + impl FriendlyName for MsgSsrFlagIonoGridPointSatLos { + fn friendly_name() -> &'static str { + "" + } + } + + impl MessageDisplay for MsgSsrFlagIonoGridPointSatLos { + #[allow(clippy::useless_format)] + fn message_display(&self) -> String { + format!("") + } + } + impl WireFormat for MsgSsrFlagIonoGridPointSatLos { const MIN_LEN: usize = ::MIN_LEN + ::MIN_LEN @@ -930,6 +969,19 @@ pub mod msg_ssr_flag_iono_tile_sat_los { } } + impl FriendlyName for MsgSsrFlagIonoTileSatLos { + fn friendly_name() -> &'static str { + "" + } + } + + impl MessageDisplay for MsgSsrFlagIonoTileSatLos { + #[allow(clippy::useless_format)] + fn message_display(&self) -> String { + format!("") + } + } + impl WireFormat for MsgSsrFlagIonoTileSatLos { const MIN_LEN: usize = ::MIN_LEN + ::MIN_LEN @@ -1028,6 +1080,19 @@ pub mod msg_ssr_flag_satellites { } } + impl FriendlyName for MsgSsrFlagSatellites { + fn friendly_name() -> &'static str { + "" + } + } + + impl MessageDisplay for MsgSsrFlagSatellites { + #[allow(clippy::useless_format)] + fn message_display(&self) -> String { + format!("") + } + } + impl WireFormat for MsgSsrFlagSatellites { const MIN_LEN: usize = ::MIN_LEN + ::MIN_LEN @@ -1131,6 +1196,19 @@ pub mod msg_ssr_flag_tropo_grid_points { } } + impl FriendlyName for MsgSsrFlagTropoGridPoints { + fn friendly_name() -> &'static str { + "" + } + } + + impl MessageDisplay for MsgSsrFlagTropoGridPoints { + #[allow(clippy::useless_format)] + fn message_display(&self) -> String { + format!("") + } + } + impl WireFormat for MsgSsrFlagTropoGridPoints { const MIN_LEN: usize = ::MIN_LEN + ::MIN_LEN diff --git a/rust/sbp/src/messages/linux.rs b/rust/sbp/src/messages/linux.rs index e5fca7b5ae..35ac3b26e5 100644 --- a/rust/sbp/src/messages/linux.rs +++ b/rust/sbp/src/messages/linux.rs @@ -115,6 +115,19 @@ pub mod msg_linux_cpu_state { } } + impl FriendlyName for MsgLinuxCpuState { + fn friendly_name() -> &'static str { + "" + } + } + + impl MessageDisplay for MsgLinuxCpuState { + #[allow(clippy::useless_format)] + fn message_display(&self) -> String { + format!("") + } + } + impl WireFormat for MsgLinuxCpuState { const MIN_LEN: usize = ::MIN_LEN + ::MIN_LEN @@ -254,6 +267,19 @@ pub mod msg_linux_cpu_state_dep_a { } } + impl FriendlyName for MsgLinuxCpuStateDepA { + fn friendly_name() -> &'static str { + "" + } + } + + impl MessageDisplay for MsgLinuxCpuStateDepA { + #[allow(clippy::useless_format)] + fn message_display(&self) -> String { + format!("") + } + } + impl WireFormat for MsgLinuxCpuStateDepA { const MIN_LEN: usize = ::MIN_LEN + ::MIN_LEN @@ -377,6 +403,19 @@ pub mod msg_linux_mem_state { } } + impl FriendlyName for MsgLinuxMemState { + fn friendly_name() -> &'static str { + "" + } + } + + impl MessageDisplay for MsgLinuxMemState { + #[allow(clippy::useless_format)] + fn message_display(&self) -> String { + format!("") + } + } + impl WireFormat for MsgLinuxMemState { const MIN_LEN: usize = ::MIN_LEN + ::MIN_LEN @@ -516,6 +555,19 @@ pub mod msg_linux_mem_state_dep_a { } } + impl FriendlyName for MsgLinuxMemStateDepA { + fn friendly_name() -> &'static str { + "" + } + } + + impl MessageDisplay for MsgLinuxMemStateDepA { + #[allow(clippy::useless_format)] + fn message_display(&self) -> String { + format!("") + } + } + impl WireFormat for MsgLinuxMemStateDepA { const MIN_LEN: usize = ::MIN_LEN + ::MIN_LEN @@ -613,6 +665,19 @@ pub mod msg_linux_process_fd_count { } } + impl FriendlyName for MsgLinuxProcessFdCount { + fn friendly_name() -> &'static str { + "" + } + } + + impl MessageDisplay for MsgLinuxProcessFdCount { + #[allow(clippy::useless_format)] + fn message_display(&self) -> String { + format!("") + } + } + impl WireFormat for MsgLinuxProcessFdCount { const MIN_LEN: usize = ::MIN_LEN + ::MIN_LEN @@ -704,6 +769,19 @@ pub mod msg_linux_process_fd_summary { } } + impl FriendlyName for MsgLinuxProcessFdSummary { + fn friendly_name() -> &'static str { + "" + } + } + + impl MessageDisplay for MsgLinuxProcessFdSummary { + #[allow(clippy::useless_format)] + fn message_display(&self) -> String { + format!("") + } + } + impl WireFormat for MsgLinuxProcessFdSummary { const MIN_LEN: usize = ::MIN_LEN + , DoubleNullTerminated> as WireFormat>::MIN_LEN; @@ -798,6 +876,19 @@ pub mod msg_linux_process_socket_counts { } } + impl FriendlyName for MsgLinuxProcessSocketCounts { + fn friendly_name() -> &'static str { + "" + } + } + + impl MessageDisplay for MsgLinuxProcessSocketCounts { + #[allow(clippy::useless_format)] + fn message_display(&self) -> String { + format!("") + } + } + impl WireFormat for MsgLinuxProcessSocketCounts { const MIN_LEN: usize = ::MIN_LEN + ::MIN_LEN @@ -916,6 +1007,19 @@ pub mod msg_linux_process_socket_queues { } } + impl FriendlyName for MsgLinuxProcessSocketQueues { + fn friendly_name() -> &'static str { + "" + } + } + + impl MessageDisplay for MsgLinuxProcessSocketQueues { + #[allow(clippy::useless_format)] + fn message_display(&self) -> String { + format!("") + } + } + impl WireFormat for MsgLinuxProcessSocketQueues { const MIN_LEN: usize = ::MIN_LEN + ::MIN_LEN @@ -1029,6 +1133,19 @@ pub mod msg_linux_socket_usage { } } + impl FriendlyName for MsgLinuxSocketUsage { + fn friendly_name() -> &'static str { + "" + } + } + + impl MessageDisplay for MsgLinuxSocketUsage { + #[allow(clippy::useless_format)] + fn message_display(&self) -> String { + format!("") + } + } + impl WireFormat for MsgLinuxSocketUsage { const MIN_LEN: usize = ::MIN_LEN + ::MIN_LEN @@ -1151,6 +1268,19 @@ pub mod msg_linux_sys_state { } } + impl FriendlyName for MsgLinuxSysState { + fn friendly_name() -> &'static str { + "" + } + } + + impl MessageDisplay for MsgLinuxSysState { + #[allow(clippy::useless_format)] + fn message_display(&self) -> String { + format!("") + } + } + impl WireFormat for MsgLinuxSysState { const MIN_LEN: usize = ::MIN_LEN + ::MIN_LEN @@ -1296,6 +1426,19 @@ pub mod msg_linux_sys_state_dep_a { } } + impl FriendlyName for MsgLinuxSysStateDepA { + fn friendly_name() -> &'static str { + "" + } + } + + impl MessageDisplay for MsgLinuxSysStateDepA { + #[allow(clippy::useless_format)] + fn message_display(&self) -> String { + format!("") + } + } + impl WireFormat for MsgLinuxSysStateDepA { const MIN_LEN: usize = ::MIN_LEN + ::MIN_LEN diff --git a/rust/sbp/src/messages/logging.rs b/rust/sbp/src/messages/logging.rs index 369cb15ca6..8594e88be3 100644 --- a/rust/sbp/src/messages/logging.rs +++ b/rust/sbp/src/messages/logging.rs @@ -85,6 +85,19 @@ pub mod msg_fwd { } } + impl FriendlyName for MsgFwd { + fn friendly_name() -> &'static str { + "" + } + } + + impl MessageDisplay for MsgFwd { + #[allow(clippy::useless_format)] + fn message_display(&self) -> String { + format!("") + } + } + impl WireFormat for MsgFwd { const MIN_LEN: usize = ::MIN_LEN + ::MIN_LEN @@ -186,6 +199,19 @@ pub mod msg_log { } } + impl FriendlyName for MsgLog { + fn friendly_name() -> &'static str { + "" + } + } + + impl MessageDisplay for MsgLog { + #[allow(clippy::useless_format)] + fn message_display(&self) -> String { + format!("") + } + } + impl WireFormat for MsgLog { const MIN_LEN: usize = ::MIN_LEN + , Unterminated> as WireFormat>::MIN_LEN; @@ -321,6 +347,19 @@ pub mod msg_print_dep { } } + impl FriendlyName for MsgPrintDep { + fn friendly_name() -> &'static str { + "" + } + } + + impl MessageDisplay for MsgPrintDep { + #[allow(clippy::useless_format)] + fn message_display(&self) -> String { + format!("") + } + } + impl WireFormat for MsgPrintDep { const MIN_LEN: usize = , Unterminated> as WireFormat>::MIN_LEN; fn len(&self) -> usize { diff --git a/rust/sbp/src/messages/mag.rs b/rust/sbp/src/messages/mag.rs index ebeb4c9d59..3d2dd92619 100644 --- a/rust/sbp/src/messages/mag.rs +++ b/rust/sbp/src/messages/mag.rs @@ -92,6 +92,19 @@ pub mod msg_mag_raw { } } + impl FriendlyName for MsgMagRaw { + fn friendly_name() -> &'static str { + "" + } + } + + impl MessageDisplay for MsgMagRaw { + #[allow(clippy::useless_format)] + fn message_display(&self) -> String { + format!("") + } + } + impl WireFormat for MsgMagRaw { const MIN_LEN: usize = ::MIN_LEN + ::MIN_LEN diff --git a/rust/sbp/src/messages/mod.rs b/rust/sbp/src/messages/mod.rs index bd511a2be7..a7b7012087 100644 --- a/rust/sbp/src/messages/mod.rs +++ b/rust/sbp/src/messages/mod.rs @@ -271,7 +271,9 @@ mod lib { pub use crate::time; pub use crate::wire_format::{PayloadParseError, WireFormat}; - pub use super::{ConcreteMessage, Sbp, SbpMessage, TryFromSbpError}; + pub use super::{ + ConcreteMessage, FriendlyName, MessageDisplay, Sbp, SbpMessage, TryFromSbpError, + }; pub use bytes::{Buf, BufMut}; @@ -334,6 +336,16 @@ pub trait ConcreteMessage: SbpMessage + TryFrom { const MESSAGE_NAME: &'static str; } +/// Friendly name representation of Sbp message +pub trait FriendlyName { + fn friendly_name() -> &'static str; +} + +/// Enriched fields display of Sbp messages +pub trait MessageDisplay { + fn message_display(&self) -> String; +} + /// The error returned when using [TryFrom] to convert [Sbp] to the wrong message type. #[derive(Debug, Clone)] pub struct TryFromSbpError; diff --git a/rust/sbp/src/messages/navigation.rs b/rust/sbp/src/messages/navigation.rs index 294223d752..abacea5a09 100644 --- a/rust/sbp/src/messages/navigation.rs +++ b/rust/sbp/src/messages/navigation.rs @@ -195,6 +195,19 @@ pub mod msg_age_corrections { } } + impl FriendlyName for MsgAgeCorrections { + fn friendly_name() -> &'static str { + "" + } + } + + impl MessageDisplay for MsgAgeCorrections { + #[allow(clippy::useless_format)] + fn message_display(&self) -> String { + format!("") + } + } + impl WireFormat for MsgAgeCorrections { const MIN_LEN: usize = ::MIN_LEN + ::MIN_LEN; fn len(&self) -> usize { @@ -315,6 +328,19 @@ pub mod msg_baseline_ecef { } } + impl FriendlyName for MsgBaselineEcef { + fn friendly_name() -> &'static str { + "" + } + } + + impl MessageDisplay for MsgBaselineEcef { + #[allow(clippy::useless_format)] + fn message_display(&self) -> String { + format!("") + } + } + impl WireFormat for MsgBaselineEcef { const MIN_LEN: usize = ::MIN_LEN + ::MIN_LEN @@ -525,6 +551,19 @@ pub mod msg_baseline_ecef_dep_a { } } + impl FriendlyName for MsgBaselineEcefDepA { + fn friendly_name() -> &'static str { + "" + } + } + + impl MessageDisplay for MsgBaselineEcefDepA { + #[allow(clippy::useless_format)] + fn message_display(&self) -> String { + format!("") + } + } + impl WireFormat for MsgBaselineEcefDepA { const MIN_LEN: usize = ::MIN_LEN + ::MIN_LEN @@ -781,6 +820,19 @@ pub mod msg_baseline_heading_dep_a { } } + impl FriendlyName for MsgBaselineHeadingDepA { + fn friendly_name() -> &'static str { + "" + } + } + + impl MessageDisplay for MsgBaselineHeadingDepA { + #[allow(clippy::useless_format)] + fn message_display(&self) -> String { + format!("") + } + } + impl WireFormat for MsgBaselineHeadingDepA { const MIN_LEN: usize = ::MIN_LEN + ::MIN_LEN @@ -1012,6 +1064,19 @@ pub mod msg_baseline_ned { } } + impl FriendlyName for MsgBaselineNed { + fn friendly_name() -> &'static str { + "" + } + } + + impl MessageDisplay for MsgBaselineNed { + #[allow(clippy::useless_format)] + fn message_display(&self) -> String { + format!("") + } + } + impl WireFormat for MsgBaselineNed { const MIN_LEN: usize = ::MIN_LEN + ::MIN_LEN @@ -1231,6 +1296,19 @@ pub mod msg_baseline_ned_dep_a { } } + impl FriendlyName for MsgBaselineNedDepA { + fn friendly_name() -> &'static str { + "" + } + } + + impl MessageDisplay for MsgBaselineNedDepA { + #[allow(clippy::useless_format)] + fn message_display(&self) -> String { + format!("") + } + } + impl WireFormat for MsgBaselineNedDepA { const MIN_LEN: usize = ::MIN_LEN + ::MIN_LEN @@ -1484,6 +1562,19 @@ pub mod msg_dops { } } + impl FriendlyName for MsgDops { + fn friendly_name() -> &'static str { + "" + } + } + + impl MessageDisplay for MsgDops { + #[allow(clippy::useless_format)] + fn message_display(&self) -> String { + format!("") + } + } + impl WireFormat for MsgDops { const MIN_LEN: usize = ::MIN_LEN + ::MIN_LEN @@ -1660,6 +1751,19 @@ pub mod msg_dops_dep_a { } } + impl FriendlyName for MsgDopsDepA { + fn friendly_name() -> &'static str { + "" + } + } + + impl MessageDisplay for MsgDopsDepA { + #[allow(clippy::useless_format)] + fn message_display(&self) -> String { + format!("") + } + } + impl WireFormat for MsgDopsDepA { const MIN_LEN: usize = ::MIN_LEN + ::MIN_LEN @@ -1802,6 +1906,19 @@ pub mod msg_gps_time { } } + impl FriendlyName for MsgGpsTime { + fn friendly_name() -> &'static str { + "" + } + } + + impl MessageDisplay for MsgGpsTime { + #[allow(clippy::useless_format)] + fn message_display(&self) -> String { + format!("") + } + } + impl WireFormat for MsgGpsTime { const MIN_LEN: usize = ::MIN_LEN + ::MIN_LEN @@ -1955,6 +2072,19 @@ pub mod msg_gps_time_dep_a { } } + impl FriendlyName for MsgGpsTimeDepA { + fn friendly_name() -> &'static str { + "" + } + } + + impl MessageDisplay for MsgGpsTimeDepA { + #[allow(clippy::useless_format)] + fn message_display(&self) -> String { + format!("") + } + } + impl WireFormat for MsgGpsTimeDepA { const MIN_LEN: usize = ::MIN_LEN + ::MIN_LEN @@ -2089,6 +2219,19 @@ pub mod msg_gps_time_gnss { } } + impl FriendlyName for MsgGpsTimeGnss { + fn friendly_name() -> &'static str { + "" + } + } + + impl MessageDisplay for MsgGpsTimeGnss { + #[allow(clippy::useless_format)] + fn message_display(&self) -> String { + format!("") + } + } + impl WireFormat for MsgGpsTimeGnss { const MIN_LEN: usize = ::MIN_LEN + ::MIN_LEN @@ -2340,6 +2483,19 @@ pub mod msg_pose_relative { } } + impl FriendlyName for MsgPoseRelative { + fn friendly_name() -> &'static str { + "" + } + } + + impl MessageDisplay for MsgPoseRelative { + #[allow(clippy::useless_format)] + fn message_display(&self) -> String { + format!("") + } + } + impl WireFormat for MsgPoseRelative { const MIN_LEN: usize = ::MIN_LEN + ::MIN_LEN @@ -2671,6 +2827,19 @@ pub mod msg_pos_ecef { } } + impl FriendlyName for MsgPosEcef { + fn friendly_name() -> &'static str { + "" + } + } + + impl MessageDisplay for MsgPosEcef { + #[allow(clippy::useless_format)] + fn message_display(&self) -> String { + format!("") + } + } + impl WireFormat for MsgPosEcef { const MIN_LEN: usize = ::MIN_LEN + ::MIN_LEN @@ -2978,6 +3147,19 @@ pub mod msg_pos_ecef_cov { } } + impl FriendlyName for MsgPosEcefCov { + fn friendly_name() -> &'static str { + "" + } + } + + impl MessageDisplay for MsgPosEcefCov { + #[allow(clippy::useless_format)] + fn message_display(&self) -> String { + format!("") + } + } + impl WireFormat for MsgPosEcefCov { const MIN_LEN: usize = ::MIN_LEN + ::MIN_LEN @@ -3274,6 +3456,19 @@ pub mod msg_pos_ecef_cov_gnss { } } + impl FriendlyName for MsgPosEcefCovGnss { + fn friendly_name() -> &'static str { + "" + } + } + + impl MessageDisplay for MsgPosEcefCovGnss { + #[allow(clippy::useless_format)] + fn message_display(&self) -> String { + format!("") + } + } + impl WireFormat for MsgPosEcefCovGnss { const MIN_LEN: usize = ::MIN_LEN + ::MIN_LEN @@ -3517,6 +3712,19 @@ pub mod msg_pos_ecef_dep_a { } } + impl FriendlyName for MsgPosEcefDepA { + fn friendly_name() -> &'static str { + "" + } + } + + impl MessageDisplay for MsgPosEcefDepA { + #[allow(clippy::useless_format)] + fn message_display(&self) -> String { + format!("") + } + } + impl WireFormat for MsgPosEcefDepA { const MIN_LEN: usize = ::MIN_LEN + ::MIN_LEN @@ -3763,6 +3971,19 @@ pub mod msg_pos_ecef_gnss { } } + impl FriendlyName for MsgPosEcefGnss { + fn friendly_name() -> &'static str { + "" + } + } + + impl MessageDisplay for MsgPosEcefGnss { + #[allow(clippy::useless_format)] + fn message_display(&self) -> String { + format!("") + } + } + impl WireFormat for MsgPosEcefGnss { const MIN_LEN: usize = ::MIN_LEN + ::MIN_LEN @@ -3992,6 +4213,19 @@ pub mod msg_pos_llh { } } + impl FriendlyName for MsgPosLlh { + fn friendly_name() -> &'static str { + "" + } + } + + impl MessageDisplay for MsgPosLlh { + #[allow(clippy::useless_format)] + fn message_display(&self) -> String { + format!("") + } + } + impl WireFormat for MsgPosLlh { const MIN_LEN: usize = ::MIN_LEN + ::MIN_LEN @@ -4351,6 +4585,19 @@ pub mod msg_pos_llh_acc { } } + impl FriendlyName for MsgPosLlhAcc { + fn friendly_name() -> &'static str { + "" + } + } + + impl MessageDisplay for MsgPosLlhAcc { + #[allow(clippy::useless_format)] + fn message_display(&self) -> String { + format!("") + } + } + impl WireFormat for MsgPosLlhAcc { const MIN_LEN: usize = ::MIN_LEN + ::MIN_LEN @@ -4752,6 +4999,19 @@ pub mod msg_pos_llh_cov { } } + impl FriendlyName for MsgPosLlhCov { + fn friendly_name() -> &'static str { + "" + } + } + + impl MessageDisplay for MsgPosLlhCov { + #[allow(clippy::useless_format)] + fn message_display(&self) -> String { + format!("") + } + } + impl WireFormat for MsgPosLlhCov { const MIN_LEN: usize = ::MIN_LEN + ::MIN_LEN @@ -5048,6 +5308,19 @@ pub mod msg_pos_llh_cov_gnss { } } + impl FriendlyName for MsgPosLlhCovGnss { + fn friendly_name() -> &'static str { + "" + } + } + + impl MessageDisplay for MsgPosLlhCovGnss { + #[allow(clippy::useless_format)] + fn message_display(&self) -> String { + format!("") + } + } + impl WireFormat for MsgPosLlhCovGnss { const MIN_LEN: usize = ::MIN_LEN + ::MIN_LEN @@ -5313,6 +5586,19 @@ pub mod msg_pos_llh_dep_a { } } + impl FriendlyName for MsgPosLlhDepA { + fn friendly_name() -> &'static str { + "" + } + } + + impl MessageDisplay for MsgPosLlhDepA { + #[allow(clippy::useless_format)] + fn message_display(&self) -> String { + format!("") + } + } + impl WireFormat for MsgPosLlhDepA { const MIN_LEN: usize = ::MIN_LEN + ::MIN_LEN @@ -5598,6 +5884,19 @@ pub mod msg_pos_llh_gnss { } } + impl FriendlyName for MsgPosLlhGnss { + fn friendly_name() -> &'static str { + "" + } + } + + impl MessageDisplay for MsgPosLlhGnss { + #[allow(clippy::useless_format)] + fn message_display(&self) -> String { + format!("") + } + } + impl WireFormat for MsgPosLlhGnss { const MIN_LEN: usize = ::MIN_LEN + ::MIN_LEN @@ -6011,6 +6310,19 @@ pub mod msg_protection_level { } } + impl FriendlyName for MsgProtectionLevel { + fn friendly_name() -> &'static str { + "" + } + } + + impl MessageDisplay for MsgProtectionLevel { + #[allow(clippy::useless_format)] + fn message_display(&self) -> String { + format!("") + } + } + impl WireFormat for MsgProtectionLevel { const MIN_LEN: usize = ::MIN_LEN + ::MIN_LEN @@ -6333,6 +6645,19 @@ pub mod msg_protection_level_dep_a { } } + impl FriendlyName for MsgProtectionLevelDepA { + fn friendly_name() -> &'static str { + "" + } + } + + impl MessageDisplay for MsgProtectionLevelDepA { + #[allow(clippy::useless_format)] + fn message_display(&self) -> String { + format!("") + } + } + impl WireFormat for MsgProtectionLevelDepA { const MIN_LEN: usize = ::MIN_LEN + ::MIN_LEN @@ -6524,6 +6849,19 @@ pub mod msg_reference_frame_param { } } + impl FriendlyName for MsgReferenceFrameParam { + fn friendly_name() -> &'static str { + "" + } + } + + impl MessageDisplay for MsgReferenceFrameParam { + #[allow(clippy::useless_format)] + fn message_display(&self) -> String { + format!("") + } + } + impl WireFormat for MsgReferenceFrameParam { const MIN_LEN: usize = ::MIN_LEN + as WireFormat>::MIN_LEN @@ -6698,6 +7036,19 @@ pub mod msg_utc_leap_second { } } + impl FriendlyName for MsgUtcLeapSecond { + fn friendly_name() -> &'static str { + "" + } + } + + impl MessageDisplay for MsgUtcLeapSecond { + #[allow(clippy::useless_format)] + fn message_display(&self) -> String { + format!("") + } + } + impl WireFormat for MsgUtcLeapSecond { const MIN_LEN: usize = ::MIN_LEN + ::MIN_LEN @@ -6867,6 +7218,19 @@ pub mod msg_utc_time { } } + impl FriendlyName for MsgUtcTime { + fn friendly_name() -> &'static str { + "" + } + } + + impl MessageDisplay for MsgUtcTime { + #[allow(clippy::useless_format)] + fn message_display(&self) -> String { + format!("") + } + } + impl WireFormat for MsgUtcTime { const MIN_LEN: usize = ::MIN_LEN + ::MIN_LEN @@ -7106,6 +7470,19 @@ pub mod msg_utc_time_gnss { } } + impl FriendlyName for MsgUtcTimeGnss { + fn friendly_name() -> &'static str { + "" + } + } + + impl MessageDisplay for MsgUtcTimeGnss { + #[allow(clippy::useless_format)] + fn message_display(&self) -> String { + format!("") + } + } + impl WireFormat for MsgUtcTimeGnss { const MIN_LEN: usize = ::MIN_LEN + ::MIN_LEN @@ -7360,6 +7737,19 @@ pub mod msg_vel_body { } } + impl FriendlyName for MsgVelBody { + fn friendly_name() -> &'static str { + "" + } + } + + impl MessageDisplay for MsgVelBody { + #[allow(clippy::useless_format)] + fn message_display(&self) -> String { + format!("") + } + } + impl WireFormat for MsgVelBody { const MIN_LEN: usize = ::MIN_LEN + ::MIN_LEN @@ -7689,6 +8079,19 @@ pub mod msg_vel_cog { } } + impl FriendlyName for MsgVelCog { + fn friendly_name() -> &'static str { + "" + } + } + + impl MessageDisplay for MsgVelCog { + #[allow(clippy::useless_format)] + fn message_display(&self) -> String { + format!("") + } + } + impl WireFormat for MsgVelCog { const MIN_LEN: usize = ::MIN_LEN + ::MIN_LEN @@ -8084,6 +8487,19 @@ pub mod msg_vel_ecef { } } + impl FriendlyName for MsgVelEcef { + fn friendly_name() -> &'static str { + "" + } + } + + impl MessageDisplay for MsgVelEcef { + #[allow(clippy::useless_format)] + fn message_display(&self) -> String { + format!("") + } + } + impl WireFormat for MsgVelEcef { const MIN_LEN: usize = ::MIN_LEN + ::MIN_LEN @@ -8368,6 +8784,19 @@ pub mod msg_vel_ecef_cov { } } + impl FriendlyName for MsgVelEcefCov { + fn friendly_name() -> &'static str { + "" + } + } + + impl MessageDisplay for MsgVelEcefCov { + #[allow(clippy::useless_format)] + fn message_display(&self) -> String { + format!("") + } + } + impl WireFormat for MsgVelEcefCov { const MIN_LEN: usize = ::MIN_LEN + ::MIN_LEN @@ -8644,6 +9073,19 @@ pub mod msg_vel_ecef_cov_gnss { } } + impl FriendlyName for MsgVelEcefCovGnss { + fn friendly_name() -> &'static str { + "" + } + } + + impl MessageDisplay for MsgVelEcefCovGnss { + #[allow(clippy::useless_format)] + fn message_display(&self) -> String { + format!("") + } + } + impl WireFormat for MsgVelEcefCovGnss { const MIN_LEN: usize = ::MIN_LEN + ::MIN_LEN @@ -8824,6 +9266,19 @@ pub mod msg_vel_ecef_dep_a { } } + impl FriendlyName for MsgVelEcefDepA { + fn friendly_name() -> &'static str { + "" + } + } + + impl MessageDisplay for MsgVelEcefDepA { + #[allow(clippy::useless_format)] + fn message_display(&self) -> String { + format!("") + } + } + impl WireFormat for MsgVelEcefDepA { const MIN_LEN: usize = ::MIN_LEN + ::MIN_LEN @@ -8965,6 +9420,19 @@ pub mod msg_vel_ecef_gnss { } } + impl FriendlyName for MsgVelEcefGnss { + fn friendly_name() -> &'static str { + "" + } + } + + impl MessageDisplay for MsgVelEcefGnss { + #[allow(clippy::useless_format)] + fn message_display(&self) -> String { + format!("") + } + } + impl WireFormat for MsgVelEcefGnss { const MIN_LEN: usize = ::MIN_LEN + ::MIN_LEN @@ -9173,6 +9641,19 @@ pub mod msg_vel_ned { } } + impl FriendlyName for MsgVelNed { + fn friendly_name() -> &'static str { + "" + } + } + + impl MessageDisplay for MsgVelNed { + #[allow(clippy::useless_format)] + fn message_display(&self) -> String { + format!("") + } + } + impl WireFormat for MsgVelNed { const MIN_LEN: usize = ::MIN_LEN + ::MIN_LEN @@ -9464,6 +9945,19 @@ pub mod msg_vel_ned_cov { } } + impl FriendlyName for MsgVelNedCov { + fn friendly_name() -> &'static str { + "" + } + } + + impl MessageDisplay for MsgVelNedCov { + #[allow(clippy::useless_format)] + fn message_display(&self) -> String { + format!("") + } + } + impl WireFormat for MsgVelNedCov { const MIN_LEN: usize = ::MIN_LEN + ::MIN_LEN @@ -9743,6 +10237,19 @@ pub mod msg_vel_ned_cov_gnss { } } + impl FriendlyName for MsgVelNedCovGnss { + fn friendly_name() -> &'static str { + "" + } + } + + impl MessageDisplay for MsgVelNedCovGnss { + #[allow(clippy::useless_format)] + fn message_display(&self) -> String { + format!("") + } + } + impl WireFormat for MsgVelNedCovGnss { const MIN_LEN: usize = ::MIN_LEN + ::MIN_LEN @@ -9927,6 +10434,19 @@ pub mod msg_vel_ned_dep_a { } } + impl FriendlyName for MsgVelNedDepA { + fn friendly_name() -> &'static str { + "" + } + } + + impl MessageDisplay for MsgVelNedDepA { + #[allow(clippy::useless_format)] + fn message_display(&self) -> String { + format!("") + } + } + impl WireFormat for MsgVelNedDepA { const MIN_LEN: usize = ::MIN_LEN + ::MIN_LEN @@ -10076,6 +10596,19 @@ pub mod msg_vel_ned_gnss { } } + impl FriendlyName for MsgVelNedGnss { + fn friendly_name() -> &'static str { + "" + } + } + + impl MessageDisplay for MsgVelNedGnss { + #[allow(clippy::useless_format)] + fn message_display(&self) -> String { + format!("") + } + } + impl WireFormat for MsgVelNedGnss { const MIN_LEN: usize = ::MIN_LEN + ::MIN_LEN diff --git a/rust/sbp/src/messages/ndb.rs b/rust/sbp/src/messages/ndb.rs index 119ac9a204..3c112d62bb 100644 --- a/rust/sbp/src/messages/ndb.rs +++ b/rust/sbp/src/messages/ndb.rs @@ -157,6 +157,19 @@ pub mod msg_ndb_event { } } + impl FriendlyName for MsgNdbEvent { + fn friendly_name() -> &'static str { + "" + } + } + + impl MessageDisplay for MsgNdbEvent { + #[allow(clippy::useless_format)] + fn message_display(&self) -> String { + format!("") + } + } + impl WireFormat for MsgNdbEvent { const MIN_LEN: usize = ::MIN_LEN + ::MIN_LEN diff --git a/rust/sbp/src/messages/observation.rs b/rust/sbp/src/messages/observation.rs index 25db874bc9..94c2dd8e50 100644 --- a/rust/sbp/src/messages/observation.rs +++ b/rust/sbp/src/messages/observation.rs @@ -739,6 +739,19 @@ pub mod msg_almanac_glo { } } + impl FriendlyName for MsgAlmanacGlo { + fn friendly_name() -> &'static str { + "" + } + } + + impl MessageDisplay for MsgAlmanacGlo { + #[allow(clippy::useless_format)] + fn message_display(&self) -> String { + format!("") + } + } + impl WireFormat for MsgAlmanacGlo { const MIN_LEN: usize = ::MIN_LEN + ::MIN_LEN @@ -865,6 +878,19 @@ pub mod msg_almanac_glo_dep { } } + impl FriendlyName for MsgAlmanacGloDep { + fn friendly_name() -> &'static str { + "" + } + } + + impl MessageDisplay for MsgAlmanacGloDep { + #[allow(clippy::useless_format)] + fn message_display(&self) -> String { + format!("") + } + } + impl WireFormat for MsgAlmanacGloDep { const MIN_LEN: usize = ::MIN_LEN + ::MIN_LEN @@ -996,6 +1022,19 @@ pub mod msg_almanac_gps { } } + impl FriendlyName for MsgAlmanacGps { + fn friendly_name() -> &'static str { + "" + } + } + + impl MessageDisplay for MsgAlmanacGps { + #[allow(clippy::useless_format)] + fn message_display(&self) -> String { + format!("") + } + } + impl WireFormat for MsgAlmanacGps { const MIN_LEN: usize = ::MIN_LEN + ::MIN_LEN @@ -1135,6 +1174,19 @@ pub mod msg_almanac_gps_dep { } } + impl FriendlyName for MsgAlmanacGpsDep { + fn friendly_name() -> &'static str { + "" + } + } + + impl MessageDisplay for MsgAlmanacGpsDep { + #[allow(clippy::useless_format)] + fn message_display(&self) -> String { + format!("") + } + } + impl WireFormat for MsgAlmanacGpsDep { const MIN_LEN: usize = ::MIN_LEN + ::MIN_LEN @@ -1254,6 +1306,19 @@ pub mod msg_base_pos_ecef { } } + impl FriendlyName for MsgBasePosEcef { + fn friendly_name() -> &'static str { + "" + } + } + + impl MessageDisplay for MsgBasePosEcef { + #[allow(clippy::useless_format)] + fn message_display(&self) -> String { + format!("") + } + } + impl WireFormat for MsgBasePosEcef { const MIN_LEN: usize = ::MIN_LEN + ::MIN_LEN @@ -1342,6 +1407,19 @@ pub mod msg_base_pos_llh { } } + impl FriendlyName for MsgBasePosLlh { + fn friendly_name() -> &'static str { + "" + } + } + + impl MessageDisplay for MsgBasePosLlh { + #[allow(clippy::useless_format)] + fn message_display(&self) -> String { + format!("") + } + } + impl WireFormat for MsgBasePosLlh { const MIN_LEN: usize = ::MIN_LEN + ::MIN_LEN @@ -1501,6 +1579,19 @@ pub mod msg_ephemeris_bds { } } + impl FriendlyName for MsgEphemerisBds { + fn friendly_name() -> &'static str { + "" + } + } + + impl MessageDisplay for MsgEphemerisBds { + #[allow(clippy::useless_format)] + fn message_display(&self) -> String { + format!("") + } + } + impl WireFormat for MsgEphemerisBds { const MIN_LEN: usize = ::MIN_LEN + ::MIN_LEN @@ -1745,6 +1836,19 @@ pub mod msg_ephemeris_dep_a { } } + impl FriendlyName for MsgEphemerisDepA { + fn friendly_name() -> &'static str { + "" + } + } + + impl MessageDisplay for MsgEphemerisDepA { + #[allow(clippy::useless_format)] + fn message_display(&self) -> String { + format!("") + } + } + impl WireFormat for MsgEphemerisDepA { const MIN_LEN: usize = ::MIN_LEN + ::MIN_LEN @@ -2000,6 +2104,19 @@ pub mod msg_ephemeris_dep_b { } } + impl FriendlyName for MsgEphemerisDepB { + fn friendly_name() -> &'static str { + "" + } + } + + impl MessageDisplay for MsgEphemerisDepB { + #[allow(clippy::useless_format)] + fn message_display(&self) -> String { + format!("") + } + } + impl WireFormat for MsgEphemerisDepB { const MIN_LEN: usize = ::MIN_LEN + ::MIN_LEN @@ -2268,6 +2385,19 @@ pub mod msg_ephemeris_dep_c { } } + impl FriendlyName for MsgEphemerisDepC { + fn friendly_name() -> &'static str { + "" + } + } + + impl MessageDisplay for MsgEphemerisDepC { + #[allow(clippy::useless_format)] + fn message_display(&self) -> String { + format!("") + } + } + impl WireFormat for MsgEphemerisDepC { const MIN_LEN: usize = ::MIN_LEN + ::MIN_LEN @@ -2544,6 +2674,19 @@ pub mod msg_ephemeris_dep_d { } } + impl FriendlyName for MsgEphemerisDepD { + fn friendly_name() -> &'static str { + "" + } + } + + impl MessageDisplay for MsgEphemerisDepD { + #[allow(clippy::useless_format)] + fn message_display(&self) -> String { + format!("") + } + } + impl WireFormat for MsgEphemerisDepD { const MIN_LEN: usize = ::MIN_LEN + ::MIN_LEN @@ -2808,6 +2951,19 @@ pub mod msg_ephemeris_gal { } } + impl FriendlyName for MsgEphemerisGal { + fn friendly_name() -> &'static str { + "" + } + } + + impl MessageDisplay for MsgEphemerisGal { + #[allow(clippy::useless_format)] + fn message_display(&self) -> String { + format!("") + } + } + impl WireFormat for MsgEphemerisGal { const MIN_LEN: usize = ::MIN_LEN + ::MIN_LEN @@ -3051,6 +3207,19 @@ pub mod msg_ephemeris_gal_dep_a { } } + impl FriendlyName for MsgEphemerisGalDepA { + fn friendly_name() -> &'static str { + "" + } + } + + impl MessageDisplay for MsgEphemerisGalDepA { + #[allow(clippy::useless_format)] + fn message_display(&self) -> String { + format!("") + } + } + impl WireFormat for MsgEphemerisGalDepA { const MIN_LEN: usize = ::MIN_LEN + ::MIN_LEN @@ -3243,6 +3412,19 @@ pub mod msg_ephemeris_glo { } } + impl FriendlyName for MsgEphemerisGlo { + fn friendly_name() -> &'static str { + "" + } + } + + impl MessageDisplay for MsgEphemerisGlo { + #[allow(clippy::useless_format)] + fn message_display(&self) -> String { + format!("") + } + } + impl WireFormat for MsgEphemerisGlo { const MIN_LEN: usize = ::MIN_LEN + ::MIN_LEN @@ -3366,6 +3548,19 @@ pub mod msg_ephemeris_glo_dep_a { } } + impl FriendlyName for MsgEphemerisGloDepA { + fn friendly_name() -> &'static str { + "" + } + } + + impl MessageDisplay for MsgEphemerisGloDepA { + #[allow(clippy::useless_format)] + fn message_display(&self) -> String { + format!("") + } + } + impl WireFormat for MsgEphemerisGloDepA { const MIN_LEN: usize = ::MIN_LEN + ::MIN_LEN @@ -3477,6 +3672,19 @@ pub mod msg_ephemeris_glo_dep_b { } } + impl FriendlyName for MsgEphemerisGloDepB { + fn friendly_name() -> &'static str { + "" + } + } + + impl MessageDisplay for MsgEphemerisGloDepB { + #[allow(clippy::useless_format)] + fn message_display(&self) -> String { + format!("") + } + } + impl WireFormat for MsgEphemerisGloDepB { const MIN_LEN: usize = ::MIN_LEN + ::MIN_LEN @@ -3594,6 +3802,19 @@ pub mod msg_ephemeris_glo_dep_c { } } + impl FriendlyName for MsgEphemerisGloDepC { + fn friendly_name() -> &'static str { + "" + } + } + + impl MessageDisplay for MsgEphemerisGloDepC { + #[allow(clippy::useless_format)] + fn message_display(&self) -> String { + format!("") + } + } + impl WireFormat for MsgEphemerisGloDepC { const MIN_LEN: usize = ::MIN_LEN + ::MIN_LEN @@ -3720,6 +3941,19 @@ pub mod msg_ephemeris_glo_dep_d { } } + impl FriendlyName for MsgEphemerisGloDepD { + fn friendly_name() -> &'static str { + "" + } + } + + impl MessageDisplay for MsgEphemerisGloDepD { + #[allow(clippy::useless_format)] + fn message_display(&self) -> String { + format!("") + } + } + impl WireFormat for MsgEphemerisGloDepD { const MIN_LEN: usize = ::MIN_LEN + ::MIN_LEN @@ -3898,6 +4132,19 @@ pub mod msg_ephemeris_gps { } } + impl FriendlyName for MsgEphemerisGps { + fn friendly_name() -> &'static str { + "" + } + } + + impl MessageDisplay for MsgEphemerisGps { + #[allow(clippy::useless_format)] + fn message_display(&self) -> String { + format!("") + } + } + impl WireFormat for MsgEphemerisGps { const MIN_LEN: usize = ::MIN_LEN + ::MIN_LEN @@ -4132,6 +4379,19 @@ pub mod msg_ephemeris_gps_dep_e { } } + impl FriendlyName for MsgEphemerisGpsDepE { + fn friendly_name() -> &'static str { + "" + } + } + + impl MessageDisplay for MsgEphemerisGpsDepE { + #[allow(clippy::useless_format)] + fn message_display(&self) -> String { + format!("") + } + } + impl WireFormat for MsgEphemerisGpsDepE { const MIN_LEN: usize = ::MIN_LEN + ::MIN_LEN @@ -4364,6 +4624,19 @@ pub mod msg_ephemeris_gps_dep_f { } } + impl FriendlyName for MsgEphemerisGpsDepF { + fn friendly_name() -> &'static str { + "" + } + } + + impl MessageDisplay for MsgEphemerisGpsDepF { + #[allow(clippy::useless_format)] + fn message_display(&self) -> String { + format!("") + } + } + impl WireFormat for MsgEphemerisGpsDepF { const MIN_LEN: usize = ::MIN_LEN + ::MIN_LEN @@ -4596,6 +4869,19 @@ pub mod msg_ephemeris_qzss { } } + impl FriendlyName for MsgEphemerisQzss { + fn friendly_name() -> &'static str { + "" + } + } + + impl MessageDisplay for MsgEphemerisQzss { + #[allow(clippy::useless_format)] + fn message_display(&self) -> String { + format!("") + } + } + impl WireFormat for MsgEphemerisQzss { const MIN_LEN: usize = ::MIN_LEN + ::MIN_LEN @@ -4768,6 +5054,19 @@ pub mod msg_ephemeris_sbas { } } + impl FriendlyName for MsgEphemerisSbas { + fn friendly_name() -> &'static str { + "" + } + } + + impl MessageDisplay for MsgEphemerisSbas { + #[allow(clippy::useless_format)] + fn message_display(&self) -> String { + format!("") + } + } + impl WireFormat for MsgEphemerisSbas { const MIN_LEN: usize = ::MIN_LEN + <[f64; 3] as WireFormat>::MIN_LEN @@ -4872,6 +5171,19 @@ pub mod msg_ephemeris_sbas_dep_a { } } + impl FriendlyName for MsgEphemerisSbasDepA { + fn friendly_name() -> &'static str { + "" + } + } + + impl MessageDisplay for MsgEphemerisSbasDepA { + #[allow(clippy::useless_format)] + fn message_display(&self) -> String { + format!("") + } + } + impl WireFormat for MsgEphemerisSbasDepA { const MIN_LEN: usize = ::MIN_LEN + <[f64; 3] as WireFormat>::MIN_LEN @@ -4981,6 +5293,19 @@ pub mod msg_ephemeris_sbas_dep_b { } } + impl FriendlyName for MsgEphemerisSbasDepB { + fn friendly_name() -> &'static str { + "" + } + } + + impl MessageDisplay for MsgEphemerisSbasDepB { + #[allow(clippy::useless_format)] + fn message_display(&self) -> String { + format!("") + } + } + impl WireFormat for MsgEphemerisSbasDepB { const MIN_LEN: usize = ::MIN_LEN + <[f64; 3] as WireFormat>::MIN_LEN @@ -5088,6 +5413,19 @@ pub mod msg_glo_biases { } } + impl FriendlyName for MsgGloBiases { + fn friendly_name() -> &'static str { + "" + } + } + + impl MessageDisplay for MsgGloBiases { + #[allow(clippy::useless_format)] + fn message_display(&self) -> String { + format!("") + } + } + impl WireFormat for MsgGloBiases { const MIN_LEN: usize = ::MIN_LEN + ::MIN_LEN @@ -5176,6 +5514,19 @@ pub mod msg_gnss_capb { } } + impl FriendlyName for MsgGnssCapb { + fn friendly_name() -> &'static str { + "" + } + } + + impl MessageDisplay for MsgGnssCapb { + #[allow(clippy::useless_format)] + fn message_display(&self) -> String { + format!("") + } + } + impl WireFormat for MsgGnssCapb { const MIN_LEN: usize = ::MIN_LEN + ::MIN_LEN; @@ -5265,6 +5616,19 @@ pub mod msg_group_delay { } } + impl FriendlyName for MsgGroupDelay { + fn friendly_name() -> &'static str { + "" + } + } + + impl MessageDisplay for MsgGroupDelay { + #[allow(clippy::useless_format)] + fn message_display(&self) -> String { + format!("") + } + } + impl WireFormat for MsgGroupDelay { const MIN_LEN: usize = ::MIN_LEN + ::MIN_LEN @@ -5371,6 +5735,19 @@ pub mod msg_group_delay_dep_a { } } + impl FriendlyName for MsgGroupDelayDepA { + fn friendly_name() -> &'static str { + "" + } + } + + impl MessageDisplay for MsgGroupDelayDepA { + #[allow(clippy::useless_format)] + fn message_display(&self) -> String { + format!("") + } + } + impl WireFormat for MsgGroupDelayDepA { const MIN_LEN: usize = ::MIN_LEN + ::MIN_LEN @@ -5477,6 +5854,19 @@ pub mod msg_group_delay_dep_b { } } + impl FriendlyName for MsgGroupDelayDepB { + fn friendly_name() -> &'static str { + "" + } + } + + impl MessageDisplay for MsgGroupDelayDepB { + #[allow(clippy::useless_format)] + fn message_display(&self) -> String { + format!("") + } + } + impl WireFormat for MsgGroupDelayDepB { const MIN_LEN: usize = ::MIN_LEN + ::MIN_LEN @@ -5588,6 +5978,19 @@ pub mod msg_iono { } } + impl FriendlyName for MsgIono { + fn friendly_name() -> &'static str { + "" + } + } + + impl MessageDisplay for MsgIono { + #[allow(clippy::useless_format)] + fn message_display(&self) -> String { + format!("") + } + } + impl WireFormat for MsgIono { const MIN_LEN: usize = ::MIN_LEN + ::MIN_LEN @@ -5714,6 +6117,19 @@ pub mod msg_obs { } } + impl FriendlyName for MsgObs { + fn friendly_name() -> &'static str { + "" + } + } + + impl MessageDisplay for MsgObs { + #[allow(clippy::useless_format)] + fn message_display(&self) -> String { + format!("") + } + } + impl WireFormat for MsgObs { const MIN_LEN: usize = ::MIN_LEN + as WireFormat>::MIN_LEN; @@ -5806,6 +6222,19 @@ pub mod msg_obs_dep_a { } } + impl FriendlyName for MsgObsDepA { + fn friendly_name() -> &'static str { + "" + } + } + + impl MessageDisplay for MsgObsDepA { + #[allow(clippy::useless_format)] + fn message_display(&self) -> String { + format!("") + } + } + impl WireFormat for MsgObsDepA { const MIN_LEN: usize = ::MIN_LEN + as WireFormat>::MIN_LEN; @@ -5901,6 +6330,19 @@ pub mod msg_obs_dep_b { } } + impl FriendlyName for MsgObsDepB { + fn friendly_name() -> &'static str { + "" + } + } + + impl MessageDisplay for MsgObsDepB { + #[allow(clippy::useless_format)] + fn message_display(&self) -> String { + format!("") + } + } + impl WireFormat for MsgObsDepB { const MIN_LEN: usize = ::MIN_LEN + as WireFormat>::MIN_LEN; @@ -5998,6 +6440,19 @@ pub mod msg_obs_dep_c { } } + impl FriendlyName for MsgObsDepC { + fn friendly_name() -> &'static str { + "" + } + } + + impl MessageDisplay for MsgObsDepC { + #[allow(clippy::useless_format)] + fn message_display(&self) -> String { + format!("") + } + } + impl WireFormat for MsgObsDepC { const MIN_LEN: usize = ::MIN_LEN + as WireFormat>::MIN_LEN; @@ -6091,6 +6546,19 @@ pub mod msg_osr { } } + impl FriendlyName for MsgOsr { + fn friendly_name() -> &'static str { + "" + } + } + + impl MessageDisplay for MsgOsr { + #[allow(clippy::useless_format)] + fn message_display(&self) -> String { + format!("") + } + } + impl WireFormat for MsgOsr { const MIN_LEN: usize = ::MIN_LEN + as WireFormat>::MIN_LEN; @@ -6168,6 +6636,19 @@ pub mod msg_sv_az_el { } } + impl FriendlyName for MsgSvAzEl { + fn friendly_name() -> &'static str { + "" + } + } + + impl MessageDisplay for MsgSvAzEl { + #[allow(clippy::useless_format)] + fn message_display(&self) -> String { + format!("") + } + } + impl WireFormat for MsgSvAzEl { const MIN_LEN: usize = as WireFormat>::MIN_LEN; fn len(&self) -> usize { @@ -6244,6 +6725,19 @@ pub mod msg_sv_configuration_gps_dep { } } + impl FriendlyName for MsgSvConfigurationGpsDep { + fn friendly_name() -> &'static str { + "" + } + } + + impl MessageDisplay for MsgSvConfigurationGpsDep { + #[allow(clippy::useless_format)] + fn message_display(&self) -> String { + format!("") + } + } + impl WireFormat for MsgSvConfigurationGpsDep { const MIN_LEN: usize = ::MIN_LEN + ::MIN_LEN; fn len(&self) -> usize { diff --git a/rust/sbp/src/messages/orientation.rs b/rust/sbp/src/messages/orientation.rs index a1c203f327..29b07d2cfd 100644 --- a/rust/sbp/src/messages/orientation.rs +++ b/rust/sbp/src/messages/orientation.rs @@ -118,6 +118,19 @@ pub mod msg_angular_rate { } } + impl FriendlyName for MsgAngularRate { + fn friendly_name() -> &'static str { + "" + } + } + + impl MessageDisplay for MsgAngularRate { + #[allow(clippy::useless_format)] + fn message_display(&self) -> String { + format!("") + } + } + impl WireFormat for MsgAngularRate { const MIN_LEN: usize = ::MIN_LEN + ::MIN_LEN @@ -274,6 +287,19 @@ pub mod msg_baseline_heading { } } + impl FriendlyName for MsgBaselineHeading { + fn friendly_name() -> &'static str { + "" + } + } + + impl MessageDisplay for MsgBaselineHeading { + #[allow(clippy::useless_format)] + fn message_display(&self) -> String { + format!("") + } + } + impl WireFormat for MsgBaselineHeading { const MIN_LEN: usize = ::MIN_LEN + ::MIN_LEN @@ -449,6 +475,19 @@ pub mod msg_orient_euler { } } + impl FriendlyName for MsgOrientEuler { + fn friendly_name() -> &'static str { + "" + } + } + + impl MessageDisplay for MsgOrientEuler { + #[allow(clippy::useless_format)] + fn message_display(&self) -> String { + format!("") + } + } + impl WireFormat for MsgOrientEuler { const MIN_LEN: usize = ::MIN_LEN + ::MIN_LEN @@ -636,6 +675,19 @@ pub mod msg_orient_quat { } } + impl FriendlyName for MsgOrientQuat { + fn friendly_name() -> &'static str { + "" + } + } + + impl MessageDisplay for MsgOrientQuat { + #[allow(clippy::useless_format)] + fn message_display(&self) -> String { + format!("") + } + } + impl WireFormat for MsgOrientQuat { const MIN_LEN: usize = ::MIN_LEN + ::MIN_LEN diff --git a/rust/sbp/src/messages/piksi.rs b/rust/sbp/src/messages/piksi.rs index 8511ff5e9c..fa6628c823 100644 --- a/rust/sbp/src/messages/piksi.rs +++ b/rust/sbp/src/messages/piksi.rs @@ -159,6 +159,19 @@ pub mod msg_almanac { } } + impl FriendlyName for MsgAlmanac { + fn friendly_name() -> &'static str { + "" + } + } + + impl MessageDisplay for MsgAlmanac { + #[allow(clippy::useless_format)] + fn message_display(&self) -> String { + format!("") + } + } + impl WireFormat for MsgAlmanac { const MIN_LEN: usize = 0; fn len(&self) -> usize { @@ -235,6 +248,19 @@ pub mod msg_cell_modem_status { } } + impl FriendlyName for MsgCellModemStatus { + fn friendly_name() -> &'static str { + "" + } + } + + impl MessageDisplay for MsgCellModemStatus { + #[allow(clippy::useless_format)] + fn message_display(&self) -> String { + format!("") + } + } + impl WireFormat for MsgCellModemStatus { const MIN_LEN: usize = ::MIN_LEN + ::MIN_LEN @@ -321,6 +347,19 @@ pub mod msg_command_output { } } + impl FriendlyName for MsgCommandOutput { + fn friendly_name() -> &'static str { + "" + } + } + + impl MessageDisplay for MsgCommandOutput { + #[allow(clippy::useless_format)] + fn message_display(&self) -> String { + format!("") + } + } + impl WireFormat for MsgCommandOutput { const MIN_LEN: usize = ::MIN_LEN + , Unterminated> as WireFormat>::MIN_LEN; @@ -402,6 +441,19 @@ pub mod msg_command_req { } } + impl FriendlyName for MsgCommandReq { + fn friendly_name() -> &'static str { + "" + } + } + + impl MessageDisplay for MsgCommandReq { + #[allow(clippy::useless_format)] + fn message_display(&self) -> String { + format!("") + } + } + impl WireFormat for MsgCommandReq { const MIN_LEN: usize = ::MIN_LEN + , NullTerminated> as WireFormat>::MIN_LEN; @@ -482,6 +534,19 @@ pub mod msg_command_resp { } } + impl FriendlyName for MsgCommandResp { + fn friendly_name() -> &'static str { + "" + } + } + + impl MessageDisplay for MsgCommandResp { + #[allow(clippy::useless_format)] + fn message_display(&self) -> String { + format!("") + } + } + impl WireFormat for MsgCommandResp { const MIN_LEN: usize = ::MIN_LEN + ::MIN_LEN; fn len(&self) -> usize { @@ -556,6 +621,19 @@ pub mod msg_cw_results { } } + impl FriendlyName for MsgCwResults { + fn friendly_name() -> &'static str { + "" + } + } + + impl MessageDisplay for MsgCwResults { + #[allow(clippy::useless_format)] + fn message_display(&self) -> String { + format!("") + } + } + impl WireFormat for MsgCwResults { const MIN_LEN: usize = 0; fn len(&self) -> usize { @@ -623,6 +701,19 @@ pub mod msg_cw_start { } } + impl FriendlyName for MsgCwStart { + fn friendly_name() -> &'static str { + "" + } + } + + impl MessageDisplay for MsgCwStart { + #[allow(clippy::useless_format)] + fn message_display(&self) -> String { + format!("") + } + } + impl WireFormat for MsgCwStart { const MIN_LEN: usize = 0; fn len(&self) -> usize { @@ -705,6 +796,19 @@ pub mod msg_device_monitor { } } + impl FriendlyName for MsgDeviceMonitor { + fn friendly_name() -> &'static str { + "" + } + } + + impl MessageDisplay for MsgDeviceMonitor { + #[allow(clippy::useless_format)] + fn message_display(&self) -> String { + format!("") + } + } + impl WireFormat for MsgDeviceMonitor { const MIN_LEN: usize = ::MIN_LEN + ::MIN_LEN @@ -803,6 +907,19 @@ pub mod msg_front_end_gain { } } + impl FriendlyName for MsgFrontEndGain { + fn friendly_name() -> &'static str { + "" + } + } + + impl MessageDisplay for MsgFrontEndGain { + #[allow(clippy::useless_format)] + fn message_display(&self) -> String { + format!("") + } + } + impl WireFormat for MsgFrontEndGain { const MIN_LEN: usize = <[i8; 8] as WireFormat>::MIN_LEN + <[i8; 8] as WireFormat>::MIN_LEN; fn len(&self) -> usize { @@ -880,6 +997,19 @@ pub mod msg_iar_state { } } + impl FriendlyName for MsgIarState { + fn friendly_name() -> &'static str { + "" + } + } + + impl MessageDisplay for MsgIarState { + #[allow(clippy::useless_format)] + fn message_display(&self) -> String { + format!("") + } + } + impl WireFormat for MsgIarState { const MIN_LEN: usize = ::MIN_LEN; fn len(&self) -> usize { @@ -950,6 +1080,19 @@ pub mod msg_init_base_dep { } } + impl FriendlyName for MsgInitBaseDep { + fn friendly_name() -> &'static str { + "" + } + } + + impl MessageDisplay for MsgInitBaseDep { + #[allow(clippy::useless_format)] + fn message_display(&self) -> String { + format!("") + } + } + impl WireFormat for MsgInitBaseDep { const MIN_LEN: usize = 0; fn len(&self) -> usize { @@ -1052,6 +1195,19 @@ pub mod msg_mask_satellite { } } + impl FriendlyName for MsgMaskSatellite { + fn friendly_name() -> &'static str { + "" + } + } + + impl MessageDisplay for MsgMaskSatellite { + #[allow(clippy::useless_format)] + fn message_display(&self) -> String { + format!("") + } + } + impl WireFormat for MsgMaskSatellite { const MIN_LEN: usize = ::MIN_LEN + ::MIN_LEN; fn len(&self) -> usize { @@ -1224,6 +1380,19 @@ pub mod msg_mask_satellite_dep { } } + impl FriendlyName for MsgMaskSatelliteDep { + fn friendly_name() -> &'static str { + "" + } + } + + impl MessageDisplay for MsgMaskSatelliteDep { + #[allow(clippy::useless_format)] + fn message_display(&self) -> String { + format!("") + } + } + impl WireFormat for MsgMaskSatelliteDep { const MIN_LEN: usize = ::MIN_LEN + ::MIN_LEN; fn len(&self) -> usize { @@ -1363,6 +1532,19 @@ pub mod msg_network_bandwidth_usage { } } + impl FriendlyName for MsgNetworkBandwidthUsage { + fn friendly_name() -> &'static str { + "" + } + } + + impl MessageDisplay for MsgNetworkBandwidthUsage { + #[allow(clippy::useless_format)] + fn message_display(&self) -> String { + format!("") + } + } + impl WireFormat for MsgNetworkBandwidthUsage { const MIN_LEN: usize = as WireFormat>::MIN_LEN; fn len(&self) -> usize { @@ -1434,6 +1616,19 @@ pub mod msg_network_state_req { } } + impl FriendlyName for MsgNetworkStateReq { + fn friendly_name() -> &'static str { + "" + } + } + + impl MessageDisplay for MsgNetworkStateReq { + #[allow(clippy::useless_format)] + fn message_display(&self) -> String { + format!("") + } + } + impl WireFormat for MsgNetworkStateReq { const MIN_LEN: usize = 0; fn len(&self) -> usize { @@ -1744,6 +1939,19 @@ pub mod msg_network_state_resp { } } + impl FriendlyName for MsgNetworkStateResp { + fn friendly_name() -> &'static str { + "" + } + } + + impl MessageDisplay for MsgNetworkStateResp { + #[allow(clippy::useless_format)] + fn message_display(&self) -> String { + format!("") + } + } + impl WireFormat for MsgNetworkStateResp { const MIN_LEN: usize = <[u8; 4] as WireFormat>::MIN_LEN + ::MIN_LEN @@ -1861,6 +2069,19 @@ pub mod msg_reset { } } + impl FriendlyName for MsgReset { + fn friendly_name() -> &'static str { + "" + } + } + + impl MessageDisplay for MsgReset { + #[allow(clippy::useless_format)] + fn message_display(&self) -> String { + format!("") + } + } + impl WireFormat for MsgReset { const MIN_LEN: usize = ::MIN_LEN; fn len(&self) -> usize { @@ -1963,6 +2184,19 @@ pub mod msg_reset_dep { } } + impl FriendlyName for MsgResetDep { + fn friendly_name() -> &'static str { + "" + } + } + + impl MessageDisplay for MsgResetDep { + #[allow(clippy::useless_format)] + fn message_display(&self) -> String { + format!("") + } + } + impl WireFormat for MsgResetDep { const MIN_LEN: usize = 0; fn len(&self) -> usize { @@ -2051,6 +2285,19 @@ pub mod msg_reset_filters { } } + impl FriendlyName for MsgResetFilters { + fn friendly_name() -> &'static str { + "" + } + } + + impl MessageDisplay for MsgResetFilters { + #[allow(clippy::useless_format)] + fn message_display(&self) -> String { + format!("") + } + } + impl WireFormat for MsgResetFilters { const MIN_LEN: usize = ::MIN_LEN; fn len(&self) -> usize { @@ -2157,6 +2404,19 @@ pub mod msg_set_time { } } + impl FriendlyName for MsgSetTime { + fn friendly_name() -> &'static str { + "" + } + } + + impl MessageDisplay for MsgSetTime { + #[allow(clippy::useless_format)] + fn message_display(&self) -> String { + format!("") + } + } + impl WireFormat for MsgSetTime { const MIN_LEN: usize = 0; fn len(&self) -> usize { @@ -2243,6 +2503,19 @@ pub mod msg_specan { } } + impl FriendlyName for MsgSpecan { + fn friendly_name() -> &'static str { + "" + } + } + + impl MessageDisplay for MsgSpecan { + #[allow(clippy::useless_format)] + fn message_display(&self) -> String { + format!("") + } + } + impl WireFormat for MsgSpecan { const MIN_LEN: usize = ::MIN_LEN + ::MIN_LEN @@ -2358,6 +2631,19 @@ pub mod msg_specan_dep { } } + impl FriendlyName for MsgSpecanDep { + fn friendly_name() -> &'static str { + "" + } + } + + impl MessageDisplay for MsgSpecanDep { + #[allow(clippy::useless_format)] + fn message_display(&self) -> String { + format!("") + } + } + impl WireFormat for MsgSpecanDep { const MIN_LEN: usize = ::MIN_LEN + ::MIN_LEN @@ -2464,6 +2750,19 @@ pub mod msg_thread_state { } } + impl FriendlyName for MsgThreadState { + fn friendly_name() -> &'static str { + "" + } + } + + impl MessageDisplay for MsgThreadState { + #[allow(clippy::useless_format)] + fn message_display(&self) -> String { + format!("") + } + } + impl WireFormat for MsgThreadState { const MIN_LEN: usize = as WireFormat>::MIN_LEN + ::MIN_LEN @@ -2564,6 +2863,19 @@ pub mod msg_uart_state { } } + impl FriendlyName for MsgUartState { + fn friendly_name() -> &'static str { + "" + } + } + + impl MessageDisplay for MsgUartState { + #[allow(clippy::useless_format)] + fn message_display(&self) -> String { + format!("") + } + } + impl WireFormat for MsgUartState { const MIN_LEN: usize = ::MIN_LEN + ::MIN_LEN @@ -2662,6 +2974,19 @@ pub mod msg_uart_state_depa { } } + impl FriendlyName for MsgUartStateDepa { + fn friendly_name() -> &'static str { + "" + } + } + + impl MessageDisplay for MsgUartStateDepa { + #[allow(clippy::useless_format)] + fn message_display(&self) -> String { + format!("") + } + } + impl WireFormat for MsgUartStateDepa { const MIN_LEN: usize = ::MIN_LEN + ::MIN_LEN diff --git a/rust/sbp/src/messages/sbas.rs b/rust/sbp/src/messages/sbas.rs index 7f8433cfe7..858ae56663 100644 --- a/rust/sbp/src/messages/sbas.rs +++ b/rust/sbp/src/messages/sbas.rs @@ -90,6 +90,19 @@ pub mod msg_sbas_raw { } } + impl FriendlyName for MsgSbasRaw { + fn friendly_name() -> &'static str { + "" + } + } + + impl MessageDisplay for MsgSbasRaw { + #[allow(clippy::useless_format)] + fn message_display(&self) -> String { + format!("") + } + } + impl WireFormat for MsgSbasRaw { const MIN_LEN: usize = ::MIN_LEN + ::MIN_LEN diff --git a/rust/sbp/src/messages/settings.rs b/rust/sbp/src/messages/settings.rs index 4f316bf587..9c6a8aadf8 100644 --- a/rust/sbp/src/messages/settings.rs +++ b/rust/sbp/src/messages/settings.rs @@ -101,6 +101,19 @@ pub mod msg_settings_read_by_index_done { } } + impl FriendlyName for MsgSettingsReadByIndexDone { + fn friendly_name() -> &'static str { + "" + } + } + + impl MessageDisplay for MsgSettingsReadByIndexDone { + #[allow(clippy::useless_format)] + fn message_display(&self) -> String { + format!("") + } + } + impl WireFormat for MsgSettingsReadByIndexDone { const MIN_LEN: usize = 0; fn len(&self) -> usize { @@ -170,6 +183,19 @@ pub mod msg_settings_read_by_index_req { } } + impl FriendlyName for MsgSettingsReadByIndexReq { + fn friendly_name() -> &'static str { + "" + } + } + + impl MessageDisplay for MsgSettingsReadByIndexReq { + #[allow(clippy::useless_format)] + fn message_display(&self) -> String { + format!("") + } + } + impl WireFormat for MsgSettingsReadByIndexReq { const MIN_LEN: usize = ::MIN_LEN; fn len(&self) -> usize { @@ -256,6 +282,19 @@ pub mod msg_settings_read_by_index_resp { } } + impl FriendlyName for MsgSettingsReadByIndexResp { + fn friendly_name() -> &'static str { + "" + } + } + + impl MessageDisplay for MsgSettingsReadByIndexResp { + #[allow(clippy::useless_format)] + fn message_display(&self) -> String { + format!("") + } + } + impl WireFormat for MsgSettingsReadByIndexResp { const MIN_LEN: usize = ::MIN_LEN + , Multipart> as WireFormat>::MIN_LEN; @@ -339,6 +378,19 @@ pub mod msg_settings_read_req { } } + impl FriendlyName for MsgSettingsReadReq { + fn friendly_name() -> &'static str { + "" + } + } + + impl MessageDisplay for MsgSettingsReadReq { + #[allow(clippy::useless_format)] + fn message_display(&self) -> String { + format!("") + } + } + impl WireFormat for MsgSettingsReadReq { const MIN_LEN: usize = , Multipart> as WireFormat>::MIN_LEN; fn len(&self) -> usize { @@ -417,6 +469,19 @@ pub mod msg_settings_read_resp { } } + impl FriendlyName for MsgSettingsReadResp { + fn friendly_name() -> &'static str { + "" + } + } + + impl MessageDisplay for MsgSettingsReadResp { + #[allow(clippy::useless_format)] + fn message_display(&self) -> String { + format!("") + } + } + impl WireFormat for MsgSettingsReadResp { const MIN_LEN: usize = , Multipart> as WireFormat>::MIN_LEN; fn len(&self) -> usize { @@ -492,6 +557,19 @@ pub mod msg_settings_register { } } + impl FriendlyName for MsgSettingsRegister { + fn friendly_name() -> &'static str { + "" + } + } + + impl MessageDisplay for MsgSettingsRegister { + #[allow(clippy::useless_format)] + fn message_display(&self) -> String { + format!("") + } + } + impl WireFormat for MsgSettingsRegister { const MIN_LEN: usize = , Multipart> as WireFormat>::MIN_LEN; fn len(&self) -> usize { @@ -588,6 +666,19 @@ pub mod msg_settings_register_resp { } } + impl FriendlyName for MsgSettingsRegisterResp { + fn friendly_name() -> &'static str { + "" + } + } + + impl MessageDisplay for MsgSettingsRegisterResp { + #[allow(clippy::useless_format)] + fn message_display(&self) -> String { + format!("") + } + } + impl WireFormat for MsgSettingsRegisterResp { const MIN_LEN: usize = ::MIN_LEN + , Multipart> as WireFormat>::MIN_LEN; @@ -713,6 +804,19 @@ pub mod msg_settings_save { } } + impl FriendlyName for MsgSettingsSave { + fn friendly_name() -> &'static str { + "" + } + } + + impl MessageDisplay for MsgSettingsSave { + #[allow(clippy::useless_format)] + fn message_display(&self) -> String { + format!("") + } + } + impl WireFormat for MsgSettingsSave { const MIN_LEN: usize = 0; fn len(&self) -> usize { @@ -787,6 +891,19 @@ pub mod msg_settings_write { } } + impl FriendlyName for MsgSettingsWrite { + fn friendly_name() -> &'static str { + "" + } + } + + impl MessageDisplay for MsgSettingsWrite { + #[allow(clippy::useless_format)] + fn message_display(&self) -> String { + format!("") + } + } + impl WireFormat for MsgSettingsWrite { const MIN_LEN: usize = , Multipart> as WireFormat>::MIN_LEN; fn len(&self) -> usize { @@ -885,6 +1002,19 @@ pub mod msg_settings_write_resp { } } + impl FriendlyName for MsgSettingsWriteResp { + fn friendly_name() -> &'static str { + "" + } + } + + impl MessageDisplay for MsgSettingsWriteResp { + #[allow(clippy::useless_format)] + fn message_display(&self) -> String { + format!("") + } + } + impl WireFormat for MsgSettingsWriteResp { const MIN_LEN: usize = ::MIN_LEN + , Multipart> as WireFormat>::MIN_LEN; diff --git a/rust/sbp/src/messages/signing.rs b/rust/sbp/src/messages/signing.rs index 79c4a0581c..d73d9d5b66 100644 --- a/rust/sbp/src/messages/signing.rs +++ b/rust/sbp/src/messages/signing.rs @@ -77,6 +77,19 @@ pub mod msg_ed25519_certificate { } } + impl FriendlyName for MsgEd25519Certificate { + fn friendly_name() -> &'static str { + "" + } + } + + impl MessageDisplay for MsgEd25519Certificate { + #[allow(clippy::useless_format)] + fn message_display(&self) -> String { + format!("") + } + } + impl WireFormat for MsgEd25519Certificate { const MIN_LEN: usize = ::MIN_LEN + <[u8; 20] as WireFormat>::MIN_LEN @@ -173,6 +186,19 @@ pub mod msg_ed25519_signature { } } + impl FriendlyName for MsgEd25519Signature { + fn friendly_name() -> &'static str { + "" + } + } + + impl MessageDisplay for MsgEd25519Signature { + #[allow(clippy::useless_format)] + fn message_display(&self) -> String { + format!("") + } + } + impl WireFormat for MsgEd25519Signature { const MIN_LEN: usize = ::MIN_LEN + ::MIN_LEN @@ -264,6 +290,19 @@ pub mod msg_ed25519_signature_dep { } } + impl FriendlyName for MsgEd25519SignatureDep { + fn friendly_name() -> &'static str { + "" + } + } + + impl MessageDisplay for MsgEd25519SignatureDep { + #[allow(clippy::useless_format)] + fn message_display(&self) -> String { + format!("") + } + } + impl WireFormat for MsgEd25519SignatureDep { const MIN_LEN: usize = <[u8; 64] as WireFormat>::MIN_LEN + <[u8; 20] as WireFormat>::MIN_LEN diff --git a/rust/sbp/src/messages/solution_meta.rs b/rust/sbp/src/messages/solution_meta.rs index fdb90105dc..c8ed223577 100644 --- a/rust/sbp/src/messages/solution_meta.rs +++ b/rust/sbp/src/messages/solution_meta.rs @@ -442,6 +442,19 @@ pub mod msg_soln_meta { } } + impl FriendlyName for MsgSolnMeta { + fn friendly_name() -> &'static str { + "" + } + } + + impl MessageDisplay for MsgSolnMeta { + #[allow(clippy::useless_format)] + fn message_display(&self) -> String { + format!("") + } + } + impl WireFormat for MsgSolnMeta { const MIN_LEN: usize = ::MIN_LEN + ::MIN_LEN @@ -624,6 +637,19 @@ pub mod msg_soln_meta_dep_a { } } + impl FriendlyName for MsgSolnMetaDepA { + fn friendly_name() -> &'static str { + "" + } + } + + impl MessageDisplay for MsgSolnMetaDepA { + #[allow(clippy::useless_format)] + fn message_display(&self) -> String { + format!("") + } + } + impl WireFormat for MsgSolnMetaDepA { const MIN_LEN: usize = ::MIN_LEN + ::MIN_LEN diff --git a/rust/sbp/src/messages/ssr.rs b/rust/sbp/src/messages/ssr.rs index a04d42fbc4..cd937bab9b 100644 --- a/rust/sbp/src/messages/ssr.rs +++ b/rust/sbp/src/messages/ssr.rs @@ -530,6 +530,19 @@ pub mod msg_ssr_code_biases { } } + impl FriendlyName for MsgSsrCodeBiases { + fn friendly_name() -> &'static str { + "" + } + } + + impl MessageDisplay for MsgSsrCodeBiases { + #[allow(clippy::useless_format)] + fn message_display(&self) -> String { + format!("") + } + } + impl WireFormat for MsgSsrCodeBiases { const MIN_LEN: usize = ::MIN_LEN + ::MIN_LEN @@ -627,6 +640,19 @@ pub mod msg_ssr_code_phase_biases_bounds { } } + impl FriendlyName for MsgSsrCodePhaseBiasesBounds { + fn friendly_name() -> &'static str { + "" + } + } + + impl MessageDisplay for MsgSsrCodePhaseBiasesBounds { + #[allow(clippy::useless_format)] + fn message_display(&self) -> String { + format!("") + } + } + impl WireFormat for MsgSsrCodePhaseBiasesBounds { const MIN_LEN: usize = ::MIN_LEN + ::MIN_LEN @@ -727,6 +753,19 @@ pub mod msg_ssr_gridded_correction { } } + impl FriendlyName for MsgSsrGriddedCorrection { + fn friendly_name() -> &'static str { + "" + } + } + + impl MessageDisplay for MsgSsrGriddedCorrection { + #[allow(clippy::useless_format)] + fn message_display(&self) -> String { + format!("") + } + } + impl WireFormat for MsgSsrGriddedCorrection { const MIN_LEN: usize = ::MIN_LEN + ::MIN_LEN @@ -850,6 +889,19 @@ pub mod msg_ssr_gridded_correction_bounds { } } + impl FriendlyName for MsgSsrGriddedCorrectionBounds { + fn friendly_name() -> &'static str { + "" + } + } + + impl MessageDisplay for MsgSsrGriddedCorrectionBounds { + #[allow(clippy::useless_format)] + fn message_display(&self) -> String { + format!("") + } + } + impl WireFormat for MsgSsrGriddedCorrectionBounds { const MIN_LEN: usize = ::MIN_LEN + ::MIN_LEN @@ -976,6 +1028,19 @@ pub mod msg_ssr_gridded_correction_dep_a { } } + impl FriendlyName for MsgSsrGriddedCorrectionDepA { + fn friendly_name() -> &'static str { + "" + } + } + + impl MessageDisplay for MsgSsrGriddedCorrectionDepA { + #[allow(clippy::useless_format)] + fn message_display(&self) -> String { + format!("") + } + } + impl WireFormat for MsgSsrGriddedCorrectionDepA { const MIN_LEN: usize = ::MIN_LEN + ::MIN_LEN @@ -1066,6 +1131,19 @@ pub mod msg_ssr_gridded_correction_no_std_dep_a { } } + impl FriendlyName for MsgSsrGriddedCorrectionNoStdDepA { + fn friendly_name() -> &'static str { + "" + } + } + + impl MessageDisplay for MsgSsrGriddedCorrectionNoStdDepA { + #[allow(clippy::useless_format)] + fn message_display(&self) -> String { + format!("") + } + } + impl WireFormat for MsgSsrGriddedCorrectionNoStdDepA { const MIN_LEN: usize = ::MIN_LEN + ::MIN_LEN @@ -1153,6 +1231,19 @@ pub mod msg_ssr_grid_definition_dep_a { } } + impl FriendlyName for MsgSsrGridDefinitionDepA { + fn friendly_name() -> &'static str { + "" + } + } + + impl MessageDisplay for MsgSsrGridDefinitionDepA { + #[allow(clippy::useless_format)] + fn message_display(&self) -> String { + format!("") + } + } + impl WireFormat for MsgSsrGridDefinitionDepA { const MIN_LEN: usize = ::MIN_LEN + as WireFormat>::MIN_LEN; @@ -1272,6 +1363,19 @@ pub mod msg_ssr_orbit_clock { } } + impl FriendlyName for MsgSsrOrbitClock { + fn friendly_name() -> &'static str { + "" + } + } + + impl MessageDisplay for MsgSsrOrbitClock { + #[allow(clippy::useless_format)] + fn message_display(&self) -> String { + format!("") + } + } + impl WireFormat for MsgSsrOrbitClock { const MIN_LEN: usize = ::MIN_LEN + ::MIN_LEN @@ -1413,6 +1517,19 @@ pub mod msg_ssr_orbit_clock_bounds { } } + impl FriendlyName for MsgSsrOrbitClockBounds { + fn friendly_name() -> &'static str { + "" + } + } + + impl MessageDisplay for MsgSsrOrbitClockBounds { + #[allow(clippy::useless_format)] + fn message_display(&self) -> String { + format!("") + } + } + impl WireFormat for MsgSsrOrbitClockBounds { const MIN_LEN: usize = ::MIN_LEN + ::MIN_LEN @@ -1512,6 +1629,19 @@ pub mod msg_ssr_orbit_clock_bounds_degradation { } } + impl FriendlyName for MsgSsrOrbitClockBoundsDegradation { + fn friendly_name() -> &'static str { + "" + } + } + + impl MessageDisplay for MsgSsrOrbitClockBoundsDegradation { + #[allow(clippy::useless_format)] + fn message_display(&self) -> String { + format!("") + } + } + impl WireFormat for MsgSsrOrbitClockBoundsDegradation { const MIN_LEN: usize = ::MIN_LEN + ::MIN_LEN @@ -1638,6 +1768,19 @@ pub mod msg_ssr_orbit_clock_dep_a { } } + impl FriendlyName for MsgSsrOrbitClockDepA { + fn friendly_name() -> &'static str { + "" + } + } + + impl MessageDisplay for MsgSsrOrbitClockDepA { + #[allow(clippy::useless_format)] + fn message_display(&self) -> String { + format!("") + } + } + impl WireFormat for MsgSsrOrbitClockDepA { const MIN_LEN: usize = ::MIN_LEN + ::MIN_LEN @@ -1793,6 +1936,19 @@ pub mod msg_ssr_phase_biases { } } + impl FriendlyName for MsgSsrPhaseBiases { + fn friendly_name() -> &'static str { + "" + } + } + + impl MessageDisplay for MsgSsrPhaseBiases { + #[allow(clippy::useless_format)] + fn message_display(&self) -> String { + format!("") + } + } + impl WireFormat for MsgSsrPhaseBiases { const MIN_LEN: usize = ::MIN_LEN + ::MIN_LEN @@ -1894,6 +2050,19 @@ pub mod msg_ssr_satellite_apc { } } + impl FriendlyName for MsgSsrSatelliteApc { + fn friendly_name() -> &'static str { + "" + } + } + + impl MessageDisplay for MsgSsrSatelliteApc { + #[allow(clippy::useless_format)] + fn message_display(&self) -> String { + format!("") + } + } + impl WireFormat for MsgSsrSatelliteApc { const MIN_LEN: usize = as WireFormat>::MIN_LEN; fn len(&self) -> usize { @@ -1978,6 +2147,19 @@ pub mod msg_ssr_stec_correction { } } + impl FriendlyName for MsgSsrStecCorrection { + fn friendly_name() -> &'static str { + "" + } + } + + impl MessageDisplay for MsgSsrStecCorrection { + #[allow(clippy::useless_format)] + fn message_display(&self) -> String { + format!("") + } + } + impl WireFormat for MsgSsrStecCorrection { const MIN_LEN: usize = ::MIN_LEN + ::MIN_LEN @@ -2079,6 +2261,19 @@ pub mod msg_ssr_stec_correction_dep { } } + impl FriendlyName for MsgSsrStecCorrectionDep { + fn friendly_name() -> &'static str { + "" + } + } + + impl MessageDisplay for MsgSsrStecCorrectionDep { + #[allow(clippy::useless_format)] + fn message_display(&self) -> String { + format!("") + } + } + impl WireFormat for MsgSsrStecCorrectionDep { const MIN_LEN: usize = ::MIN_LEN + as WireFormat>::MIN_LEN; @@ -2154,6 +2349,19 @@ pub mod msg_ssr_stec_correction_dep_a { } } + impl FriendlyName for MsgSsrStecCorrectionDepA { + fn friendly_name() -> &'static str { + "" + } + } + + impl MessageDisplay for MsgSsrStecCorrectionDepA { + #[allow(clippy::useless_format)] + fn message_display(&self) -> String { + format!("") + } + } + impl WireFormat for MsgSsrStecCorrectionDepA { const MIN_LEN: usize = ::MIN_LEN + as WireFormat>::MIN_LEN; @@ -2301,6 +2509,19 @@ pub mod msg_ssr_tile_definition { } } + impl FriendlyName for MsgSsrTileDefinition { + fn friendly_name() -> &'static str { + "" + } + } + + impl MessageDisplay for MsgSsrTileDefinition { + #[allow(clippy::useless_format)] + fn message_display(&self) -> String { + format!("") + } + } + impl WireFormat for MsgSsrTileDefinition { const MIN_LEN: usize = ::MIN_LEN + ::MIN_LEN @@ -2478,6 +2699,19 @@ pub mod msg_ssr_tile_definition_dep { } } + impl FriendlyName for MsgSsrTileDefinitionDep { + fn friendly_name() -> &'static str { + "" + } + } + + impl MessageDisplay for MsgSsrTileDefinitionDep { + #[allow(clippy::useless_format)] + fn message_display(&self) -> String { + format!("") + } + } + impl WireFormat for MsgSsrTileDefinitionDep { const MIN_LEN: usize = ::MIN_LEN + ::MIN_LEN diff --git a/rust/sbp/src/messages/system.rs b/rust/sbp/src/messages/system.rs index 222938ebc0..270d4450f8 100644 --- a/rust/sbp/src/messages/system.rs +++ b/rust/sbp/src/messages/system.rs @@ -90,6 +90,19 @@ pub mod msg_csac_telemetry { } } + impl FriendlyName for MsgCsacTelemetry { + fn friendly_name() -> &'static str { + "" + } + } + + impl MessageDisplay for MsgCsacTelemetry { + #[allow(clippy::useless_format)] + fn message_display(&self) -> String { + format!("") + } + } + impl WireFormat for MsgCsacTelemetry { const MIN_LEN: usize = ::MIN_LEN + , Unterminated> as WireFormat>::MIN_LEN; @@ -171,6 +184,19 @@ pub mod msg_csac_telemetry_labels { } } + impl FriendlyName for MsgCsacTelemetryLabels { + fn friendly_name() -> &'static str { + "" + } + } + + impl MessageDisplay for MsgCsacTelemetryLabels { + #[allow(clippy::useless_format)] + fn message_display(&self) -> String { + format!("") + } + } + impl WireFormat for MsgCsacTelemetryLabels { const MIN_LEN: usize = ::MIN_LEN + , Unterminated> as WireFormat>::MIN_LEN; @@ -273,6 +299,19 @@ pub mod msg_dgnss_status { } } + impl FriendlyName for MsgDgnssStatus { + fn friendly_name() -> &'static str { + "" + } + } + + impl MessageDisplay for MsgDgnssStatus { + #[allow(clippy::useless_format)] + fn message_display(&self) -> String { + format!("") + } + } + impl WireFormat for MsgDgnssStatus { const MIN_LEN: usize = ::MIN_LEN + ::MIN_LEN @@ -403,6 +442,19 @@ pub mod msg_gnss_time_offset { } } + impl FriendlyName for MsgGnssTimeOffset { + fn friendly_name() -> &'static str { + "" + } + } + + impl MessageDisplay for MsgGnssTimeOffset { + #[allow(clippy::useless_format)] + fn message_display(&self) -> String { + format!("") + } + } + impl WireFormat for MsgGnssTimeOffset { const MIN_LEN: usize = ::MIN_LEN + ::MIN_LEN @@ -515,6 +567,19 @@ pub mod msg_group_meta { } } + impl FriendlyName for MsgGroupMeta { + fn friendly_name() -> &'static str { + "" + } + } + + impl MessageDisplay for MsgGroupMeta { + #[allow(clippy::useless_format)] + fn message_display(&self) -> String { + format!("") + } + } + impl WireFormat for MsgGroupMeta { const MIN_LEN: usize = ::MIN_LEN + ::MIN_LEN @@ -757,6 +822,19 @@ pub mod msg_heartbeat { } } + impl FriendlyName for MsgHeartbeat { + fn friendly_name() -> &'static str { + "" + } + } + + impl MessageDisplay for MsgHeartbeat { + #[allow(clippy::useless_format)] + fn message_display(&self) -> String { + format!("") + } + } + impl WireFormat for MsgHeartbeat { const MIN_LEN: usize = ::MIN_LEN; fn len(&self) -> usize { @@ -1086,6 +1164,19 @@ pub mod msg_ins_status { } } + impl FriendlyName for MsgInsStatus { + fn friendly_name() -> &'static str { + "" + } + } + + impl MessageDisplay for MsgInsStatus { + #[allow(clippy::useless_format)] + fn message_display(&self) -> String { + format!("") + } + } + impl WireFormat for MsgInsStatus { const MIN_LEN: usize = ::MIN_LEN; fn len(&self) -> usize { @@ -1696,6 +1787,19 @@ pub mod msg_ins_updates { } } + impl FriendlyName for MsgInsUpdates { + fn friendly_name() -> &'static str { + "" + } + } + + impl MessageDisplay for MsgInsUpdates { + #[allow(clippy::useless_format)] + fn message_display(&self) -> String { + format!("") + } + } + impl WireFormat for MsgInsUpdates { const MIN_LEN: usize = ::MIN_LEN + ::MIN_LEN @@ -1832,6 +1936,19 @@ pub mod msg_pps_time { } } + impl FriendlyName for MsgPpsTime { + fn friendly_name() -> &'static str { + "" + } + } + + impl MessageDisplay for MsgPpsTime { + #[allow(clippy::useless_format)] + fn message_display(&self) -> String { + format!("") + } + } + impl WireFormat for MsgPpsTime { const MIN_LEN: usize = ::MIN_LEN + ::MIN_LEN; fn len(&self) -> usize { @@ -1986,6 +2103,19 @@ pub mod msg_sensor_aid_event { } } + impl FriendlyName for MsgSensorAidEvent { + fn friendly_name() -> &'static str { + "" + } + } + + impl MessageDisplay for MsgSensorAidEvent { + #[allow(clippy::useless_format)] + fn message_display(&self) -> String { + format!("") + } + } + impl WireFormat for MsgSensorAidEvent { const MIN_LEN: usize = ::MIN_LEN + ::MIN_LEN @@ -2183,6 +2313,19 @@ pub mod msg_startup { } } + impl FriendlyName for MsgStartup { + fn friendly_name() -> &'static str { + "" + } + } + + impl MessageDisplay for MsgStartup { + #[allow(clippy::useless_format)] + fn message_display(&self) -> String { + format!("") + } + } + impl WireFormat for MsgStartup { const MIN_LEN: usize = ::MIN_LEN + ::MIN_LEN @@ -2404,6 +2547,19 @@ pub mod msg_status_journal { } } + impl FriendlyName for MsgStatusJournal { + fn friendly_name() -> &'static str { + "" + } + } + + impl MessageDisplay for MsgStatusJournal { + #[allow(clippy::useless_format)] + fn message_display(&self) -> String { + format!("") + } + } + impl WireFormat for MsgStatusJournal { const MIN_LEN: usize = ::MIN_LEN + ::MIN_LEN @@ -2597,6 +2753,19 @@ pub mod msg_status_report { } } + impl FriendlyName for MsgStatusReport { + fn friendly_name() -> &'static str { + "" + } + } + + impl MessageDisplay for MsgStatusReport { + #[allow(clippy::useless_format)] + fn message_display(&self) -> String { + format!("") + } + } + impl WireFormat for MsgStatusReport { const MIN_LEN: usize = ::MIN_LEN + ::MIN_LEN diff --git a/rust/sbp/src/messages/tracking.rs b/rust/sbp/src/messages/tracking.rs index edcdcc343a..655ff48fad 100644 --- a/rust/sbp/src/messages/tracking.rs +++ b/rust/sbp/src/messages/tracking.rs @@ -87,6 +87,19 @@ pub mod msg_measurement_state { } } + impl FriendlyName for MsgMeasurementState { + fn friendly_name() -> &'static str { + "" + } + } + + impl MessageDisplay for MsgMeasurementState { + #[allow(clippy::useless_format)] + fn message_display(&self) -> String { + format!("") + } + } + impl WireFormat for MsgMeasurementState { const MIN_LEN: usize = as WireFormat>::MIN_LEN; fn len(&self) -> usize { @@ -167,6 +180,19 @@ pub mod msg_tracking_iq { } } + impl FriendlyName for MsgTrackingIq { + fn friendly_name() -> &'static str { + "" + } + } + + impl MessageDisplay for MsgTrackingIq { + #[allow(clippy::useless_format)] + fn message_display(&self) -> String { + format!("") + } + } + impl WireFormat for MsgTrackingIq { const MIN_LEN: usize = ::MIN_LEN + ::MIN_LEN @@ -254,6 +280,19 @@ pub mod msg_tracking_iq_dep_a { } } + impl FriendlyName for MsgTrackingIqDepA { + fn friendly_name() -> &'static str { + "" + } + } + + impl MessageDisplay for MsgTrackingIqDepA { + #[allow(clippy::useless_format)] + fn message_display(&self) -> String { + format!("") + } + } + impl WireFormat for MsgTrackingIqDepA { const MIN_LEN: usize = ::MIN_LEN + ::MIN_LEN @@ -342,6 +381,19 @@ pub mod msg_tracking_iq_dep_b { } } + impl FriendlyName for MsgTrackingIqDepB { + fn friendly_name() -> &'static str { + "" + } + } + + impl MessageDisplay for MsgTrackingIqDepB { + #[allow(clippy::useless_format)] + fn message_display(&self) -> String { + format!("") + } + } + impl WireFormat for MsgTrackingIqDepB { const MIN_LEN: usize = ::MIN_LEN + ::MIN_LEN @@ -425,6 +477,19 @@ pub mod msg_tracking_state { } } + impl FriendlyName for MsgTrackingState { + fn friendly_name() -> &'static str { + "" + } + } + + impl MessageDisplay for MsgTrackingState { + #[allow(clippy::useless_format)] + fn message_display(&self) -> String { + format!("") + } + } + impl WireFormat for MsgTrackingState { const MIN_LEN: usize = as WireFormat>::MIN_LEN; fn len(&self) -> usize { @@ -498,6 +563,19 @@ pub mod msg_tracking_state_dep_a { } } + impl FriendlyName for MsgTrackingStateDepA { + fn friendly_name() -> &'static str { + "" + } + } + + impl MessageDisplay for MsgTrackingStateDepA { + #[allow(clippy::useless_format)] + fn message_display(&self) -> String { + format!("") + } + } + impl WireFormat for MsgTrackingStateDepA { const MIN_LEN: usize = as WireFormat>::MIN_LEN; fn len(&self) -> usize { @@ -571,6 +649,19 @@ pub mod msg_tracking_state_dep_b { } } + impl FriendlyName for MsgTrackingStateDepB { + fn friendly_name() -> &'static str { + "" + } + } + + impl MessageDisplay for MsgTrackingStateDepB { + #[allow(clippy::useless_format)] + fn message_display(&self) -> String { + format!("") + } + } + impl WireFormat for MsgTrackingStateDepB { const MIN_LEN: usize = as WireFormat>::MIN_LEN; fn len(&self) -> usize { @@ -990,6 +1081,19 @@ pub mod msg_tracking_state_detailed_dep { } } + impl FriendlyName for MsgTrackingStateDetailedDep { + fn friendly_name() -> &'static str { + "" + } + } + + impl MessageDisplay for MsgTrackingStateDetailedDep { + #[allow(clippy::useless_format)] + fn message_display(&self) -> String { + format!("") + } + } + impl WireFormat for MsgTrackingStateDetailedDep { const MIN_LEN: usize = ::MIN_LEN + ::MIN_LEN @@ -2008,6 +2112,19 @@ pub mod msg_tracking_state_detailed_dep_a { } } + impl FriendlyName for MsgTrackingStateDetailedDepA { + fn friendly_name() -> &'static str { + "" + } + } + + impl MessageDisplay for MsgTrackingStateDetailedDepA { + #[allow(clippy::useless_format)] + fn message_display(&self) -> String { + format!("") + } + } + impl WireFormat for MsgTrackingStateDetailedDepA { const MIN_LEN: usize = ::MIN_LEN + ::MIN_LEN diff --git a/rust/sbp/src/messages/user.rs b/rust/sbp/src/messages/user.rs index 9af15b2dae..8590c817fc 100644 --- a/rust/sbp/src/messages/user.rs +++ b/rust/sbp/src/messages/user.rs @@ -71,6 +71,19 @@ pub mod msg_user_data { } } + impl FriendlyName for MsgUserData { + fn friendly_name() -> &'static str { + "" + } + } + + impl MessageDisplay for MsgUserData { + #[allow(clippy::useless_format)] + fn message_display(&self) -> String { + format!("") + } + } + impl WireFormat for MsgUserData { const MIN_LEN: usize = as WireFormat>::MIN_LEN; fn len(&self) -> usize { diff --git a/rust/sbp/src/messages/vehicle.rs b/rust/sbp/src/messages/vehicle.rs index d2a38ced7c..36aac10904 100644 --- a/rust/sbp/src/messages/vehicle.rs +++ b/rust/sbp/src/messages/vehicle.rs @@ -140,6 +140,19 @@ pub mod msg_odometry { } } + impl FriendlyName for MsgOdometry { + fn friendly_name() -> &'static str { + "" + } + } + + impl MessageDisplay for MsgOdometry { + #[allow(clippy::useless_format)] + fn message_display(&self) -> String { + format!("") + } + } + impl WireFormat for MsgOdometry { const MIN_LEN: usize = ::MIN_LEN + ::MIN_LEN @@ -402,6 +415,19 @@ pub mod msg_wheeltick { } } + impl FriendlyName for MsgWheeltick { + fn friendly_name() -> &'static str { + "" + } + } + + impl MessageDisplay for MsgWheeltick { + #[allow(clippy::useless_format)] + fn message_display(&self) -> String { + format!("") + } + } + impl WireFormat for MsgWheeltick { const MIN_LEN: usize = ::MIN_LEN + ::MIN_LEN From 9dff32366b6f42af2bbbf723187cc28bdf24f0d3 Mon Sep 17 00:00:00 2001 From: adrian-kong Date: Mon, 28 Nov 2022 17:56:40 +1100 Subject: [PATCH 2/7] add additional definitions --- generator/sbpg/specs/yaml2.py | 5 +++++ generator/sbpg/specs/yaml_schema.py | 2 ++ generator/sbpg/syntax.py | 5 ++++- rust/sbp/src/messages/ssr.rs | 2 +- spec/yaml/swiftnav/sbp/ssr.yaml | 1 + 5 files changed, 13 insertions(+), 2 deletions(-) diff --git a/generator/sbpg/specs/yaml2.py b/generator/sbpg/specs/yaml2.py index 60e4a8e29d..690e76bc3e 100755 --- a/generator/sbpg/specs/yaml2.py +++ b/generator/sbpg/specs/yaml2.py @@ -273,6 +273,9 @@ def mk_definition(defn): assert not short_desc.endswith("."), f"{identifier}: Remove . from: `{short_desc}`" assert all(x in string.printable for x in short_desc), f"Unprintable: {short_desc}" assert len(short_desc.splitlines()) == 1, f"Multi-line short_desc: {short_desc}" + + friendly_name = contents.get("friendly_name", "") + message_display = contents.get("message_display", "") return sbp.resolve_type(sbp.Definition(identifier=identifier, sbp_id=contents.get('id', None), short_desc=short_desc, @@ -281,6 +284,8 @@ def mk_definition(defn): fields=fs, public=contents.get('public', True), embedded_type=contents.get('embedded_type', False), + friendly_name=friendly_name, + message_display=message_display )) def mk_field(field): diff --git a/generator/sbpg/specs/yaml_schema.py b/generator/sbpg/specs/yaml_schema.py index 9b6c943b07..51b55ff6da 100755 --- a/generator/sbpg/specs/yaml_schema.py +++ b/generator/sbpg/specs/yaml_schema.py @@ -49,6 +49,8 @@ Optional('fields'): bitfield}}) definition = Schema({identifier: {Optional('id'): sbp_identifier, + Optional('friendly_name'): description, + Optional('message_display'): description, Optional('short_desc'): description, Optional('desc'): description, Optional('replaced_by'): [identifier], diff --git a/generator/sbpg/syntax.py b/generator/sbpg/syntax.py index b18505cc71..539c3339b6 100755 --- a/generator/sbpg/syntax.py +++ b/generator/sbpg/syntax.py @@ -73,7 +73,8 @@ def __repr__(self): class Definition(object): def __init__(self, identifier=None, sbp_id=None, short_desc=None, desc=None, type_id=None, - fields=None, public=False, embedded_type=False): + fields=None, public=False, embedded_type=False, + friendly_name="", message_display=""): self.identifier = identifier self.sbp_id = sbp_id self.short_desc = short_desc @@ -83,6 +84,8 @@ def __init__(self, identifier=None, self.fields = fields or [] self.public = public self.static = True + self.friendly_name = friendly_name + self.message_display = message_display @property def max_type_len(self): diff --git a/rust/sbp/src/messages/ssr.rs b/rust/sbp/src/messages/ssr.rs index cd937bab9b..cbff24573a 100644 --- a/rust/sbp/src/messages/ssr.rs +++ b/rust/sbp/src/messages/ssr.rs @@ -1938,7 +1938,7 @@ pub mod msg_ssr_phase_biases { impl FriendlyName for MsgSsrPhaseBiases { fn friendly_name() -> &'static str { - "" + "SSR PHASE BIASES" } } diff --git a/spec/yaml/swiftnav/sbp/ssr.yaml b/spec/yaml/swiftnav/sbp/ssr.yaml index 8e138017cf..6c71d4c1c6 100644 --- a/spec/yaml/swiftnav/sbp/ssr.yaml +++ b/spec/yaml/swiftnav/sbp/ssr.yaml @@ -314,6 +314,7 @@ definitions: - MSG_SSR_PHASE_BIASES: id: 0x05E6 + friendly_name: SSR PHASE BIASES short_desc: Precise phase biases correction desc: > The precise phase biases message contains the biases From c5bb3413be0216656454b664bd38a7358c733938 Mon Sep 17 00:00:00 2001 From: adrian-kong Date: Mon, 28 Nov 2022 18:52:40 +1100 Subject: [PATCH 3/7] enriched display, generated friendly name --- .../resources/rust/sbp_messages_template.rs | 5 +- generator/sbpg/targets/rust.py | 32 ++- rust/sbp/src/messages/acquisition.rs | 30 +-- rust/sbp/src/messages/bootload.rs | 30 +-- rust/sbp/src/messages/ext_events.rs | 5 +- rust/sbp/src/messages/file_io.rs | 45 ++-- rust/sbp/src/messages/flash.rs | 50 ++--- rust/sbp/src/messages/imu.rs | 10 +- rust/sbp/src/messages/integrity.rs | 30 +-- rust/sbp/src/messages/linux.rs | 55 ++--- rust/sbp/src/messages/logging.rs | 15 +- rust/sbp/src/messages/mag.rs | 5 +- rust/sbp/src/messages/navigation.rs | 205 +++++++----------- rust/sbp/src/messages/ndb.rs | 5 +- rust/sbp/src/messages/observation.rs | 190 +++++++--------- rust/sbp/src/messages/orientation.rs | 20 +- rust/sbp/src/messages/piksi.rs | 125 +++++------ rust/sbp/src/messages/sbas.rs | 5 +- rust/sbp/src/messages/settings.rs | 50 ++--- rust/sbp/src/messages/signing.rs | 15 +- rust/sbp/src/messages/solution_meta.rs | 10 +- rust/sbp/src/messages/ssr.rs | 88 +++----- rust/sbp/src/messages/system.rs | 65 +++--- rust/sbp/src/messages/tracking.rs | 45 ++-- rust/sbp/src/messages/user.rs | 5 +- rust/sbp/src/messages/vehicle.rs | 10 +- spec/yaml/swiftnav/sbp/piksi.yaml | 1 + spec/yaml/swiftnav/sbp/ssr.yaml | 2 +- 28 files changed, 481 insertions(+), 672 deletions(-) diff --git a/generator/sbpg/targets/resources/rust/sbp_messages_template.rs b/generator/sbpg/targets/resources/rust/sbp_messages_template.rs index f818a8a455..f2380cdc7f 100644 --- a/generator/sbpg/targets/resources/rust/sbp_messages_template.rs +++ b/generator/sbpg/targets/resources/rust/sbp_messages_template.rs @@ -157,9 +157,12 @@ impl FriendlyName for (((m.msg_name))) { } impl MessageDisplay for (((m.msg_name))) { - #[allow(clippy::useless_format)] fn message_display(&self) -> String { + ((* if m.message_display_fields *)) format!("(((m.message_display)))") + ((* else *)) + "(((m.message_display)))".to_string() + ((* endif *)) } } ((* endif *)) diff --git a/generator/sbpg/targets/rust.py b/generator/sbpg/targets/rust.py index 32d5c10099..6cd879df5e 100644 --- a/generator/sbpg/targets/rust.py +++ b/generator/sbpg/targets/rust.py @@ -13,6 +13,8 @@ Generator for rust target. """ +import re + from jinja2.environment import Environment from jinja2.utils import pass_environment @@ -330,6 +332,29 @@ def get_bitfield(field): return items +def get_friendly_name(msg): + if msg.friendly_name: + return msg.friendly_name + shorten_keyword = { + "TRACKING": "TRK", + "MEASUREMENT": "MEAS", + "INDEX": "IDX", + "NETWORK": "NET", + "EPHEMERIS": "EPH", + "_": " " + } + f_name = msg.identifier + if f_name.endswith("_GNSS"): + f_name = f_name[:-5] + " GNSS-only" + + # replace MSG_ + f_name = f_name[4:] + + for key in shorten_keyword.keys(): + f_name = f_name.replace(key, shorten_keyword[key]) + return f_name + + class FieldItem(object): def __init__(self, msg, package_specs, field): self.identifier = field.identifier @@ -370,8 +395,11 @@ def __init__(self, msg, package, package_specs): if len(field.bitfield) > 0: self.has_bitfield = True self.gps_time_fn = gps_time_fn(self) - self.message_display = getattr(msg, "message_display", "") - self.friendly_name = getattr(msg, "friendly_name", "") + self.friendly_name = get_friendly_name(msg) + self.message_display = msg.message_display + if self.message_display: + # match regex, capture all {{field}} enclosed by two brackets + self.message_display_fields = re.findall("{{([^}]+)}}[.]*", self.message_display) class PackageItem(object): diff --git a/rust/sbp/src/messages/acquisition.rs b/rust/sbp/src/messages/acquisition.rs index b04952eb83..a89ed3a1b0 100644 --- a/rust/sbp/src/messages/acquisition.rs +++ b/rust/sbp/src/messages/acquisition.rs @@ -320,14 +320,13 @@ pub mod msg_acq_result { impl FriendlyName for MsgAcqResult { fn friendly_name() -> &'static str { - "" + "ACQ RESULT" } } impl MessageDisplay for MsgAcqResult { - #[allow(clippy::useless_format)] fn message_display(&self) -> String { - format!("") + "".to_string() } } @@ -429,14 +428,13 @@ pub mod msg_acq_result_dep_a { impl FriendlyName for MsgAcqResultDepA { fn friendly_name() -> &'static str { - "" + "ACQ RESULT DEP A" } } impl MessageDisplay for MsgAcqResultDepA { - #[allow(clippy::useless_format)] fn message_display(&self) -> String { - format!("") + "".to_string() } } @@ -537,14 +535,13 @@ pub mod msg_acq_result_dep_b { impl FriendlyName for MsgAcqResultDepB { fn friendly_name() -> &'static str { - "" + "ACQ RESULT DEP B" } } impl MessageDisplay for MsgAcqResultDepB { - #[allow(clippy::useless_format)] fn message_display(&self) -> String { - format!("") + "".to_string() } } @@ -644,14 +641,13 @@ pub mod msg_acq_result_dep_c { impl FriendlyName for MsgAcqResultDepC { fn friendly_name() -> &'static str { - "" + "ACQ RESULT DEP C" } } impl MessageDisplay for MsgAcqResultDepC { - #[allow(clippy::useless_format)] fn message_display(&self) -> String { - format!("") + "".to_string() } } @@ -743,14 +739,13 @@ pub mod msg_acq_sv_profile { impl FriendlyName for MsgAcqSvProfile { fn friendly_name() -> &'static str { - "" + "ACQ SV PROFILE" } } impl MessageDisplay for MsgAcqSvProfile { - #[allow(clippy::useless_format)] fn message_display(&self) -> String { - format!("") + "".to_string() } } @@ -829,14 +824,13 @@ pub mod msg_acq_sv_profile_dep { impl FriendlyName for MsgAcqSvProfileDep { fn friendly_name() -> &'static str { - "" + "ACQ SV PROFILE DEP" } } impl MessageDisplay for MsgAcqSvProfileDep { - #[allow(clippy::useless_format)] fn message_display(&self) -> String { - format!("") + "".to_string() } } diff --git a/rust/sbp/src/messages/bootload.rs b/rust/sbp/src/messages/bootload.rs index bcd317c674..c7f13d0101 100644 --- a/rust/sbp/src/messages/bootload.rs +++ b/rust/sbp/src/messages/bootload.rs @@ -81,14 +81,13 @@ pub mod msg_bootloader_handshake_dep_a { impl FriendlyName for MsgBootloaderHandshakeDepA { fn friendly_name() -> &'static str { - "" + "BOOTLOADER HANDSHAKE DEP A" } } impl MessageDisplay for MsgBootloaderHandshakeDepA { - #[allow(clippy::useless_format)] fn message_display(&self) -> String { - format!("") + "".to_string() } } @@ -165,14 +164,13 @@ pub mod msg_bootloader_handshake_req { impl FriendlyName for MsgBootloaderHandshakeReq { fn friendly_name() -> &'static str { - "" + "BOOTLOADER HANDSHAKE REQ" } } impl MessageDisplay for MsgBootloaderHandshakeReq { - #[allow(clippy::useless_format)] fn message_display(&self) -> String { - format!("") + "".to_string() } } @@ -293,14 +291,13 @@ pub mod msg_bootloader_handshake_resp { impl FriendlyName for MsgBootloaderHandshakeResp { fn friendly_name() -> &'static str { - "" + "BOOTLOADER HANDSHAKE RESP" } } impl MessageDisplay for MsgBootloaderHandshakeResp { - #[allow(clippy::useless_format)] fn message_display(&self) -> String { - format!("") + "".to_string() } } @@ -381,14 +378,13 @@ pub mod msg_bootloader_jump_to_app { impl FriendlyName for MsgBootloaderJumpToApp { fn friendly_name() -> &'static str { - "" + "BOOTLOADER JUMP TO APP" } } impl MessageDisplay for MsgBootloaderJumpToApp { - #[allow(clippy::useless_format)] fn message_display(&self) -> String { - format!("") + "".to_string() } } @@ -468,14 +464,13 @@ pub mod msg_nap_device_dna_req { impl FriendlyName for MsgNapDeviceDnaReq { fn friendly_name() -> &'static str { - "" + "NAP DEVICE DNA REQ" } } impl MessageDisplay for MsgNapDeviceDnaReq { - #[allow(clippy::useless_format)] fn message_display(&self) -> String { - format!("") + "".to_string() } } @@ -553,14 +548,13 @@ pub mod msg_nap_device_dna_resp { impl FriendlyName for MsgNapDeviceDnaResp { fn friendly_name() -> &'static str { - "" + "NAP DEVICE DNA RESP" } } impl MessageDisplay for MsgNapDeviceDnaResp { - #[allow(clippy::useless_format)] fn message_display(&self) -> String { - format!("") + "".to_string() } } diff --git a/rust/sbp/src/messages/ext_events.rs b/rust/sbp/src/messages/ext_events.rs index b7543a112e..0d185232b4 100644 --- a/rust/sbp/src/messages/ext_events.rs +++ b/rust/sbp/src/messages/ext_events.rs @@ -131,14 +131,13 @@ pub mod msg_ext_event { impl FriendlyName for MsgExtEvent { fn friendly_name() -> &'static str { - "" + "EXT EVENT" } } impl MessageDisplay for MsgExtEvent { - #[allow(clippy::useless_format)] fn message_display(&self) -> String { - format!("") + "".to_string() } } diff --git a/rust/sbp/src/messages/file_io.rs b/rust/sbp/src/messages/file_io.rs index 3416a0f4ff..a87b16183f 100644 --- a/rust/sbp/src/messages/file_io.rs +++ b/rust/sbp/src/messages/file_io.rs @@ -90,14 +90,13 @@ pub mod msg_fileio_config_req { impl FriendlyName for MsgFileioConfigReq { fn friendly_name() -> &'static str { - "" + "FILEIO CONFIG REQ" } } impl MessageDisplay for MsgFileioConfigReq { - #[allow(clippy::useless_format)] fn message_display(&self) -> String { - format!("") + "".to_string() } } @@ -188,14 +187,13 @@ pub mod msg_fileio_config_resp { impl FriendlyName for MsgFileioConfigResp { fn friendly_name() -> &'static str { - "" + "FILEIO CONFIG RESP" } } impl MessageDisplay for MsgFileioConfigResp { - #[allow(clippy::useless_format)] fn message_display(&self) -> String { - format!("") + "".to_string() } } @@ -299,14 +297,13 @@ pub mod msg_fileio_read_dir_req { impl FriendlyName for MsgFileioReadDirReq { fn friendly_name() -> &'static str { - "" + "FILEIO READ DIR REQ" } } impl MessageDisplay for MsgFileioReadDirReq { - #[allow(clippy::useless_format)] fn message_display(&self) -> String { - format!("") + "".to_string() } } @@ -399,14 +396,13 @@ pub mod msg_fileio_read_dir_resp { impl FriendlyName for MsgFileioReadDirResp { fn friendly_name() -> &'static str { - "" + "FILEIO READ DIR RESP" } } impl MessageDisplay for MsgFileioReadDirResp { - #[allow(clippy::useless_format)] fn message_display(&self) -> String { - format!("") + "".to_string() } } @@ -501,14 +497,13 @@ pub mod msg_fileio_read_req { impl FriendlyName for MsgFileioReadReq { fn friendly_name() -> &'static str { - "" + "FILEIO READ REQ" } } impl MessageDisplay for MsgFileioReadReq { - #[allow(clippy::useless_format)] fn message_display(&self) -> String { - format!("") + "".to_string() } } @@ -604,14 +599,13 @@ pub mod msg_fileio_read_resp { impl FriendlyName for MsgFileioReadResp { fn friendly_name() -> &'static str { - "" + "FILEIO READ RESP" } } impl MessageDisplay for MsgFileioReadResp { - #[allow(clippy::useless_format)] fn message_display(&self) -> String { - format!("") + "".to_string() } } @@ -694,14 +688,13 @@ pub mod msg_fileio_remove { impl FriendlyName for MsgFileioRemove { fn friendly_name() -> &'static str { - "" + "FILEIO REMOVE" } } impl MessageDisplay for MsgFileioRemove { - #[allow(clippy::useless_format)] fn message_display(&self) -> String { - format!("") + "".to_string() } } @@ -794,14 +787,13 @@ pub mod msg_fileio_write_req { impl FriendlyName for MsgFileioWriteReq { fn friendly_name() -> &'static str { - "" + "FILEIO WRITE REQ" } } impl MessageDisplay for MsgFileioWriteReq { - #[allow(clippy::useless_format)] fn message_display(&self) -> String { - format!("") + "".to_string() } } @@ -894,14 +886,13 @@ pub mod msg_fileio_write_resp { impl FriendlyName for MsgFileioWriteResp { fn friendly_name() -> &'static str { - "" + "FILEIO WRITE RESP" } } impl MessageDisplay for MsgFileioWriteResp { - #[allow(clippy::useless_format)] fn message_display(&self) -> String { - format!("") + "".to_string() } } diff --git a/rust/sbp/src/messages/flash.rs b/rust/sbp/src/messages/flash.rs index e163a45e1d..fcf8718eb8 100644 --- a/rust/sbp/src/messages/flash.rs +++ b/rust/sbp/src/messages/flash.rs @@ -103,14 +103,13 @@ pub mod msg_flash_done { impl FriendlyName for MsgFlashDone { fn friendly_name() -> &'static str { - "" + "FLASH DONE" } } impl MessageDisplay for MsgFlashDone { - #[allow(clippy::useless_format)] fn message_display(&self) -> String { - format!("") + "".to_string() } } @@ -260,14 +259,13 @@ pub mod msg_flash_erase { impl FriendlyName for MsgFlashErase { fn friendly_name() -> &'static str { - "" + "FLASH ERASE" } } impl MessageDisplay for MsgFlashErase { - #[allow(clippy::useless_format)] fn message_display(&self) -> String { - format!("") + "".to_string() } } @@ -406,14 +404,13 @@ pub mod msg_flash_program { impl FriendlyName for MsgFlashProgram { fn friendly_name() -> &'static str { - "" + "FLASH PROGRAM" } } impl MessageDisplay for MsgFlashProgram { - #[allow(clippy::useless_format)] fn message_display(&self) -> String { - format!("") + "".to_string() } } @@ -560,14 +557,13 @@ pub mod msg_flash_read_req { impl FriendlyName for MsgFlashReadReq { fn friendly_name() -> &'static str { - "" + "FLASH READ REQ" } } impl MessageDisplay for MsgFlashReadReq { - #[allow(clippy::useless_format)] fn message_display(&self) -> String { - format!("") + "".to_string() } } @@ -710,14 +706,13 @@ pub mod msg_flash_read_resp { impl FriendlyName for MsgFlashReadResp { fn friendly_name() -> &'static str { - "" + "FLASH READ RESP" } } impl MessageDisplay for MsgFlashReadResp { - #[allow(clippy::useless_format)] fn message_display(&self) -> String { - format!("") + "".to_string() } } @@ -834,14 +829,13 @@ pub mod msg_m25_flash_write_status { impl FriendlyName for MsgM25FlashWriteStatus { fn friendly_name() -> &'static str { - "" + "M25 FLASH WRITE STATUS" } } impl MessageDisplay for MsgM25FlashWriteStatus { - #[allow(clippy::useless_format)] fn message_display(&self) -> String { - format!("") + "".to_string() } } @@ -920,14 +914,13 @@ pub mod msg_stm_flash_lock_sector { impl FriendlyName for MsgStmFlashLockSector { fn friendly_name() -> &'static str { - "" + "STM FLASH LOCK SECTOR" } } impl MessageDisplay for MsgStmFlashLockSector { - #[allow(clippy::useless_format)] fn message_display(&self) -> String { - format!("") + "".to_string() } } @@ -1006,14 +999,13 @@ pub mod msg_stm_flash_unlock_sector { impl FriendlyName for MsgStmFlashUnlockSector { fn friendly_name() -> &'static str { - "" + "STM FLASH UNLOCK SECTOR" } } impl MessageDisplay for MsgStmFlashUnlockSector { - #[allow(clippy::useless_format)] fn message_display(&self) -> String { - format!("") + "".to_string() } } @@ -1091,14 +1083,13 @@ pub mod msg_stm_unique_id_req { impl FriendlyName for MsgStmUniqueIdReq { fn friendly_name() -> &'static str { - "" + "STM UNIQUE ID REQ" } } impl MessageDisplay for MsgStmUniqueIdReq { - #[allow(clippy::useless_format)] fn message_display(&self) -> String { - format!("") + "".to_string() } } @@ -1174,14 +1165,13 @@ pub mod msg_stm_unique_id_resp { impl FriendlyName for MsgStmUniqueIdResp { fn friendly_name() -> &'static str { - "" + "STM UNIQUE ID RESP" } } impl MessageDisplay for MsgStmUniqueIdResp { - #[allow(clippy::useless_format)] fn message_display(&self) -> String { - format!("") + "".to_string() } } diff --git a/rust/sbp/src/messages/imu.rs b/rust/sbp/src/messages/imu.rs index d0381166d0..d43173c42f 100644 --- a/rust/sbp/src/messages/imu.rs +++ b/rust/sbp/src/messages/imu.rs @@ -125,14 +125,13 @@ pub mod msg_imu_aux { impl FriendlyName for MsgImuAux { fn friendly_name() -> &'static str { - "" + "IMU AUX" } } impl MessageDisplay for MsgImuAux { - #[allow(clippy::useless_format)] fn message_display(&self) -> String { - format!("") + "".to_string() } } @@ -414,14 +413,13 @@ pub mod msg_imu_raw { impl FriendlyName for MsgImuRaw { fn friendly_name() -> &'static str { - "" + "IMU RAW" } } impl MessageDisplay for MsgImuRaw { - #[allow(clippy::useless_format)] fn message_display(&self) -> String { - format!("") + "".to_string() } } diff --git a/rust/sbp/src/messages/integrity.rs b/rust/sbp/src/messages/integrity.rs index 7f4c9678c7..29adc47642 100644 --- a/rust/sbp/src/messages/integrity.rs +++ b/rust/sbp/src/messages/integrity.rs @@ -352,14 +352,13 @@ pub mod msg_ssr_flag_high_level { impl FriendlyName for MsgSsrFlagHighLevel { fn friendly_name() -> &'static str { - "" + "SSR FLAG HIGH LEVEL" } } impl MessageDisplay for MsgSsrFlagHighLevel { - #[allow(clippy::useless_format)] fn message_display(&self) -> String { - format!("") + "".to_string() } } @@ -772,14 +771,13 @@ pub mod msg_ssr_flag_iono_grid_points { impl FriendlyName for MsgSsrFlagIonoGridPoints { fn friendly_name() -> &'static str { - "" + "SSR FLAG IONO GRID POINTS" } } impl MessageDisplay for MsgSsrFlagIonoGridPoints { - #[allow(clippy::useless_format)] fn message_display(&self) -> String { - format!("") + "".to_string() } } @@ -871,14 +869,13 @@ pub mod msg_ssr_flag_iono_grid_point_sat_los { impl FriendlyName for MsgSsrFlagIonoGridPointSatLos { fn friendly_name() -> &'static str { - "" + "SSR FLAG IONO GRID POINT SAT LOS" } } impl MessageDisplay for MsgSsrFlagIonoGridPointSatLos { - #[allow(clippy::useless_format)] fn message_display(&self) -> String { - format!("") + "".to_string() } } @@ -971,14 +968,13 @@ pub mod msg_ssr_flag_iono_tile_sat_los { impl FriendlyName for MsgSsrFlagIonoTileSatLos { fn friendly_name() -> &'static str { - "" + "SSR FLAG IONO TILE SAT LOS" } } impl MessageDisplay for MsgSsrFlagIonoTileSatLos { - #[allow(clippy::useless_format)] fn message_display(&self) -> String { - format!("") + "".to_string() } } @@ -1082,14 +1078,13 @@ pub mod msg_ssr_flag_satellites { impl FriendlyName for MsgSsrFlagSatellites { fn friendly_name() -> &'static str { - "" + "SSR FLAG SATELLITES" } } impl MessageDisplay for MsgSsrFlagSatellites { - #[allow(clippy::useless_format)] fn message_display(&self) -> String { - format!("") + "".to_string() } } @@ -1198,14 +1193,13 @@ pub mod msg_ssr_flag_tropo_grid_points { impl FriendlyName for MsgSsrFlagTropoGridPoints { fn friendly_name() -> &'static str { - "" + "SSR FLAG TROPO GRID POINTS" } } impl MessageDisplay for MsgSsrFlagTropoGridPoints { - #[allow(clippy::useless_format)] fn message_display(&self) -> String { - format!("") + "".to_string() } } diff --git a/rust/sbp/src/messages/linux.rs b/rust/sbp/src/messages/linux.rs index 35ac3b26e5..97895cc0db 100644 --- a/rust/sbp/src/messages/linux.rs +++ b/rust/sbp/src/messages/linux.rs @@ -117,14 +117,13 @@ pub mod msg_linux_cpu_state { impl FriendlyName for MsgLinuxCpuState { fn friendly_name() -> &'static str { - "" + "LINUX CPU STATE" } } impl MessageDisplay for MsgLinuxCpuState { - #[allow(clippy::useless_format)] fn message_display(&self) -> String { - format!("") + "".to_string() } } @@ -269,14 +268,13 @@ pub mod msg_linux_cpu_state_dep_a { impl FriendlyName for MsgLinuxCpuStateDepA { fn friendly_name() -> &'static str { - "" + "LINUX CPU STATE DEP A" } } impl MessageDisplay for MsgLinuxCpuStateDepA { - #[allow(clippy::useless_format)] fn message_display(&self) -> String { - format!("") + "".to_string() } } @@ -405,14 +403,13 @@ pub mod msg_linux_mem_state { impl FriendlyName for MsgLinuxMemState { fn friendly_name() -> &'static str { - "" + "LINUX MEM STATE" } } impl MessageDisplay for MsgLinuxMemState { - #[allow(clippy::useless_format)] fn message_display(&self) -> String { - format!("") + "".to_string() } } @@ -557,14 +554,13 @@ pub mod msg_linux_mem_state_dep_a { impl FriendlyName for MsgLinuxMemStateDepA { fn friendly_name() -> &'static str { - "" + "LINUX MEM STATE DEP A" } } impl MessageDisplay for MsgLinuxMemStateDepA { - #[allow(clippy::useless_format)] fn message_display(&self) -> String { - format!("") + "".to_string() } } @@ -667,14 +663,13 @@ pub mod msg_linux_process_fd_count { impl FriendlyName for MsgLinuxProcessFdCount { fn friendly_name() -> &'static str { - "" + "LINUX PROCESS FD COUNT" } } impl MessageDisplay for MsgLinuxProcessFdCount { - #[allow(clippy::useless_format)] fn message_display(&self) -> String { - format!("") + "".to_string() } } @@ -771,14 +766,13 @@ pub mod msg_linux_process_fd_summary { impl FriendlyName for MsgLinuxProcessFdSummary { fn friendly_name() -> &'static str { - "" + "LINUX PROCESS FD SUMMARY" } } impl MessageDisplay for MsgLinuxProcessFdSummary { - #[allow(clippy::useless_format)] fn message_display(&self) -> String { - format!("") + "".to_string() } } @@ -878,14 +872,13 @@ pub mod msg_linux_process_socket_counts { impl FriendlyName for MsgLinuxProcessSocketCounts { fn friendly_name() -> &'static str { - "" + "LINUX PROCESS SOCKET COUNTS" } } impl MessageDisplay for MsgLinuxProcessSocketCounts { - #[allow(clippy::useless_format)] fn message_display(&self) -> String { - format!("") + "".to_string() } } @@ -1009,14 +1002,13 @@ pub mod msg_linux_process_socket_queues { impl FriendlyName for MsgLinuxProcessSocketQueues { fn friendly_name() -> &'static str { - "" + "LINUX PROCESS SOCKET QUEUES" } } impl MessageDisplay for MsgLinuxProcessSocketQueues { - #[allow(clippy::useless_format)] fn message_display(&self) -> String { - format!("") + "".to_string() } } @@ -1135,14 +1127,13 @@ pub mod msg_linux_socket_usage { impl FriendlyName for MsgLinuxSocketUsage { fn friendly_name() -> &'static str { - "" + "LINUX SOCKET USAGE" } } impl MessageDisplay for MsgLinuxSocketUsage { - #[allow(clippy::useless_format)] fn message_display(&self) -> String { - format!("") + "".to_string() } } @@ -1270,14 +1261,13 @@ pub mod msg_linux_sys_state { impl FriendlyName for MsgLinuxSysState { fn friendly_name() -> &'static str { - "" + "LINUX SYS STATE" } } impl MessageDisplay for MsgLinuxSysState { - #[allow(clippy::useless_format)] fn message_display(&self) -> String { - format!("") + "".to_string() } } @@ -1428,14 +1418,13 @@ pub mod msg_linux_sys_state_dep_a { impl FriendlyName for MsgLinuxSysStateDepA { fn friendly_name() -> &'static str { - "" + "LINUX SYS STATE DEP A" } } impl MessageDisplay for MsgLinuxSysStateDepA { - #[allow(clippy::useless_format)] fn message_display(&self) -> String { - format!("") + "".to_string() } } diff --git a/rust/sbp/src/messages/logging.rs b/rust/sbp/src/messages/logging.rs index 8594e88be3..5f90389b34 100644 --- a/rust/sbp/src/messages/logging.rs +++ b/rust/sbp/src/messages/logging.rs @@ -87,14 +87,13 @@ pub mod msg_fwd { impl FriendlyName for MsgFwd { fn friendly_name() -> &'static str { - "" + "FWD" } } impl MessageDisplay for MsgFwd { - #[allow(clippy::useless_format)] fn message_display(&self) -> String { - format!("") + "".to_string() } } @@ -201,14 +200,13 @@ pub mod msg_log { impl FriendlyName for MsgLog { fn friendly_name() -> &'static str { - "" + "LOG" } } impl MessageDisplay for MsgLog { - #[allow(clippy::useless_format)] fn message_display(&self) -> String { - format!("") + "".to_string() } } @@ -349,14 +347,13 @@ pub mod msg_print_dep { impl FriendlyName for MsgPrintDep { fn friendly_name() -> &'static str { - "" + "PRINT DEP" } } impl MessageDisplay for MsgPrintDep { - #[allow(clippy::useless_format)] fn message_display(&self) -> String { - format!("") + "".to_string() } } diff --git a/rust/sbp/src/messages/mag.rs b/rust/sbp/src/messages/mag.rs index 3d2dd92619..03d11ff7be 100644 --- a/rust/sbp/src/messages/mag.rs +++ b/rust/sbp/src/messages/mag.rs @@ -94,14 +94,13 @@ pub mod msg_mag_raw { impl FriendlyName for MsgMagRaw { fn friendly_name() -> &'static str { - "" + "MAG RAW" } } impl MessageDisplay for MsgMagRaw { - #[allow(clippy::useless_format)] fn message_display(&self) -> String { - format!("") + "".to_string() } } diff --git a/rust/sbp/src/messages/navigation.rs b/rust/sbp/src/messages/navigation.rs index abacea5a09..003d2a351c 100644 --- a/rust/sbp/src/messages/navigation.rs +++ b/rust/sbp/src/messages/navigation.rs @@ -197,14 +197,13 @@ pub mod msg_age_corrections { impl FriendlyName for MsgAgeCorrections { fn friendly_name() -> &'static str { - "" + "AGE CORRECTIONS" } } impl MessageDisplay for MsgAgeCorrections { - #[allow(clippy::useless_format)] fn message_display(&self) -> String { - format!("") + "".to_string() } } @@ -330,14 +329,13 @@ pub mod msg_baseline_ecef { impl FriendlyName for MsgBaselineEcef { fn friendly_name() -> &'static str { - "" + "BASELINE ECEF" } } impl MessageDisplay for MsgBaselineEcef { - #[allow(clippy::useless_format)] fn message_display(&self) -> String { - format!("") + "".to_string() } } @@ -553,14 +551,13 @@ pub mod msg_baseline_ecef_dep_a { impl FriendlyName for MsgBaselineEcefDepA { fn friendly_name() -> &'static str { - "" + "BASELINE ECEF DEP A" } } impl MessageDisplay for MsgBaselineEcefDepA { - #[allow(clippy::useless_format)] fn message_display(&self) -> String { - format!("") + "".to_string() } } @@ -822,14 +819,13 @@ pub mod msg_baseline_heading_dep_a { impl FriendlyName for MsgBaselineHeadingDepA { fn friendly_name() -> &'static str { - "" + "BASELINE HEADING DEP A" } } impl MessageDisplay for MsgBaselineHeadingDepA { - #[allow(clippy::useless_format)] fn message_display(&self) -> String { - format!("") + "".to_string() } } @@ -1066,14 +1062,13 @@ pub mod msg_baseline_ned { impl FriendlyName for MsgBaselineNed { fn friendly_name() -> &'static str { - "" + "BASELINE NED" } } impl MessageDisplay for MsgBaselineNed { - #[allow(clippy::useless_format)] fn message_display(&self) -> String { - format!("") + "".to_string() } } @@ -1298,14 +1293,13 @@ pub mod msg_baseline_ned_dep_a { impl FriendlyName for MsgBaselineNedDepA { fn friendly_name() -> &'static str { - "" + "BASELINE NED DEP A" } } impl MessageDisplay for MsgBaselineNedDepA { - #[allow(clippy::useless_format)] fn message_display(&self) -> String { - format!("") + "".to_string() } } @@ -1564,14 +1558,13 @@ pub mod msg_dops { impl FriendlyName for MsgDops { fn friendly_name() -> &'static str { - "" + "DOPS" } } impl MessageDisplay for MsgDops { - #[allow(clippy::useless_format)] fn message_display(&self) -> String { - format!("") + "".to_string() } } @@ -1753,14 +1746,13 @@ pub mod msg_dops_dep_a { impl FriendlyName for MsgDopsDepA { fn friendly_name() -> &'static str { - "" + "DOPS DEP A" } } impl MessageDisplay for MsgDopsDepA { - #[allow(clippy::useless_format)] fn message_display(&self) -> String { - format!("") + "".to_string() } } @@ -1908,14 +1900,13 @@ pub mod msg_gps_time { impl FriendlyName for MsgGpsTime { fn friendly_name() -> &'static str { - "" + "GPS TIME" } } impl MessageDisplay for MsgGpsTime { - #[allow(clippy::useless_format)] fn message_display(&self) -> String { - format!("") + "".to_string() } } @@ -2074,14 +2065,13 @@ pub mod msg_gps_time_dep_a { impl FriendlyName for MsgGpsTimeDepA { fn friendly_name() -> &'static str { - "" + "GPS TIME DEP A" } } impl MessageDisplay for MsgGpsTimeDepA { - #[allow(clippy::useless_format)] fn message_display(&self) -> String { - format!("") + "".to_string() } } @@ -2221,14 +2211,13 @@ pub mod msg_gps_time_gnss { impl FriendlyName for MsgGpsTimeGnss { fn friendly_name() -> &'static str { - "" + "GPS TIME GNSS-only" } } impl MessageDisplay for MsgGpsTimeGnss { - #[allow(clippy::useless_format)] fn message_display(&self) -> String { - format!("") + "".to_string() } } @@ -2485,14 +2474,13 @@ pub mod msg_pose_relative { impl FriendlyName for MsgPoseRelative { fn friendly_name() -> &'static str { - "" + "POSE RELATIVE" } } impl MessageDisplay for MsgPoseRelative { - #[allow(clippy::useless_format)] fn message_display(&self) -> String { - format!("") + "".to_string() } } @@ -2829,14 +2817,13 @@ pub mod msg_pos_ecef { impl FriendlyName for MsgPosEcef { fn friendly_name() -> &'static str { - "" + "POS ECEF" } } impl MessageDisplay for MsgPosEcef { - #[allow(clippy::useless_format)] fn message_display(&self) -> String { - format!("") + "".to_string() } } @@ -3149,14 +3136,13 @@ pub mod msg_pos_ecef_cov { impl FriendlyName for MsgPosEcefCov { fn friendly_name() -> &'static str { - "" + "POS ECEF COV" } } impl MessageDisplay for MsgPosEcefCov { - #[allow(clippy::useless_format)] fn message_display(&self) -> String { - format!("") + "".to_string() } } @@ -3458,14 +3444,13 @@ pub mod msg_pos_ecef_cov_gnss { impl FriendlyName for MsgPosEcefCovGnss { fn friendly_name() -> &'static str { - "" + "POS ECEF COV GNSS-only" } } impl MessageDisplay for MsgPosEcefCovGnss { - #[allow(clippy::useless_format)] fn message_display(&self) -> String { - format!("") + "".to_string() } } @@ -3714,14 +3699,13 @@ pub mod msg_pos_ecef_dep_a { impl FriendlyName for MsgPosEcefDepA { fn friendly_name() -> &'static str { - "" + "POS ECEF DEP A" } } impl MessageDisplay for MsgPosEcefDepA { - #[allow(clippy::useless_format)] fn message_display(&self) -> String { - format!("") + "".to_string() } } @@ -3973,14 +3957,13 @@ pub mod msg_pos_ecef_gnss { impl FriendlyName for MsgPosEcefGnss { fn friendly_name() -> &'static str { - "" + "POS ECEF GNSS-only" } } impl MessageDisplay for MsgPosEcefGnss { - #[allow(clippy::useless_format)] fn message_display(&self) -> String { - format!("") + "".to_string() } } @@ -4215,14 +4198,13 @@ pub mod msg_pos_llh { impl FriendlyName for MsgPosLlh { fn friendly_name() -> &'static str { - "" + "POS LLH" } } impl MessageDisplay for MsgPosLlh { - #[allow(clippy::useless_format)] fn message_display(&self) -> String { - format!("") + "".to_string() } } @@ -4587,14 +4569,13 @@ pub mod msg_pos_llh_acc { impl FriendlyName for MsgPosLlhAcc { fn friendly_name() -> &'static str { - "" + "POS LLH ACC" } } impl MessageDisplay for MsgPosLlhAcc { - #[allow(clippy::useless_format)] fn message_display(&self) -> String { - format!("") + "".to_string() } } @@ -5001,14 +4982,13 @@ pub mod msg_pos_llh_cov { impl FriendlyName for MsgPosLlhCov { fn friendly_name() -> &'static str { - "" + "POS LLH COV" } } impl MessageDisplay for MsgPosLlhCov { - #[allow(clippy::useless_format)] fn message_display(&self) -> String { - format!("") + "".to_string() } } @@ -5310,14 +5290,13 @@ pub mod msg_pos_llh_cov_gnss { impl FriendlyName for MsgPosLlhCovGnss { fn friendly_name() -> &'static str { - "" + "POS LLH COV GNSS-only" } } impl MessageDisplay for MsgPosLlhCovGnss { - #[allow(clippy::useless_format)] fn message_display(&self) -> String { - format!("") + "".to_string() } } @@ -5588,14 +5567,13 @@ pub mod msg_pos_llh_dep_a { impl FriendlyName for MsgPosLlhDepA { fn friendly_name() -> &'static str { - "" + "POS LLH DEP A" } } impl MessageDisplay for MsgPosLlhDepA { - #[allow(clippy::useless_format)] fn message_display(&self) -> String { - format!("") + "".to_string() } } @@ -5886,14 +5864,13 @@ pub mod msg_pos_llh_gnss { impl FriendlyName for MsgPosLlhGnss { fn friendly_name() -> &'static str { - "" + "POS LLH GNSS-only" } } impl MessageDisplay for MsgPosLlhGnss { - #[allow(clippy::useless_format)] fn message_display(&self) -> String { - format!("") + "".to_string() } } @@ -6312,14 +6289,13 @@ pub mod msg_protection_level { impl FriendlyName for MsgProtectionLevel { fn friendly_name() -> &'static str { - "" + "PROTECTION LEVEL" } } impl MessageDisplay for MsgProtectionLevel { - #[allow(clippy::useless_format)] fn message_display(&self) -> String { - format!("") + "".to_string() } } @@ -6647,14 +6623,13 @@ pub mod msg_protection_level_dep_a { impl FriendlyName for MsgProtectionLevelDepA { fn friendly_name() -> &'static str { - "" + "PROTECTION LEVEL DEP A" } } impl MessageDisplay for MsgProtectionLevelDepA { - #[allow(clippy::useless_format)] fn message_display(&self) -> String { - format!("") + "".to_string() } } @@ -6851,14 +6826,13 @@ pub mod msg_reference_frame_param { impl FriendlyName for MsgReferenceFrameParam { fn friendly_name() -> &'static str { - "" + "REFERENCE FRAME PARAM" } } impl MessageDisplay for MsgReferenceFrameParam { - #[allow(clippy::useless_format)] fn message_display(&self) -> String { - format!("") + "".to_string() } } @@ -7038,14 +7012,13 @@ pub mod msg_utc_leap_second { impl FriendlyName for MsgUtcLeapSecond { fn friendly_name() -> &'static str { - "" + "UTC LEAP SECOND" } } impl MessageDisplay for MsgUtcLeapSecond { - #[allow(clippy::useless_format)] fn message_display(&self) -> String { - format!("") + "".to_string() } } @@ -7220,14 +7193,13 @@ pub mod msg_utc_time { impl FriendlyName for MsgUtcTime { fn friendly_name() -> &'static str { - "" + "UTC TIME" } } impl MessageDisplay for MsgUtcTime { - #[allow(clippy::useless_format)] fn message_display(&self) -> String { - format!("") + "".to_string() } } @@ -7472,14 +7444,13 @@ pub mod msg_utc_time_gnss { impl FriendlyName for MsgUtcTimeGnss { fn friendly_name() -> &'static str { - "" + "UTC TIME GNSS-only" } } impl MessageDisplay for MsgUtcTimeGnss { - #[allow(clippy::useless_format)] fn message_display(&self) -> String { - format!("") + "".to_string() } } @@ -7739,14 +7710,13 @@ pub mod msg_vel_body { impl FriendlyName for MsgVelBody { fn friendly_name() -> &'static str { - "" + "VEL BODY" } } impl MessageDisplay for MsgVelBody { - #[allow(clippy::useless_format)] fn message_display(&self) -> String { - format!("") + "".to_string() } } @@ -8081,14 +8051,13 @@ pub mod msg_vel_cog { impl FriendlyName for MsgVelCog { fn friendly_name() -> &'static str { - "" + "VEL COG" } } impl MessageDisplay for MsgVelCog { - #[allow(clippy::useless_format)] fn message_display(&self) -> String { - format!("") + "".to_string() } } @@ -8489,14 +8458,13 @@ pub mod msg_vel_ecef { impl FriendlyName for MsgVelEcef { fn friendly_name() -> &'static str { - "" + "VEL ECEF" } } impl MessageDisplay for MsgVelEcef { - #[allow(clippy::useless_format)] fn message_display(&self) -> String { - format!("") + "".to_string() } } @@ -8786,14 +8754,13 @@ pub mod msg_vel_ecef_cov { impl FriendlyName for MsgVelEcefCov { fn friendly_name() -> &'static str { - "" + "VEL ECEF COV" } } impl MessageDisplay for MsgVelEcefCov { - #[allow(clippy::useless_format)] fn message_display(&self) -> String { - format!("") + "".to_string() } } @@ -9075,14 +9042,13 @@ pub mod msg_vel_ecef_cov_gnss { impl FriendlyName for MsgVelEcefCovGnss { fn friendly_name() -> &'static str { - "" + "VEL ECEF COV GNSS-only" } } impl MessageDisplay for MsgVelEcefCovGnss { - #[allow(clippy::useless_format)] fn message_display(&self) -> String { - format!("") + "".to_string() } } @@ -9268,14 +9234,13 @@ pub mod msg_vel_ecef_dep_a { impl FriendlyName for MsgVelEcefDepA { fn friendly_name() -> &'static str { - "" + "VEL ECEF DEP A" } } impl MessageDisplay for MsgVelEcefDepA { - #[allow(clippy::useless_format)] fn message_display(&self) -> String { - format!("") + "".to_string() } } @@ -9422,14 +9387,13 @@ pub mod msg_vel_ecef_gnss { impl FriendlyName for MsgVelEcefGnss { fn friendly_name() -> &'static str { - "" + "VEL ECEF GNSS-only" } } impl MessageDisplay for MsgVelEcefGnss { - #[allow(clippy::useless_format)] fn message_display(&self) -> String { - format!("") + "".to_string() } } @@ -9643,14 +9607,13 @@ pub mod msg_vel_ned { impl FriendlyName for MsgVelNed { fn friendly_name() -> &'static str { - "" + "VEL NED" } } impl MessageDisplay for MsgVelNed { - #[allow(clippy::useless_format)] fn message_display(&self) -> String { - format!("") + "".to_string() } } @@ -9947,14 +9910,13 @@ pub mod msg_vel_ned_cov { impl FriendlyName for MsgVelNedCov { fn friendly_name() -> &'static str { - "" + "VEL NED COV" } } impl MessageDisplay for MsgVelNedCov { - #[allow(clippy::useless_format)] fn message_display(&self) -> String { - format!("") + "".to_string() } } @@ -10239,14 +10201,13 @@ pub mod msg_vel_ned_cov_gnss { impl FriendlyName for MsgVelNedCovGnss { fn friendly_name() -> &'static str { - "" + "VEL NED COV GNSS-only" } } impl MessageDisplay for MsgVelNedCovGnss { - #[allow(clippy::useless_format)] fn message_display(&self) -> String { - format!("") + "".to_string() } } @@ -10436,14 +10397,13 @@ pub mod msg_vel_ned_dep_a { impl FriendlyName for MsgVelNedDepA { fn friendly_name() -> &'static str { - "" + "VEL NED DEP A" } } impl MessageDisplay for MsgVelNedDepA { - #[allow(clippy::useless_format)] fn message_display(&self) -> String { - format!("") + "".to_string() } } @@ -10598,14 +10558,13 @@ pub mod msg_vel_ned_gnss { impl FriendlyName for MsgVelNedGnss { fn friendly_name() -> &'static str { - "" + "VEL NED GNSS-only" } } impl MessageDisplay for MsgVelNedGnss { - #[allow(clippy::useless_format)] fn message_display(&self) -> String { - format!("") + "".to_string() } } diff --git a/rust/sbp/src/messages/ndb.rs b/rust/sbp/src/messages/ndb.rs index 3c112d62bb..765eaf121c 100644 --- a/rust/sbp/src/messages/ndb.rs +++ b/rust/sbp/src/messages/ndb.rs @@ -159,14 +159,13 @@ pub mod msg_ndb_event { impl FriendlyName for MsgNdbEvent { fn friendly_name() -> &'static str { - "" + "NDB EVENT" } } impl MessageDisplay for MsgNdbEvent { - #[allow(clippy::useless_format)] fn message_display(&self) -> String { - format!("") + "".to_string() } } diff --git a/rust/sbp/src/messages/observation.rs b/rust/sbp/src/messages/observation.rs index 94c2dd8e50..c53c93c8ab 100644 --- a/rust/sbp/src/messages/observation.rs +++ b/rust/sbp/src/messages/observation.rs @@ -741,14 +741,13 @@ pub mod msg_almanac_glo { impl FriendlyName for MsgAlmanacGlo { fn friendly_name() -> &'static str { - "" + "ALMANAC GLO" } } impl MessageDisplay for MsgAlmanacGlo { - #[allow(clippy::useless_format)] fn message_display(&self) -> String { - format!("") + "".to_string() } } @@ -880,14 +879,13 @@ pub mod msg_almanac_glo_dep { impl FriendlyName for MsgAlmanacGloDep { fn friendly_name() -> &'static str { - "" + "ALMANAC GLO DEP" } } impl MessageDisplay for MsgAlmanacGloDep { - #[allow(clippy::useless_format)] fn message_display(&self) -> String { - format!("") + "".to_string() } } @@ -1024,14 +1022,13 @@ pub mod msg_almanac_gps { impl FriendlyName for MsgAlmanacGps { fn friendly_name() -> &'static str { - "" + "ALMANAC GPS" } } impl MessageDisplay for MsgAlmanacGps { - #[allow(clippy::useless_format)] fn message_display(&self) -> String { - format!("") + "".to_string() } } @@ -1176,14 +1173,13 @@ pub mod msg_almanac_gps_dep { impl FriendlyName for MsgAlmanacGpsDep { fn friendly_name() -> &'static str { - "" + "ALMANAC GPS DEP" } } impl MessageDisplay for MsgAlmanacGpsDep { - #[allow(clippy::useless_format)] fn message_display(&self) -> String { - format!("") + "".to_string() } } @@ -1308,14 +1304,13 @@ pub mod msg_base_pos_ecef { impl FriendlyName for MsgBasePosEcef { fn friendly_name() -> &'static str { - "" + "BASE POS ECEF" } } impl MessageDisplay for MsgBasePosEcef { - #[allow(clippy::useless_format)] fn message_display(&self) -> String { - format!("") + "".to_string() } } @@ -1409,14 +1404,13 @@ pub mod msg_base_pos_llh { impl FriendlyName for MsgBasePosLlh { fn friendly_name() -> &'static str { - "" + "BASE POS LLH" } } impl MessageDisplay for MsgBasePosLlh { - #[allow(clippy::useless_format)] fn message_display(&self) -> String { - format!("") + "".to_string() } } @@ -1581,14 +1575,13 @@ pub mod msg_ephemeris_bds { impl FriendlyName for MsgEphemerisBds { fn friendly_name() -> &'static str { - "" + "EPH BDS" } } impl MessageDisplay for MsgEphemerisBds { - #[allow(clippy::useless_format)] fn message_display(&self) -> String { - format!("") + "".to_string() } } @@ -1838,14 +1831,13 @@ pub mod msg_ephemeris_dep_a { impl FriendlyName for MsgEphemerisDepA { fn friendly_name() -> &'static str { - "" + "EPH DEP A" } } impl MessageDisplay for MsgEphemerisDepA { - #[allow(clippy::useless_format)] fn message_display(&self) -> String { - format!("") + "".to_string() } } @@ -2106,14 +2098,13 @@ pub mod msg_ephemeris_dep_b { impl FriendlyName for MsgEphemerisDepB { fn friendly_name() -> &'static str { - "" + "EPH DEP B" } } impl MessageDisplay for MsgEphemerisDepB { - #[allow(clippy::useless_format)] fn message_display(&self) -> String { - format!("") + "".to_string() } } @@ -2387,14 +2378,13 @@ pub mod msg_ephemeris_dep_c { impl FriendlyName for MsgEphemerisDepC { fn friendly_name() -> &'static str { - "" + "EPH DEP C" } } impl MessageDisplay for MsgEphemerisDepC { - #[allow(clippy::useless_format)] fn message_display(&self) -> String { - format!("") + "".to_string() } } @@ -2676,14 +2666,13 @@ pub mod msg_ephemeris_dep_d { impl FriendlyName for MsgEphemerisDepD { fn friendly_name() -> &'static str { - "" + "EPH DEP D" } } impl MessageDisplay for MsgEphemerisDepD { - #[allow(clippy::useless_format)] fn message_display(&self) -> String { - format!("") + "".to_string() } } @@ -2953,14 +2942,13 @@ pub mod msg_ephemeris_gal { impl FriendlyName for MsgEphemerisGal { fn friendly_name() -> &'static str { - "" + "EPH GAL" } } impl MessageDisplay for MsgEphemerisGal { - #[allow(clippy::useless_format)] fn message_display(&self) -> String { - format!("") + "".to_string() } } @@ -3209,14 +3197,13 @@ pub mod msg_ephemeris_gal_dep_a { impl FriendlyName for MsgEphemerisGalDepA { fn friendly_name() -> &'static str { - "" + "EPH GAL DEP A" } } impl MessageDisplay for MsgEphemerisGalDepA { - #[allow(clippy::useless_format)] fn message_display(&self) -> String { - format!("") + "".to_string() } } @@ -3414,14 +3401,13 @@ pub mod msg_ephemeris_glo { impl FriendlyName for MsgEphemerisGlo { fn friendly_name() -> &'static str { - "" + "EPH GLO" } } impl MessageDisplay for MsgEphemerisGlo { - #[allow(clippy::useless_format)] fn message_display(&self) -> String { - format!("") + "".to_string() } } @@ -3550,14 +3536,13 @@ pub mod msg_ephemeris_glo_dep_a { impl FriendlyName for MsgEphemerisGloDepA { fn friendly_name() -> &'static str { - "" + "EPH GLO DEP A" } } impl MessageDisplay for MsgEphemerisGloDepA { - #[allow(clippy::useless_format)] fn message_display(&self) -> String { - format!("") + "".to_string() } } @@ -3674,14 +3659,13 @@ pub mod msg_ephemeris_glo_dep_b { impl FriendlyName for MsgEphemerisGloDepB { fn friendly_name() -> &'static str { - "" + "EPH GLO DEP B" } } impl MessageDisplay for MsgEphemerisGloDepB { - #[allow(clippy::useless_format)] fn message_display(&self) -> String { - format!("") + "".to_string() } } @@ -3804,14 +3788,13 @@ pub mod msg_ephemeris_glo_dep_c { impl FriendlyName for MsgEphemerisGloDepC { fn friendly_name() -> &'static str { - "" + "EPH GLO DEP C" } } impl MessageDisplay for MsgEphemerisGloDepC { - #[allow(clippy::useless_format)] fn message_display(&self) -> String { - format!("") + "".to_string() } } @@ -3943,14 +3926,13 @@ pub mod msg_ephemeris_glo_dep_d { impl FriendlyName for MsgEphemerisGloDepD { fn friendly_name() -> &'static str { - "" + "EPH GLO DEP D" } } impl MessageDisplay for MsgEphemerisGloDepD { - #[allow(clippy::useless_format)] fn message_display(&self) -> String { - format!("") + "".to_string() } } @@ -4134,14 +4116,13 @@ pub mod msg_ephemeris_gps { impl FriendlyName for MsgEphemerisGps { fn friendly_name() -> &'static str { - "" + "EPH GPS" } } impl MessageDisplay for MsgEphemerisGps { - #[allow(clippy::useless_format)] fn message_display(&self) -> String { - format!("") + "".to_string() } } @@ -4381,14 +4362,13 @@ pub mod msg_ephemeris_gps_dep_e { impl FriendlyName for MsgEphemerisGpsDepE { fn friendly_name() -> &'static str { - "" + "EPH GPS DEP E" } } impl MessageDisplay for MsgEphemerisGpsDepE { - #[allow(clippy::useless_format)] fn message_display(&self) -> String { - format!("") + "".to_string() } } @@ -4626,14 +4606,13 @@ pub mod msg_ephemeris_gps_dep_f { impl FriendlyName for MsgEphemerisGpsDepF { fn friendly_name() -> &'static str { - "" + "EPH GPS DEP F" } } impl MessageDisplay for MsgEphemerisGpsDepF { - #[allow(clippy::useless_format)] fn message_display(&self) -> String { - format!("") + "".to_string() } } @@ -4871,14 +4850,13 @@ pub mod msg_ephemeris_qzss { impl FriendlyName for MsgEphemerisQzss { fn friendly_name() -> &'static str { - "" + "EPH QZSS" } } impl MessageDisplay for MsgEphemerisQzss { - #[allow(clippy::useless_format)] fn message_display(&self) -> String { - format!("") + "".to_string() } } @@ -5056,14 +5034,13 @@ pub mod msg_ephemeris_sbas { impl FriendlyName for MsgEphemerisSbas { fn friendly_name() -> &'static str { - "" + "EPH SBAS" } } impl MessageDisplay for MsgEphemerisSbas { - #[allow(clippy::useless_format)] fn message_display(&self) -> String { - format!("") + "".to_string() } } @@ -5173,14 +5150,13 @@ pub mod msg_ephemeris_sbas_dep_a { impl FriendlyName for MsgEphemerisSbasDepA { fn friendly_name() -> &'static str { - "" + "EPH SBAS DEP A" } } impl MessageDisplay for MsgEphemerisSbasDepA { - #[allow(clippy::useless_format)] fn message_display(&self) -> String { - format!("") + "".to_string() } } @@ -5295,14 +5271,13 @@ pub mod msg_ephemeris_sbas_dep_b { impl FriendlyName for MsgEphemerisSbasDepB { fn friendly_name() -> &'static str { - "" + "EPH SBAS DEP B" } } impl MessageDisplay for MsgEphemerisSbasDepB { - #[allow(clippy::useless_format)] fn message_display(&self) -> String { - format!("") + "".to_string() } } @@ -5415,14 +5390,13 @@ pub mod msg_glo_biases { impl FriendlyName for MsgGloBiases { fn friendly_name() -> &'static str { - "" + "GLO BIASES" } } impl MessageDisplay for MsgGloBiases { - #[allow(clippy::useless_format)] fn message_display(&self) -> String { - format!("") + "".to_string() } } @@ -5516,14 +5490,13 @@ pub mod msg_gnss_capb { impl FriendlyName for MsgGnssCapb { fn friendly_name() -> &'static str { - "" + "GNSS CAPB" } } impl MessageDisplay for MsgGnssCapb { - #[allow(clippy::useless_format)] fn message_display(&self) -> String { - format!("") + "".to_string() } } @@ -5618,14 +5591,13 @@ pub mod msg_group_delay { impl FriendlyName for MsgGroupDelay { fn friendly_name() -> &'static str { - "" + "GROUP DELAY" } } impl MessageDisplay for MsgGroupDelay { - #[allow(clippy::useless_format)] fn message_display(&self) -> String { - format!("") + "".to_string() } } @@ -5737,14 +5709,13 @@ pub mod msg_group_delay_dep_a { impl FriendlyName for MsgGroupDelayDepA { fn friendly_name() -> &'static str { - "" + "GROUP DELAY DEP A" } } impl MessageDisplay for MsgGroupDelayDepA { - #[allow(clippy::useless_format)] fn message_display(&self) -> String { - format!("") + "".to_string() } } @@ -5856,14 +5827,13 @@ pub mod msg_group_delay_dep_b { impl FriendlyName for MsgGroupDelayDepB { fn friendly_name() -> &'static str { - "" + "GROUP DELAY DEP B" } } impl MessageDisplay for MsgGroupDelayDepB { - #[allow(clippy::useless_format)] fn message_display(&self) -> String { - format!("") + "".to_string() } } @@ -5980,14 +5950,13 @@ pub mod msg_iono { impl FriendlyName for MsgIono { fn friendly_name() -> &'static str { - "" + "IONO" } } impl MessageDisplay for MsgIono { - #[allow(clippy::useless_format)] fn message_display(&self) -> String { - format!("") + "".to_string() } } @@ -6119,14 +6088,13 @@ pub mod msg_obs { impl FriendlyName for MsgObs { fn friendly_name() -> &'static str { - "" + "OBS" } } impl MessageDisplay for MsgObs { - #[allow(clippy::useless_format)] fn message_display(&self) -> String { - format!("") + "".to_string() } } @@ -6224,14 +6192,13 @@ pub mod msg_obs_dep_a { impl FriendlyName for MsgObsDepA { fn friendly_name() -> &'static str { - "" + "OBS DEP A" } } impl MessageDisplay for MsgObsDepA { - #[allow(clippy::useless_format)] fn message_display(&self) -> String { - format!("") + "".to_string() } } @@ -6332,14 +6299,13 @@ pub mod msg_obs_dep_b { impl FriendlyName for MsgObsDepB { fn friendly_name() -> &'static str { - "" + "OBS DEP B" } } impl MessageDisplay for MsgObsDepB { - #[allow(clippy::useless_format)] fn message_display(&self) -> String { - format!("") + "".to_string() } } @@ -6442,14 +6408,13 @@ pub mod msg_obs_dep_c { impl FriendlyName for MsgObsDepC { fn friendly_name() -> &'static str { - "" + "OBS DEP C" } } impl MessageDisplay for MsgObsDepC { - #[allow(clippy::useless_format)] fn message_display(&self) -> String { - format!("") + "".to_string() } } @@ -6548,14 +6513,13 @@ pub mod msg_osr { impl FriendlyName for MsgOsr { fn friendly_name() -> &'static str { - "" + "OSR" } } impl MessageDisplay for MsgOsr { - #[allow(clippy::useless_format)] fn message_display(&self) -> String { - format!("") + "".to_string() } } @@ -6638,14 +6602,13 @@ pub mod msg_sv_az_el { impl FriendlyName for MsgSvAzEl { fn friendly_name() -> &'static str { - "" + "SV AZ EL" } } impl MessageDisplay for MsgSvAzEl { - #[allow(clippy::useless_format)] fn message_display(&self) -> String { - format!("") + "".to_string() } } @@ -6727,14 +6690,13 @@ pub mod msg_sv_configuration_gps_dep { impl FriendlyName for MsgSvConfigurationGpsDep { fn friendly_name() -> &'static str { - "" + "SV CONFIGURATION GPS DEP" } } impl MessageDisplay for MsgSvConfigurationGpsDep { - #[allow(clippy::useless_format)] fn message_display(&self) -> String { - format!("") + "".to_string() } } diff --git a/rust/sbp/src/messages/orientation.rs b/rust/sbp/src/messages/orientation.rs index 29b07d2cfd..4f3ac0af9a 100644 --- a/rust/sbp/src/messages/orientation.rs +++ b/rust/sbp/src/messages/orientation.rs @@ -120,14 +120,13 @@ pub mod msg_angular_rate { impl FriendlyName for MsgAngularRate { fn friendly_name() -> &'static str { - "" + "ANGULAR RATE" } } impl MessageDisplay for MsgAngularRate { - #[allow(clippy::useless_format)] fn message_display(&self) -> String { - format!("") + "".to_string() } } @@ -289,14 +288,13 @@ pub mod msg_baseline_heading { impl FriendlyName for MsgBaselineHeading { fn friendly_name() -> &'static str { - "" + "BASELINE HEADING" } } impl MessageDisplay for MsgBaselineHeading { - #[allow(clippy::useless_format)] fn message_display(&self) -> String { - format!("") + "".to_string() } } @@ -477,14 +475,13 @@ pub mod msg_orient_euler { impl FriendlyName for MsgOrientEuler { fn friendly_name() -> &'static str { - "" + "ORIENT EULER" } } impl MessageDisplay for MsgOrientEuler { - #[allow(clippy::useless_format)] fn message_display(&self) -> String { - format!("") + "".to_string() } } @@ -677,14 +674,13 @@ pub mod msg_orient_quat { impl FriendlyName for MsgOrientQuat { fn friendly_name() -> &'static str { - "" + "ORIENT QUAT" } } impl MessageDisplay for MsgOrientQuat { - #[allow(clippy::useless_format)] fn message_display(&self) -> String { - format!("") + "".to_string() } } diff --git a/rust/sbp/src/messages/piksi.rs b/rust/sbp/src/messages/piksi.rs index fa6628c823..f4d91d65f6 100644 --- a/rust/sbp/src/messages/piksi.rs +++ b/rust/sbp/src/messages/piksi.rs @@ -161,14 +161,13 @@ pub mod msg_almanac { impl FriendlyName for MsgAlmanac { fn friendly_name() -> &'static str { - "" + "ALMANAC" } } impl MessageDisplay for MsgAlmanac { - #[allow(clippy::useless_format)] fn message_display(&self) -> String { - format!("") + "".to_string() } } @@ -250,14 +249,13 @@ pub mod msg_cell_modem_status { impl FriendlyName for MsgCellModemStatus { fn friendly_name() -> &'static str { - "" + "CELL MODEM STATUS" } } impl MessageDisplay for MsgCellModemStatus { - #[allow(clippy::useless_format)] fn message_display(&self) -> String { - format!("") + "".to_string() } } @@ -349,14 +347,13 @@ pub mod msg_command_output { impl FriendlyName for MsgCommandOutput { fn friendly_name() -> &'static str { - "" + "COMMAND OUTPUT" } } impl MessageDisplay for MsgCommandOutput { - #[allow(clippy::useless_format)] fn message_display(&self) -> String { - format!("") + "".to_string() } } @@ -443,14 +440,13 @@ pub mod msg_command_req { impl FriendlyName for MsgCommandReq { fn friendly_name() -> &'static str { - "" + "COMMAND REQ" } } impl MessageDisplay for MsgCommandReq { - #[allow(clippy::useless_format)] fn message_display(&self) -> String { - format!("") + "".to_string() } } @@ -536,14 +532,13 @@ pub mod msg_command_resp { impl FriendlyName for MsgCommandResp { fn friendly_name() -> &'static str { - "" + "COMMAND RESP" } } impl MessageDisplay for MsgCommandResp { - #[allow(clippy::useless_format)] fn message_display(&self) -> String { - format!("") + "".to_string() } } @@ -623,14 +618,13 @@ pub mod msg_cw_results { impl FriendlyName for MsgCwResults { fn friendly_name() -> &'static str { - "" + "CW RESULTS" } } impl MessageDisplay for MsgCwResults { - #[allow(clippy::useless_format)] fn message_display(&self) -> String { - format!("") + "".to_string() } } @@ -703,14 +697,13 @@ pub mod msg_cw_start { impl FriendlyName for MsgCwStart { fn friendly_name() -> &'static str { - "" + "CW START" } } impl MessageDisplay for MsgCwStart { - #[allow(clippy::useless_format)] fn message_display(&self) -> String { - format!("") + "".to_string() } } @@ -798,14 +791,13 @@ pub mod msg_device_monitor { impl FriendlyName for MsgDeviceMonitor { fn friendly_name() -> &'static str { - "" + "DEVICE MONITOR" } } impl MessageDisplay for MsgDeviceMonitor { - #[allow(clippy::useless_format)] fn message_display(&self) -> String { - format!("") + "".to_string() } } @@ -909,14 +901,13 @@ pub mod msg_front_end_gain { impl FriendlyName for MsgFrontEndGain { fn friendly_name() -> &'static str { - "" + "FRONT END GAIN" } } impl MessageDisplay for MsgFrontEndGain { - #[allow(clippy::useless_format)] fn message_display(&self) -> String { - format!("") + "".to_string() } } @@ -999,14 +990,13 @@ pub mod msg_iar_state { impl FriendlyName for MsgIarState { fn friendly_name() -> &'static str { - "" + "IAR STATE" } } impl MessageDisplay for MsgIarState { - #[allow(clippy::useless_format)] fn message_display(&self) -> String { - format!("") + "".to_string() } } @@ -1082,14 +1072,13 @@ pub mod msg_init_base_dep { impl FriendlyName for MsgInitBaseDep { fn friendly_name() -> &'static str { - "" + "INIT BASE DEP" } } impl MessageDisplay for MsgInitBaseDep { - #[allow(clippy::useless_format)] fn message_display(&self) -> String { - format!("") + "".to_string() } } @@ -1197,14 +1186,13 @@ pub mod msg_mask_satellite { impl FriendlyName for MsgMaskSatellite { fn friendly_name() -> &'static str { - "" + "MASK SATELLITE" } } impl MessageDisplay for MsgMaskSatellite { - #[allow(clippy::useless_format)] fn message_display(&self) -> String { - format!("") + "".to_string() } } @@ -1382,14 +1370,13 @@ pub mod msg_mask_satellite_dep { impl FriendlyName for MsgMaskSatelliteDep { fn friendly_name() -> &'static str { - "" + "MASK SATELLITE DEP" } } impl MessageDisplay for MsgMaskSatelliteDep { - #[allow(clippy::useless_format)] fn message_display(&self) -> String { - format!("") + "".to_string() } } @@ -1534,14 +1521,13 @@ pub mod msg_network_bandwidth_usage { impl FriendlyName for MsgNetworkBandwidthUsage { fn friendly_name() -> &'static str { - "" + "NET BANDWIDTH USAGE" } } impl MessageDisplay for MsgNetworkBandwidthUsage { - #[allow(clippy::useless_format)] fn message_display(&self) -> String { - format!("") + "".to_string() } } @@ -1618,14 +1604,13 @@ pub mod msg_network_state_req { impl FriendlyName for MsgNetworkStateReq { fn friendly_name() -> &'static str { - "" + "NET STATE REQ" } } impl MessageDisplay for MsgNetworkStateReq { - #[allow(clippy::useless_format)] fn message_display(&self) -> String { - format!("") + "".to_string() } } @@ -1941,14 +1926,13 @@ pub mod msg_network_state_resp { impl FriendlyName for MsgNetworkStateResp { fn friendly_name() -> &'static str { - "" + "NET STATE RESP" } } impl MessageDisplay for MsgNetworkStateResp { - #[allow(clippy::useless_format)] fn message_display(&self) -> String { - format!("") + "".to_string() } } @@ -2071,14 +2055,13 @@ pub mod msg_reset { impl FriendlyName for MsgReset { fn friendly_name() -> &'static str { - "" + "RESET" } } impl MessageDisplay for MsgReset { - #[allow(clippy::useless_format)] fn message_display(&self) -> String { - format!("") + "".to_string() } } @@ -2186,14 +2169,13 @@ pub mod msg_reset_dep { impl FriendlyName for MsgResetDep { fn friendly_name() -> &'static str { - "" + "RESET DEP" } } impl MessageDisplay for MsgResetDep { - #[allow(clippy::useless_format)] fn message_display(&self) -> String { - format!("") + "".to_string() } } @@ -2287,14 +2269,13 @@ pub mod msg_reset_filters { impl FriendlyName for MsgResetFilters { fn friendly_name() -> &'static str { - "" + "RESET FILTERS" } } impl MessageDisplay for MsgResetFilters { - #[allow(clippy::useless_format)] fn message_display(&self) -> String { - format!("") + "".to_string() } } @@ -2406,14 +2387,13 @@ pub mod msg_set_time { impl FriendlyName for MsgSetTime { fn friendly_name() -> &'static str { - "" + "SET TIME" } } impl MessageDisplay for MsgSetTime { - #[allow(clippy::useless_format)] fn message_display(&self) -> String { - format!("") + "".to_string() } } @@ -2505,14 +2485,13 @@ pub mod msg_specan { impl FriendlyName for MsgSpecan { fn friendly_name() -> &'static str { - "" + "SPECTRUM ANALYZER" } } impl MessageDisplay for MsgSpecan { - #[allow(clippy::useless_format)] fn message_display(&self) -> String { - format!("") + "".to_string() } } @@ -2633,14 +2612,13 @@ pub mod msg_specan_dep { impl FriendlyName for MsgSpecanDep { fn friendly_name() -> &'static str { - "" + "SPECAN DEP" } } impl MessageDisplay for MsgSpecanDep { - #[allow(clippy::useless_format)] fn message_display(&self) -> String { - format!("") + "".to_string() } } @@ -2752,14 +2730,13 @@ pub mod msg_thread_state { impl FriendlyName for MsgThreadState { fn friendly_name() -> &'static str { - "" + "THREAD STATE" } } impl MessageDisplay for MsgThreadState { - #[allow(clippy::useless_format)] fn message_display(&self) -> String { - format!("") + "".to_string() } } @@ -2865,14 +2842,13 @@ pub mod msg_uart_state { impl FriendlyName for MsgUartState { fn friendly_name() -> &'static str { - "" + "UART STATE" } } impl MessageDisplay for MsgUartState { - #[allow(clippy::useless_format)] fn message_display(&self) -> String { - format!("") + "".to_string() } } @@ -2976,14 +2952,13 @@ pub mod msg_uart_state_depa { impl FriendlyName for MsgUartStateDepa { fn friendly_name() -> &'static str { - "" + "UART STATE DEPA" } } impl MessageDisplay for MsgUartStateDepa { - #[allow(clippy::useless_format)] fn message_display(&self) -> String { - format!("") + "".to_string() } } diff --git a/rust/sbp/src/messages/sbas.rs b/rust/sbp/src/messages/sbas.rs index 858ae56663..1e4fd65e48 100644 --- a/rust/sbp/src/messages/sbas.rs +++ b/rust/sbp/src/messages/sbas.rs @@ -92,14 +92,13 @@ pub mod msg_sbas_raw { impl FriendlyName for MsgSbasRaw { fn friendly_name() -> &'static str { - "" + "SBAS RAW" } } impl MessageDisplay for MsgSbasRaw { - #[allow(clippy::useless_format)] fn message_display(&self) -> String { - format!("") + "".to_string() } } diff --git a/rust/sbp/src/messages/settings.rs b/rust/sbp/src/messages/settings.rs index 9c6a8aadf8..eb587c8af3 100644 --- a/rust/sbp/src/messages/settings.rs +++ b/rust/sbp/src/messages/settings.rs @@ -103,14 +103,13 @@ pub mod msg_settings_read_by_index_done { impl FriendlyName for MsgSettingsReadByIndexDone { fn friendly_name() -> &'static str { - "" + "SETTINGS READ BY IDX DONE" } } impl MessageDisplay for MsgSettingsReadByIndexDone { - #[allow(clippy::useless_format)] fn message_display(&self) -> String { - format!("") + "".to_string() } } @@ -185,14 +184,13 @@ pub mod msg_settings_read_by_index_req { impl FriendlyName for MsgSettingsReadByIndexReq { fn friendly_name() -> &'static str { - "" + "SETTINGS READ BY IDX REQ" } } impl MessageDisplay for MsgSettingsReadByIndexReq { - #[allow(clippy::useless_format)] fn message_display(&self) -> String { - format!("") + "".to_string() } } @@ -284,14 +282,13 @@ pub mod msg_settings_read_by_index_resp { impl FriendlyName for MsgSettingsReadByIndexResp { fn friendly_name() -> &'static str { - "" + "SETTINGS READ BY IDX RESP" } } impl MessageDisplay for MsgSettingsReadByIndexResp { - #[allow(clippy::useless_format)] fn message_display(&self) -> String { - format!("") + "".to_string() } } @@ -380,14 +377,13 @@ pub mod msg_settings_read_req { impl FriendlyName for MsgSettingsReadReq { fn friendly_name() -> &'static str { - "" + "SETTINGS READ REQ" } } impl MessageDisplay for MsgSettingsReadReq { - #[allow(clippy::useless_format)] fn message_display(&self) -> String { - format!("") + "".to_string() } } @@ -471,14 +467,13 @@ pub mod msg_settings_read_resp { impl FriendlyName for MsgSettingsReadResp { fn friendly_name() -> &'static str { - "" + "SETTINGS READ RESP" } } impl MessageDisplay for MsgSettingsReadResp { - #[allow(clippy::useless_format)] fn message_display(&self) -> String { - format!("") + "".to_string() } } @@ -559,14 +554,13 @@ pub mod msg_settings_register { impl FriendlyName for MsgSettingsRegister { fn friendly_name() -> &'static str { - "" + "SETTINGS REGISTER" } } impl MessageDisplay for MsgSettingsRegister { - #[allow(clippy::useless_format)] fn message_display(&self) -> String { - format!("") + "".to_string() } } @@ -668,14 +662,13 @@ pub mod msg_settings_register_resp { impl FriendlyName for MsgSettingsRegisterResp { fn friendly_name() -> &'static str { - "" + "SETTINGS REGISTER RESP" } } impl MessageDisplay for MsgSettingsRegisterResp { - #[allow(clippy::useless_format)] fn message_display(&self) -> String { - format!("") + "".to_string() } } @@ -806,14 +799,13 @@ pub mod msg_settings_save { impl FriendlyName for MsgSettingsSave { fn friendly_name() -> &'static str { - "" + "SETTINGS SAVE" } } impl MessageDisplay for MsgSettingsSave { - #[allow(clippy::useless_format)] fn message_display(&self) -> String { - format!("") + "".to_string() } } @@ -893,14 +885,13 @@ pub mod msg_settings_write { impl FriendlyName for MsgSettingsWrite { fn friendly_name() -> &'static str { - "" + "SETTINGS WRITE" } } impl MessageDisplay for MsgSettingsWrite { - #[allow(clippy::useless_format)] fn message_display(&self) -> String { - format!("") + "".to_string() } } @@ -1004,14 +995,13 @@ pub mod msg_settings_write_resp { impl FriendlyName for MsgSettingsWriteResp { fn friendly_name() -> &'static str { - "" + "SETTINGS WRITE RESP" } } impl MessageDisplay for MsgSettingsWriteResp { - #[allow(clippy::useless_format)] fn message_display(&self) -> String { - format!("") + "".to_string() } } diff --git a/rust/sbp/src/messages/signing.rs b/rust/sbp/src/messages/signing.rs index d73d9d5b66..cb4939ba3d 100644 --- a/rust/sbp/src/messages/signing.rs +++ b/rust/sbp/src/messages/signing.rs @@ -79,14 +79,13 @@ pub mod msg_ed25519_certificate { impl FriendlyName for MsgEd25519Certificate { fn friendly_name() -> &'static str { - "" + "ED25519 CERTIFICATE" } } impl MessageDisplay for MsgEd25519Certificate { - #[allow(clippy::useless_format)] fn message_display(&self) -> String { - format!("") + "".to_string() } } @@ -188,14 +187,13 @@ pub mod msg_ed25519_signature { impl FriendlyName for MsgEd25519Signature { fn friendly_name() -> &'static str { - "" + "ED25519 SIGNATURE" } } impl MessageDisplay for MsgEd25519Signature { - #[allow(clippy::useless_format)] fn message_display(&self) -> String { - format!("") + "".to_string() } } @@ -292,14 +290,13 @@ pub mod msg_ed25519_signature_dep { impl FriendlyName for MsgEd25519SignatureDep { fn friendly_name() -> &'static str { - "" + "ED25519 SIGNATURE DEP" } } impl MessageDisplay for MsgEd25519SignatureDep { - #[allow(clippy::useless_format)] fn message_display(&self) -> String { - format!("") + "".to_string() } } diff --git a/rust/sbp/src/messages/solution_meta.rs b/rust/sbp/src/messages/solution_meta.rs index c8ed223577..732dcc654e 100644 --- a/rust/sbp/src/messages/solution_meta.rs +++ b/rust/sbp/src/messages/solution_meta.rs @@ -444,14 +444,13 @@ pub mod msg_soln_meta { impl FriendlyName for MsgSolnMeta { fn friendly_name() -> &'static str { - "" + "SOLN META" } } impl MessageDisplay for MsgSolnMeta { - #[allow(clippy::useless_format)] fn message_display(&self) -> String { - format!("") + "".to_string() } } @@ -639,14 +638,13 @@ pub mod msg_soln_meta_dep_a { impl FriendlyName for MsgSolnMetaDepA { fn friendly_name() -> &'static str { - "" + "SOLN META DEP A" } } impl MessageDisplay for MsgSolnMetaDepA { - #[allow(clippy::useless_format)] fn message_display(&self) -> String { - format!("") + "".to_string() } } diff --git a/rust/sbp/src/messages/ssr.rs b/rust/sbp/src/messages/ssr.rs index cbff24573a..4118f6f348 100644 --- a/rust/sbp/src/messages/ssr.rs +++ b/rust/sbp/src/messages/ssr.rs @@ -532,14 +532,13 @@ pub mod msg_ssr_code_biases { impl FriendlyName for MsgSsrCodeBiases { fn friendly_name() -> &'static str { - "" + "SSR CODE BIASES" } } impl MessageDisplay for MsgSsrCodeBiases { - #[allow(clippy::useless_format)] fn message_display(&self) -> String { - format!("") + "".to_string() } } @@ -642,14 +641,13 @@ pub mod msg_ssr_code_phase_biases_bounds { impl FriendlyName for MsgSsrCodePhaseBiasesBounds { fn friendly_name() -> &'static str { - "" + "SSR CODE PHASE BIASES BOUNDS" } } impl MessageDisplay for MsgSsrCodePhaseBiasesBounds { - #[allow(clippy::useless_format)] fn message_display(&self) -> String { - format!("") + "".to_string() } } @@ -755,14 +753,13 @@ pub mod msg_ssr_gridded_correction { impl FriendlyName for MsgSsrGriddedCorrection { fn friendly_name() -> &'static str { - "" + "SSR GRIDDED CORRECTION" } } impl MessageDisplay for MsgSsrGriddedCorrection { - #[allow(clippy::useless_format)] fn message_display(&self) -> String { - format!("") + "".to_string() } } @@ -891,14 +888,13 @@ pub mod msg_ssr_gridded_correction_bounds { impl FriendlyName for MsgSsrGriddedCorrectionBounds { fn friendly_name() -> &'static str { - "" + "SSR GRIDDED CORRECTION BOUNDS" } } impl MessageDisplay for MsgSsrGriddedCorrectionBounds { - #[allow(clippy::useless_format)] fn message_display(&self) -> String { - format!("") + "".to_string() } } @@ -1030,14 +1026,13 @@ pub mod msg_ssr_gridded_correction_dep_a { impl FriendlyName for MsgSsrGriddedCorrectionDepA { fn friendly_name() -> &'static str { - "" + "SSR GRIDDED CORRECTION DEP A" } } impl MessageDisplay for MsgSsrGriddedCorrectionDepA { - #[allow(clippy::useless_format)] fn message_display(&self) -> String { - format!("") + "".to_string() } } @@ -1133,14 +1128,13 @@ pub mod msg_ssr_gridded_correction_no_std_dep_a { impl FriendlyName for MsgSsrGriddedCorrectionNoStdDepA { fn friendly_name() -> &'static str { - "" + "SSR GRIDDED CORRECTION NO STD DEP A" } } impl MessageDisplay for MsgSsrGriddedCorrectionNoStdDepA { - #[allow(clippy::useless_format)] fn message_display(&self) -> String { - format!("") + "".to_string() } } @@ -1233,14 +1227,13 @@ pub mod msg_ssr_grid_definition_dep_a { impl FriendlyName for MsgSsrGridDefinitionDepA { fn friendly_name() -> &'static str { - "" + "SSR GRID DEFINITION DEP A" } } impl MessageDisplay for MsgSsrGridDefinitionDepA { - #[allow(clippy::useless_format)] fn message_display(&self) -> String { - format!("") + "".to_string() } } @@ -1365,14 +1358,13 @@ pub mod msg_ssr_orbit_clock { impl FriendlyName for MsgSsrOrbitClock { fn friendly_name() -> &'static str { - "" + "SSR ORBIT CLOCK" } } impl MessageDisplay for MsgSsrOrbitClock { - #[allow(clippy::useless_format)] fn message_display(&self) -> String { - format!("") + "".to_string() } } @@ -1519,14 +1511,13 @@ pub mod msg_ssr_orbit_clock_bounds { impl FriendlyName for MsgSsrOrbitClockBounds { fn friendly_name() -> &'static str { - "" + "SSR ORBIT CLOCK BOUNDS" } } impl MessageDisplay for MsgSsrOrbitClockBounds { - #[allow(clippy::useless_format)] fn message_display(&self) -> String { - format!("") + "".to_string() } } @@ -1631,14 +1622,13 @@ pub mod msg_ssr_orbit_clock_bounds_degradation { impl FriendlyName for MsgSsrOrbitClockBoundsDegradation { fn friendly_name() -> &'static str { - "" + "SSR ORBIT CLOCK BOUNDS DEGRADATION" } } impl MessageDisplay for MsgSsrOrbitClockBoundsDegradation { - #[allow(clippy::useless_format)] fn message_display(&self) -> String { - format!("") + "".to_string() } } @@ -1770,14 +1760,13 @@ pub mod msg_ssr_orbit_clock_dep_a { impl FriendlyName for MsgSsrOrbitClockDepA { fn friendly_name() -> &'static str { - "" + "SSR ORBIT CLOCK DEP A" } } impl MessageDisplay for MsgSsrOrbitClockDepA { - #[allow(clippy::useless_format)] fn message_display(&self) -> String { - format!("") + "".to_string() } } @@ -1943,9 +1932,8 @@ pub mod msg_ssr_phase_biases { } impl MessageDisplay for MsgSsrPhaseBiases { - #[allow(clippy::useless_format)] fn message_display(&self) -> String { - format!("") + format!("Msg {{field_X}} of {{field_Y}}",) } } @@ -2052,14 +2040,13 @@ pub mod msg_ssr_satellite_apc { impl FriendlyName for MsgSsrSatelliteApc { fn friendly_name() -> &'static str { - "" + "SSR SATELLITE APC" } } impl MessageDisplay for MsgSsrSatelliteApc { - #[allow(clippy::useless_format)] fn message_display(&self) -> String { - format!("") + "".to_string() } } @@ -2149,14 +2136,13 @@ pub mod msg_ssr_stec_correction { impl FriendlyName for MsgSsrStecCorrection { fn friendly_name() -> &'static str { - "" + "SSR STEC CORRECTION" } } impl MessageDisplay for MsgSsrStecCorrection { - #[allow(clippy::useless_format)] fn message_display(&self) -> String { - format!("") + "".to_string() } } @@ -2263,14 +2249,13 @@ pub mod msg_ssr_stec_correction_dep { impl FriendlyName for MsgSsrStecCorrectionDep { fn friendly_name() -> &'static str { - "" + "SSR STEC CORRECTION DEP" } } impl MessageDisplay for MsgSsrStecCorrectionDep { - #[allow(clippy::useless_format)] fn message_display(&self) -> String { - format!("") + "".to_string() } } @@ -2351,14 +2336,13 @@ pub mod msg_ssr_stec_correction_dep_a { impl FriendlyName for MsgSsrStecCorrectionDepA { fn friendly_name() -> &'static str { - "" + "SSR STEC CORRECTION DEP A" } } impl MessageDisplay for MsgSsrStecCorrectionDepA { - #[allow(clippy::useless_format)] fn message_display(&self) -> String { - format!("") + "".to_string() } } @@ -2511,14 +2495,13 @@ pub mod msg_ssr_tile_definition { impl FriendlyName for MsgSsrTileDefinition { fn friendly_name() -> &'static str { - "" + "SSR TILE DEFINITION" } } impl MessageDisplay for MsgSsrTileDefinition { - #[allow(clippy::useless_format)] fn message_display(&self) -> String { - format!("") + "".to_string() } } @@ -2701,14 +2684,13 @@ pub mod msg_ssr_tile_definition_dep { impl FriendlyName for MsgSsrTileDefinitionDep { fn friendly_name() -> &'static str { - "" + "SSR TILE DEFINITION DEP" } } impl MessageDisplay for MsgSsrTileDefinitionDep { - #[allow(clippy::useless_format)] fn message_display(&self) -> String { - format!("") + "".to_string() } } diff --git a/rust/sbp/src/messages/system.rs b/rust/sbp/src/messages/system.rs index 270d4450f8..3167cad891 100644 --- a/rust/sbp/src/messages/system.rs +++ b/rust/sbp/src/messages/system.rs @@ -92,14 +92,13 @@ pub mod msg_csac_telemetry { impl FriendlyName for MsgCsacTelemetry { fn friendly_name() -> &'static str { - "" + "CSAC TELEMETRY" } } impl MessageDisplay for MsgCsacTelemetry { - #[allow(clippy::useless_format)] fn message_display(&self) -> String { - format!("") + "".to_string() } } @@ -186,14 +185,13 @@ pub mod msg_csac_telemetry_labels { impl FriendlyName for MsgCsacTelemetryLabels { fn friendly_name() -> &'static str { - "" + "CSAC TELEMETRY LABELS" } } impl MessageDisplay for MsgCsacTelemetryLabels { - #[allow(clippy::useless_format)] fn message_display(&self) -> String { - format!("") + "".to_string() } } @@ -301,14 +299,13 @@ pub mod msg_dgnss_status { impl FriendlyName for MsgDgnssStatus { fn friendly_name() -> &'static str { - "" + "DGNSS STATUS" } } impl MessageDisplay for MsgDgnssStatus { - #[allow(clippy::useless_format)] fn message_display(&self) -> String { - format!("") + "".to_string() } } @@ -444,14 +441,13 @@ pub mod msg_gnss_time_offset { impl FriendlyName for MsgGnssTimeOffset { fn friendly_name() -> &'static str { - "" + "GNSS TIME OFFSET" } } impl MessageDisplay for MsgGnssTimeOffset { - #[allow(clippy::useless_format)] fn message_display(&self) -> String { - format!("") + "".to_string() } } @@ -569,14 +565,13 @@ pub mod msg_group_meta { impl FriendlyName for MsgGroupMeta { fn friendly_name() -> &'static str { - "" + "GROUP META" } } impl MessageDisplay for MsgGroupMeta { - #[allow(clippy::useless_format)] fn message_display(&self) -> String { - format!("") + "".to_string() } } @@ -824,14 +819,13 @@ pub mod msg_heartbeat { impl FriendlyName for MsgHeartbeat { fn friendly_name() -> &'static str { - "" + "HEARTBEAT" } } impl MessageDisplay for MsgHeartbeat { - #[allow(clippy::useless_format)] fn message_display(&self) -> String { - format!("") + "".to_string() } } @@ -1166,14 +1160,13 @@ pub mod msg_ins_status { impl FriendlyName for MsgInsStatus { fn friendly_name() -> &'static str { - "" + "INS STATUS" } } impl MessageDisplay for MsgInsStatus { - #[allow(clippy::useless_format)] fn message_display(&self) -> String { - format!("") + "".to_string() } } @@ -1789,14 +1782,13 @@ pub mod msg_ins_updates { impl FriendlyName for MsgInsUpdates { fn friendly_name() -> &'static str { - "" + "INS UPDATES" } } impl MessageDisplay for MsgInsUpdates { - #[allow(clippy::useless_format)] fn message_display(&self) -> String { - format!("") + "".to_string() } } @@ -1938,14 +1930,13 @@ pub mod msg_pps_time { impl FriendlyName for MsgPpsTime { fn friendly_name() -> &'static str { - "" + "PPS TIME" } } impl MessageDisplay for MsgPpsTime { - #[allow(clippy::useless_format)] fn message_display(&self) -> String { - format!("") + "".to_string() } } @@ -2105,14 +2096,13 @@ pub mod msg_sensor_aid_event { impl FriendlyName for MsgSensorAidEvent { fn friendly_name() -> &'static str { - "" + "SENSOR AID EVENT" } } impl MessageDisplay for MsgSensorAidEvent { - #[allow(clippy::useless_format)] fn message_display(&self) -> String { - format!("") + "".to_string() } } @@ -2315,14 +2305,13 @@ pub mod msg_startup { impl FriendlyName for MsgStartup { fn friendly_name() -> &'static str { - "" + "STARTUP" } } impl MessageDisplay for MsgStartup { - #[allow(clippy::useless_format)] fn message_display(&self) -> String { - format!("") + "".to_string() } } @@ -2549,14 +2538,13 @@ pub mod msg_status_journal { impl FriendlyName for MsgStatusJournal { fn friendly_name() -> &'static str { - "" + "STATUS JOURNAL" } } impl MessageDisplay for MsgStatusJournal { - #[allow(clippy::useless_format)] fn message_display(&self) -> String { - format!("") + "".to_string() } } @@ -2755,14 +2743,13 @@ pub mod msg_status_report { impl FriendlyName for MsgStatusReport { fn friendly_name() -> &'static str { - "" + "STATUS REPORT" } } impl MessageDisplay for MsgStatusReport { - #[allow(clippy::useless_format)] fn message_display(&self) -> String { - format!("") + "".to_string() } } diff --git a/rust/sbp/src/messages/tracking.rs b/rust/sbp/src/messages/tracking.rs index 655ff48fad..d9e904d71e 100644 --- a/rust/sbp/src/messages/tracking.rs +++ b/rust/sbp/src/messages/tracking.rs @@ -89,14 +89,13 @@ pub mod msg_measurement_state { impl FriendlyName for MsgMeasurementState { fn friendly_name() -> &'static str { - "" + "MEAS STATE" } } impl MessageDisplay for MsgMeasurementState { - #[allow(clippy::useless_format)] fn message_display(&self) -> String { - format!("") + "".to_string() } } @@ -182,14 +181,13 @@ pub mod msg_tracking_iq { impl FriendlyName for MsgTrackingIq { fn friendly_name() -> &'static str { - "" + "TRK IQ" } } impl MessageDisplay for MsgTrackingIq { - #[allow(clippy::useless_format)] fn message_display(&self) -> String { - format!("") + "".to_string() } } @@ -282,14 +280,13 @@ pub mod msg_tracking_iq_dep_a { impl FriendlyName for MsgTrackingIqDepA { fn friendly_name() -> &'static str { - "" + "TRK IQ DEP A" } } impl MessageDisplay for MsgTrackingIqDepA { - #[allow(clippy::useless_format)] fn message_display(&self) -> String { - format!("") + "".to_string() } } @@ -383,14 +380,13 @@ pub mod msg_tracking_iq_dep_b { impl FriendlyName for MsgTrackingIqDepB { fn friendly_name() -> &'static str { - "" + "TRK IQ DEP B" } } impl MessageDisplay for MsgTrackingIqDepB { - #[allow(clippy::useless_format)] fn message_display(&self) -> String { - format!("") + "".to_string() } } @@ -479,14 +475,13 @@ pub mod msg_tracking_state { impl FriendlyName for MsgTrackingState { fn friendly_name() -> &'static str { - "" + "TRK STATE" } } impl MessageDisplay for MsgTrackingState { - #[allow(clippy::useless_format)] fn message_display(&self) -> String { - format!("") + "".to_string() } } @@ -565,14 +560,13 @@ pub mod msg_tracking_state_dep_a { impl FriendlyName for MsgTrackingStateDepA { fn friendly_name() -> &'static str { - "" + "TRK STATE DEP A" } } impl MessageDisplay for MsgTrackingStateDepA { - #[allow(clippy::useless_format)] fn message_display(&self) -> String { - format!("") + "".to_string() } } @@ -651,14 +645,13 @@ pub mod msg_tracking_state_dep_b { impl FriendlyName for MsgTrackingStateDepB { fn friendly_name() -> &'static str { - "" + "TRK STATE DEP B" } } impl MessageDisplay for MsgTrackingStateDepB { - #[allow(clippy::useless_format)] fn message_display(&self) -> String { - format!("") + "".to_string() } } @@ -1083,14 +1076,13 @@ pub mod msg_tracking_state_detailed_dep { impl FriendlyName for MsgTrackingStateDetailedDep { fn friendly_name() -> &'static str { - "" + "TRK STATE DETAILED DEP" } } impl MessageDisplay for MsgTrackingStateDetailedDep { - #[allow(clippy::useless_format)] fn message_display(&self) -> String { - format!("") + "".to_string() } } @@ -2114,14 +2106,13 @@ pub mod msg_tracking_state_detailed_dep_a { impl FriendlyName for MsgTrackingStateDetailedDepA { fn friendly_name() -> &'static str { - "" + "TRK STATE DETAILED DEP A" } } impl MessageDisplay for MsgTrackingStateDetailedDepA { - #[allow(clippy::useless_format)] fn message_display(&self) -> String { - format!("") + "".to_string() } } diff --git a/rust/sbp/src/messages/user.rs b/rust/sbp/src/messages/user.rs index 8590c817fc..3230c76c6a 100644 --- a/rust/sbp/src/messages/user.rs +++ b/rust/sbp/src/messages/user.rs @@ -73,14 +73,13 @@ pub mod msg_user_data { impl FriendlyName for MsgUserData { fn friendly_name() -> &'static str { - "" + "USER DATA" } } impl MessageDisplay for MsgUserData { - #[allow(clippy::useless_format)] fn message_display(&self) -> String { - format!("") + "".to_string() } } diff --git a/rust/sbp/src/messages/vehicle.rs b/rust/sbp/src/messages/vehicle.rs index 36aac10904..1dbe12d0c5 100644 --- a/rust/sbp/src/messages/vehicle.rs +++ b/rust/sbp/src/messages/vehicle.rs @@ -142,14 +142,13 @@ pub mod msg_odometry { impl FriendlyName for MsgOdometry { fn friendly_name() -> &'static str { - "" + "ODOMETRY" } } impl MessageDisplay for MsgOdometry { - #[allow(clippy::useless_format)] fn message_display(&self) -> String { - format!("") + "".to_string() } } @@ -417,14 +416,13 @@ pub mod msg_wheeltick { impl FriendlyName for MsgWheeltick { fn friendly_name() -> &'static str { - "" + "WHEELTICK" } } impl MessageDisplay for MsgWheeltick { - #[allow(clippy::useless_format)] fn message_display(&self) -> String { - format!("") + "".to_string() } } diff --git a/spec/yaml/swiftnav/sbp/piksi.yaml b/spec/yaml/swiftnav/sbp/piksi.yaml index 454dbb50dd..1b3959e96a 100644 --- a/spec/yaml/swiftnav/sbp/piksi.yaml +++ b/spec/yaml/swiftnav/sbp/piksi.yaml @@ -581,6 +581,7 @@ definitions: - MSG_SPECAN: id: 0x0051 + friendly_name: SPECTRUM ANALYZER short_desc: Spectrum analyzer desc: > Spectrum analyzer packet. diff --git a/spec/yaml/swiftnav/sbp/ssr.yaml b/spec/yaml/swiftnav/sbp/ssr.yaml index 6c71d4c1c6..a419bf405b 100644 --- a/spec/yaml/swiftnav/sbp/ssr.yaml +++ b/spec/yaml/swiftnav/sbp/ssr.yaml @@ -314,7 +314,7 @@ definitions: - MSG_SSR_PHASE_BIASES: id: 0x05E6 - friendly_name: SSR PHASE BIASES + message_display: Msg {{field_X}} of {{field_Y}} short_desc: Precise phase biases correction desc: > The precise phase biases message contains the biases From 7ad35ebbf563fb8ad3388a732caf0d083bad8885 Mon Sep 17 00:00:00 2001 From: adrian-kong Date: Tue, 29 Nov 2022 17:04:35 +1100 Subject: [PATCH 4/7] enrich field parsing --- .../resources/rust/sbp_messages_template.rs | 4 ++-- generator/sbpg/targets/rust.py | 19 +++++++++++++++++-- rust/sbp/src/messages/piksi.rs | 12 +++++++++--- rust/sbp/src/messages/ssr.rs | 2 +- spec/yaml/swiftnav/sbp/piksi.yaml | 3 +++ spec/yaml/swiftnav/sbp/ssr.yaml | 1 - 6 files changed, 32 insertions(+), 9 deletions(-) diff --git a/generator/sbpg/targets/resources/rust/sbp_messages_template.rs b/generator/sbpg/targets/resources/rust/sbp_messages_template.rs index f2380cdc7f..374da5cc13 100644 --- a/generator/sbpg/targets/resources/rust/sbp_messages_template.rs +++ b/generator/sbpg/targets/resources/rust/sbp_messages_template.rs @@ -158,8 +158,8 @@ impl FriendlyName for (((m.msg_name))) { impl MessageDisplay for (((m.msg_name))) { fn message_display(&self) -> String { - ((* if m.message_display_fields *)) - format!("(((m.message_display)))") + ((* if m.enrich_fields *)) + format!("(((m.enrich_display)))", (((m.enrich_fields))) ) ((* else *)) "(((m.message_display)))".to_string() ((* endif *)) diff --git a/generator/sbpg/targets/rust.py b/generator/sbpg/targets/rust.py index 6cd879df5e..2cdac85210 100644 --- a/generator/sbpg/targets/rust.py +++ b/generator/sbpg/targets/rust.py @@ -376,6 +376,20 @@ def __init__(self, msg, package_specs, field): if self.options.get("fields", False): self.bitfield = get_bitfield(self) +# pattern to capture {{groups}} for enriched message display +ENRICH_PAT = re.compile("{{([^}]+)}}[.]*", re.S) +ENRICH_FIELD_PAT = re.compile("@ ([^@]+) @[^\@]*", re.S) + + +# for enriched field display +def extract_self_field(match_obj): + if match_obj is not None and match_obj.group(1) is not None: + return f"self.{match_obj.group(1)}" + + +def map_to_fields(f): + return re.sub(ENRICH_FIELD_PAT, extract_self_field, f) + class MsgItem(object): def __init__(self, msg, package, package_specs): @@ -399,8 +413,9 @@ def __init__(self, msg, package, package_specs): self.message_display = msg.message_display if self.message_display: # match regex, capture all {{field}} enclosed by two brackets - self.message_display_fields = re.findall("{{([^}]+)}}[.]*", self.message_display) - + enrich_fields = re.findall(ENRICH_PAT, self.message_display) + self.enrich_fields = ', '.join(map(map_to_fields, enrich_fields)) + self.enrich_display = re.sub(ENRICH_PAT, "{}", self.message_display) class PackageItem(object): def __init__(self, package, package_specs): diff --git a/rust/sbp/src/messages/piksi.rs b/rust/sbp/src/messages/piksi.rs index f4d91d65f6..5d003ccd4c 100644 --- a/rust/sbp/src/messages/piksi.rs +++ b/rust/sbp/src/messages/piksi.rs @@ -255,7 +255,10 @@ pub mod msg_cell_modem_status { impl MessageDisplay for MsgCellModemStatus { fn message_display(&self) -> String { - "".to_string() + format!( + "{} dBm | {} %", + self.signal_strength, self.signal_error_rate + ) } } @@ -797,7 +800,10 @@ pub mod msg_device_monitor { impl MessageDisplay for MsgDeviceMonitor { fn message_display(&self) -> String { - "".to_string() + format!( + "Vin: {} V | Tcpu: {} C | Trf: {} C", + self.dev_vin, self.cpu_temperature, self.fe_temperature + ) } } @@ -2736,7 +2742,7 @@ pub mod msg_thread_state { impl MessageDisplay for MsgThreadState { fn message_display(&self) -> String { - "".to_string() + format!("{} | {} | {} B", self.name, self.cpu, self.stack_free) } } diff --git a/rust/sbp/src/messages/ssr.rs b/rust/sbp/src/messages/ssr.rs index 4118f6f348..87a0b6b14b 100644 --- a/rust/sbp/src/messages/ssr.rs +++ b/rust/sbp/src/messages/ssr.rs @@ -1933,7 +1933,7 @@ pub mod msg_ssr_phase_biases { impl MessageDisplay for MsgSsrPhaseBiases { fn message_display(&self) -> String { - format!("Msg {{field_X}} of {{field_Y}}",) + "".to_string() } } diff --git a/spec/yaml/swiftnav/sbp/piksi.yaml b/spec/yaml/swiftnav/sbp/piksi.yaml index 1b3959e96a..af34830aee 100644 --- a/spec/yaml/swiftnav/sbp/piksi.yaml +++ b/spec/yaml/swiftnav/sbp/piksi.yaml @@ -104,6 +104,7 @@ definitions: - MSG_THREAD_STATE: id: 0x0017 + message_display: "{{@ name @}} | {{@ cpu @}} | {{@ stack_free @}} B" short_desc: State of an RTOS thread desc: > The thread usage message from the device reports real-time @@ -328,6 +329,7 @@ definitions: - MSG_DEVICE_MONITOR: id: 0x00B5 + message_display: "Vin: {{@ dev_vin @}} V | Tcpu: {{@ cpu_temperature @}} C | Trf: {{@ fe_temperature @}} C" short_desc: Device temperature and voltage levels desc: > This message contains temperature and voltage level measurements from the @@ -521,6 +523,7 @@ definitions: - MSG_CELL_MODEM_STATUS: id: 0x00BE + message_display: "{{@ signal_strength @}} dBm | {{@ signal_error_rate @}} %" short_desc: Cell modem information update message desc: > If a cell modem is present on a piksi device, this message diff --git a/spec/yaml/swiftnav/sbp/ssr.yaml b/spec/yaml/swiftnav/sbp/ssr.yaml index a419bf405b..8e138017cf 100644 --- a/spec/yaml/swiftnav/sbp/ssr.yaml +++ b/spec/yaml/swiftnav/sbp/ssr.yaml @@ -314,7 +314,6 @@ definitions: - MSG_SSR_PHASE_BIASES: id: 0x05E6 - message_display: Msg {{field_X}} of {{field_Y}} short_desc: Precise phase biases correction desc: > The precise phase biases message contains the biases From e33cc2d680b8f60140bdfcbbdabbc15404be1b25 Mon Sep 17 00:00:00 2001 From: adrian-kong Date: Fri, 2 Dec 2022 11:34:18 +1100 Subject: [PATCH 5/7] update regex to @field --- generator/sbpg/targets/rust.py | 9 +++++---- spec/yaml/swiftnav/sbp/piksi.yaml | 6 +++--- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/generator/sbpg/targets/rust.py b/generator/sbpg/targets/rust.py index 2cdac85210..25ac2a28f8 100644 --- a/generator/sbpg/targets/rust.py +++ b/generator/sbpg/targets/rust.py @@ -350,8 +350,8 @@ def get_friendly_name(msg): # replace MSG_ f_name = f_name[4:] - for key in shorten_keyword.keys(): - f_name = f_name.replace(key, shorten_keyword[key]) + for key, item in shorten_keyword.items(): + f_name = f_name.replace(key, item) return f_name @@ -377,8 +377,9 @@ def __init__(self, msg, package_specs, field): self.bitfield = get_bitfield(self) # pattern to capture {{groups}} for enriched message display -ENRICH_PAT = re.compile("{{([^}]+)}}[.]*", re.S) -ENRICH_FIELD_PAT = re.compile("@ ([^@]+) @[^\@]*", re.S) +ENRICH_PAT = re.compile("{{([^}]+)}}") +# pattern to capture @field +ENRICH_FIELD_PAT = re.compile("@([a-zA-Z0-9_]+)") # for enriched field display diff --git a/spec/yaml/swiftnav/sbp/piksi.yaml b/spec/yaml/swiftnav/sbp/piksi.yaml index af34830aee..6c8054bc63 100644 --- a/spec/yaml/swiftnav/sbp/piksi.yaml +++ b/spec/yaml/swiftnav/sbp/piksi.yaml @@ -104,7 +104,7 @@ definitions: - MSG_THREAD_STATE: id: 0x0017 - message_display: "{{@ name @}} | {{@ cpu @}} | {{@ stack_free @}} B" + message_display: "{{@name}} | {{@cpu}} | {{@stack_free}} B" short_desc: State of an RTOS thread desc: > The thread usage message from the device reports real-time @@ -329,7 +329,7 @@ definitions: - MSG_DEVICE_MONITOR: id: 0x00B5 - message_display: "Vin: {{@ dev_vin @}} V | Tcpu: {{@ cpu_temperature @}} C | Trf: {{@ fe_temperature @}} C" + message_display: "Vin: {{@dev_vin}} V | Tcpu: {{@cpu_temperature}} C | Trf: {{@fe_temperature}} C" short_desc: Device temperature and voltage levels desc: > This message contains temperature and voltage level measurements from the @@ -523,7 +523,7 @@ definitions: - MSG_CELL_MODEM_STATUS: id: 0x00BE - message_display: "{{@ signal_strength @}} dBm | {{@ signal_error_rate @}} %" + message_display: "{{@signal_strength}} dBm | {{@signal_error_rate}} %" short_desc: Cell modem information update message desc: > If a cell modem is present on a piksi device, this message From 1fcfcf1df039b2764c8659d064e6b6f51ea0d5ee Mon Sep 17 00:00:00 2001 From: adrian-kong Date: Mon, 5 Dec 2022 11:53:52 +1100 Subject: [PATCH 6/7] using '@' '#' to retrieve self.#.message_display(), additional piksi message_displays --- .../resources/rust/sbp_messages_template.rs | 2 +- generator/sbpg/targets/rust.py | 22 +- rust/sbp/src/messages/acquisition.rs | 24 ++ rust/sbp/src/messages/gnss.rs | 84 +++++++ rust/sbp/src/messages/integrity.rs | 12 + rust/sbp/src/messages/navigation.rs | 12 + rust/sbp/src/messages/observation.rs | 192 ++++++++++++++++ rust/sbp/src/messages/piksi.rs | 77 ++++++- rust/sbp/src/messages/solution_meta.rs | 48 ++++ rust/sbp/src/messages/ssr.rs | 216 ++++++++++++++++++ rust/sbp/src/messages/system.rs | 24 ++ rust/sbp/src/messages/tracking.rs | 72 ++++++ spec/yaml/swiftnav/sbp/piksi.yaml | 10 +- 13 files changed, 778 insertions(+), 17 deletions(-) diff --git a/generator/sbpg/targets/resources/rust/sbp_messages_template.rs b/generator/sbpg/targets/resources/rust/sbp_messages_template.rs index 374da5cc13..37742185d8 100644 --- a/generator/sbpg/targets/resources/rust/sbp_messages_template.rs +++ b/generator/sbpg/targets/resources/rust/sbp_messages_template.rs @@ -149,6 +149,7 @@ impl TryFrom for (((m.msg_name))) { } } } +((* endif *)) impl FriendlyName for (((m.msg_name))) { fn friendly_name() -> &'static str { @@ -165,7 +166,6 @@ impl MessageDisplay for (((m.msg_name))) { ((* endif *)) } } -((* endif *)) impl WireFormat for (((m.msg_name))) { const MIN_LEN: usize = diff --git a/generator/sbpg/targets/rust.py b/generator/sbpg/targets/rust.py index 25ac2a28f8..e3f2eb9f40 100644 --- a/generator/sbpg/targets/rust.py +++ b/generator/sbpg/targets/rust.py @@ -348,7 +348,8 @@ def get_friendly_name(msg): f_name = f_name[:-5] + " GNSS-only" # replace MSG_ - f_name = f_name[4:] + if f_name.startswith("MSG_"): + f_name = f_name[4:] for key, item in shorten_keyword.items(): f_name = f_name.replace(key, item) @@ -377,19 +378,22 @@ def __init__(self, msg, package_specs, field): self.bitfield = get_bitfield(self) # pattern to capture {{groups}} for enriched message display -ENRICH_PAT = re.compile("{{([^}]+)}}") -# pattern to capture @field -ENRICH_FIELD_PAT = re.compile("@([a-zA-Z0-9_]+)") - +# optional {{group}:1} to denote format!("{:1}", field) roundings +ENRICH_PAT = re.compile("{{([^}]+)}(:\\d+)?}") +# pattern to capture field to represent self.@field or self.#field.message_display() +ENRICH_FIELD_PAT = re.compile("([@#]\\w+)") # for enriched field display def extract_self_field(match_obj): - if match_obj is not None and match_obj.group(1) is not None: - return f"self.{match_obj.group(1)}" + match = match_obj.group() + assert match[0] == '#' or match[0] == '@' + if match[0] == '#': + return f"self.{match[1:]}.message_display()" + return f"self.{match[1:]}" def map_to_fields(f): - return re.sub(ENRICH_FIELD_PAT, extract_self_field, f) + return re.sub(ENRICH_FIELD_PAT, extract_self_field, f[0]) class MsgItem(object): @@ -416,7 +420,7 @@ def __init__(self, msg, package, package_specs): # match regex, capture all {{field}} enclosed by two brackets enrich_fields = re.findall(ENRICH_PAT, self.message_display) self.enrich_fields = ', '.join(map(map_to_fields, enrich_fields)) - self.enrich_display = re.sub(ENRICH_PAT, "{}", self.message_display) + self.enrich_display = re.sub(ENRICH_PAT, "{\\2}", self.message_display) class PackageItem(object): def __init__(self, package, package_specs): diff --git a/rust/sbp/src/messages/acquisition.rs b/rust/sbp/src/messages/acquisition.rs index a89ed3a1b0..67958be1a8 100644 --- a/rust/sbp/src/messages/acquisition.rs +++ b/rust/sbp/src/messages/acquisition.rs @@ -77,6 +77,18 @@ pub mod acq_sv_profile { pub cp: u32, } + impl FriendlyName for AcqSvProfile { + fn friendly_name() -> &'static str { + "AcqSvProfile" + } + } + + impl MessageDisplay for AcqSvProfile { + fn message_display(&self) -> String { + "".to_string() + } + } + impl WireFormat for AcqSvProfile { const MIN_LEN: usize = ::MIN_LEN + ::MIN_LEN @@ -190,6 +202,18 @@ pub mod acq_sv_profile_dep { pub cp: u32, } + impl FriendlyName for AcqSvProfileDep { + fn friendly_name() -> &'static str { + "AcqSvProfileDep" + } + } + + impl MessageDisplay for AcqSvProfileDep { + fn message_display(&self) -> String { + "".to_string() + } + } + impl WireFormat for AcqSvProfileDep { const MIN_LEN: usize = ::MIN_LEN + ::MIN_LEN diff --git a/rust/sbp/src/messages/gnss.rs b/rust/sbp/src/messages/gnss.rs index b82f9ab2cb..ba293e8003 100644 --- a/rust/sbp/src/messages/gnss.rs +++ b/rust/sbp/src/messages/gnss.rs @@ -45,6 +45,18 @@ pub mod carrier_phase { pub f: u8, } + impl FriendlyName for CarrierPhase { + fn friendly_name() -> &'static str { + "CarrierPhase" + } + } + + impl MessageDisplay for CarrierPhase { + fn message_display(&self) -> String { + "".to_string() + } + } + impl WireFormat for CarrierPhase { const MIN_LEN: usize = ::MIN_LEN + ::MIN_LEN; fn len(&self) -> usize { @@ -91,6 +103,18 @@ pub mod gps_time { pub wn: u16, } + impl FriendlyName for GpsTime { + fn friendly_name() -> &'static str { + "GPSTime" + } + } + + impl MessageDisplay for GpsTime { + fn message_display(&self) -> String { + "".to_string() + } + } + impl WireFormat for GpsTime { const MIN_LEN: usize = ::MIN_LEN + ::MIN_LEN @@ -138,6 +162,18 @@ pub mod gps_time_dep { pub wn: u16, } + impl FriendlyName for GpsTimeDep { + fn friendly_name() -> &'static str { + "GPSTimeDep" + } + } + + impl MessageDisplay for GpsTimeDep { + fn message_display(&self) -> String { + "".to_string() + } + } + impl WireFormat for GpsTimeDep { const MIN_LEN: usize = ::MIN_LEN + ::MIN_LEN; fn len(&self) -> usize { @@ -179,6 +215,18 @@ pub mod gps_time_sec { pub wn: u16, } + impl FriendlyName for GpsTimeSec { + fn friendly_name() -> &'static str { + "GPSTimeSec" + } + } + + impl MessageDisplay for GpsTimeSec { + fn message_display(&self) -> String { + "".to_string() + } + } + impl WireFormat for GpsTimeSec { const MIN_LEN: usize = ::MIN_LEN + ::MIN_LEN; fn len(&self) -> usize { @@ -237,6 +285,18 @@ pub mod gnss_signal { } } + impl FriendlyName for GnssSignal { + fn friendly_name() -> &'static str { + "GnssSignal" + } + } + + impl MessageDisplay for GnssSignal { + fn message_display(&self) -> String { + "".to_string() + } + } + impl WireFormat for GnssSignal { const MIN_LEN: usize = ::MIN_LEN + ::MIN_LEN; fn len(&self) -> usize { @@ -378,6 +438,18 @@ pub mod gnss_signal_dep { } } + impl FriendlyName for GnssSignalDep { + fn friendly_name() -> &'static str { + "GnssSignalDep" + } + } + + impl MessageDisplay for GnssSignalDep { + fn message_display(&self) -> String { + "".to_string() + } + } + impl WireFormat for GnssSignalDep { const MIN_LEN: usize = ::MIN_LEN + ::MIN_LEN @@ -496,6 +568,18 @@ pub mod sv_id { } } + impl FriendlyName for SvId { + fn friendly_name() -> &'static str { + "SvId" + } + } + + impl MessageDisplay for SvId { + fn message_display(&self) -> String { + "".to_string() + } + } + impl WireFormat for SvId { const MIN_LEN: usize = ::MIN_LEN + ::MIN_LEN; fn len(&self) -> usize { diff --git a/rust/sbp/src/messages/integrity.rs b/rust/sbp/src/messages/integrity.rs index 29adc47642..cd8cac55a7 100644 --- a/rust/sbp/src/messages/integrity.rs +++ b/rust/sbp/src/messages/integrity.rs @@ -55,6 +55,18 @@ pub mod integrity_ssr_header { pub chain_id: u8, } + impl FriendlyName for IntegritySSRHeader { + fn friendly_name() -> &'static str { + "IntegritySSRHeader" + } + } + + impl MessageDisplay for IntegritySSRHeader { + fn message_display(&self) -> String { + "".to_string() + } + } + impl WireFormat for IntegritySSRHeader { const MIN_LEN: usize = ::MIN_LEN + ::MIN_LEN diff --git a/rust/sbp/src/messages/navigation.rs b/rust/sbp/src/messages/navigation.rs index 003d2a351c..0bf976080e 100644 --- a/rust/sbp/src/messages/navigation.rs +++ b/rust/sbp/src/messages/navigation.rs @@ -103,6 +103,18 @@ pub mod estimated_horizontal_error_ellipse { pub orientation: f32, } + impl FriendlyName for EstimatedHorizontalErrorEllipse { + fn friendly_name() -> &'static str { + "EstimatedHorizontalErrorEllipse" + } + } + + impl MessageDisplay for EstimatedHorizontalErrorEllipse { + fn message_display(&self) -> String { + "".to_string() + } + } + impl WireFormat for EstimatedHorizontalErrorEllipse { const MIN_LEN: usize = ::MIN_LEN + ::MIN_LEN diff --git a/rust/sbp/src/messages/observation.rs b/rust/sbp/src/messages/observation.rs index c53c93c8ab..b2b4c00be0 100644 --- a/rust/sbp/src/messages/observation.rs +++ b/rust/sbp/src/messages/observation.rs @@ -114,6 +114,18 @@ pub mod almanac_common_content { pub health_bits: u8, } + impl FriendlyName for AlmanacCommonContent { + fn friendly_name() -> &'static str { + "AlmanacCommonContent" + } + } + + impl MessageDisplay for AlmanacCommonContent { + fn message_display(&self) -> String { + "".to_string() + } + } + impl WireFormat for AlmanacCommonContent { const MIN_LEN: usize = ::MIN_LEN + ::MIN_LEN @@ -194,6 +206,18 @@ pub mod almanac_common_content_dep { pub health_bits: u8, } + impl FriendlyName for AlmanacCommonContentDep { + fn friendly_name() -> &'static str { + "AlmanacCommonContentDep" + } + } + + impl MessageDisplay for AlmanacCommonContentDep { + fn message_display(&self) -> String { + "".to_string() + } + } + impl WireFormat for AlmanacCommonContentDep { const MIN_LEN: usize = ::MIN_LEN + ::MIN_LEN @@ -256,6 +280,18 @@ pub mod carrier_phase_dep_a { pub f: u8, } + impl FriendlyName for CarrierPhaseDepA { + fn friendly_name() -> &'static str { + "CarrierPhaseDepA" + } + } + + impl MessageDisplay for CarrierPhaseDepA { + fn message_display(&self) -> String { + "".to_string() + } + } + impl WireFormat for CarrierPhaseDepA { const MIN_LEN: usize = ::MIN_LEN + ::MIN_LEN; fn len(&self) -> usize { @@ -299,6 +335,18 @@ pub mod doppler { pub f: u8, } + impl FriendlyName for Doppler { + fn friendly_name() -> &'static str { + "Doppler" + } + } + + impl MessageDisplay for Doppler { + fn message_display(&self) -> String { + "".to_string() + } + } + impl WireFormat for Doppler { const MIN_LEN: usize = ::MIN_LEN + ::MIN_LEN; fn len(&self) -> usize { @@ -351,6 +399,18 @@ pub mod ephemeris_common_content { pub health_bits: u8, } + impl FriendlyName for EphemerisCommonContent { + fn friendly_name() -> &'static str { + "EphemerisCommonContent" + } + } + + impl MessageDisplay for EphemerisCommonContent { + fn message_display(&self) -> String { + "".to_string() + } + } + impl WireFormat for EphemerisCommonContent { const MIN_LEN: usize = ::MIN_LEN + ::MIN_LEN @@ -421,6 +481,18 @@ pub mod ephemeris_common_content_dep_a { pub health_bits: u8, } + impl FriendlyName for EphemerisCommonContentDepA { + fn friendly_name() -> &'static str { + "EphemerisCommonContentDepA" + } + } + + impl MessageDisplay for EphemerisCommonContentDepA { + fn message_display(&self) -> String { + "".to_string() + } + } + impl WireFormat for EphemerisCommonContentDepA { const MIN_LEN: usize = ::MIN_LEN + ::MIN_LEN @@ -490,6 +562,18 @@ pub mod ephemeris_common_content_dep_b { pub health_bits: u8, } + impl FriendlyName for EphemerisCommonContentDepB { + fn friendly_name() -> &'static str { + "EphemerisCommonContentDepB" + } + } + + impl MessageDisplay for EphemerisCommonContentDepB { + fn message_display(&self) -> String { + "".to_string() + } + } + impl WireFormat for EphemerisCommonContentDepB { const MIN_LEN: usize = ::MIN_LEN + ::MIN_LEN @@ -586,6 +670,18 @@ pub mod gnss_capb { pub gal_e5: u64, } + impl FriendlyName for GnssCapb { + fn friendly_name() -> &'static str { + "GnssCapb" + } + } + + impl MessageDisplay for GnssCapb { + fn message_display(&self) -> String { + "".to_string() + } + } + impl WireFormat for GnssCapb { const MIN_LEN: usize = ::MIN_LEN + ::MIN_LEN @@ -6743,6 +6839,18 @@ pub mod observation_header { pub n_obs: u8, } + impl FriendlyName for ObservationHeader { + fn friendly_name() -> &'static str { + "ObservationHeader" + } + } + + impl MessageDisplay for ObservationHeader { + fn message_display(&self) -> String { + "".to_string() + } + } + impl WireFormat for ObservationHeader { const MIN_LEN: usize = ::MIN_LEN + ::MIN_LEN; fn len(&self) -> usize { @@ -6785,6 +6893,18 @@ pub mod observation_header_dep { pub n_obs: u8, } + impl FriendlyName for ObservationHeaderDep { + fn friendly_name() -> &'static str { + "ObservationHeaderDep" + } + } + + impl MessageDisplay for ObservationHeaderDep { + fn message_display(&self) -> String { + "".to_string() + } + } + impl WireFormat for ObservationHeaderDep { const MIN_LEN: usize = ::MIN_LEN + ::MIN_LEN; fn len(&self) -> usize { @@ -6926,6 +7046,18 @@ pub mod packed_obs_content { } } + impl FriendlyName for PackedObsContent { + fn friendly_name() -> &'static str { + "PackedObsContent" + } + } + + impl MessageDisplay for PackedObsContent { + fn message_display(&self) -> String { + "".to_string() + } + } + impl WireFormat for PackedObsContent { const MIN_LEN: usize = ::MIN_LEN + ::MIN_LEN @@ -7166,6 +7298,18 @@ pub mod packed_obs_content_dep_a { pub prn: u8, } + impl FriendlyName for PackedObsContentDepA { + fn friendly_name() -> &'static str { + "PackedObsContentDepA" + } + } + + impl MessageDisplay for PackedObsContentDepA { + fn message_display(&self) -> String { + "".to_string() + } + } + impl WireFormat for PackedObsContentDepA { const MIN_LEN: usize = ::MIN_LEN + ::MIN_LEN @@ -7233,6 +7377,18 @@ pub mod packed_obs_content_dep_b { pub sid: GnssSignalDep, } + impl FriendlyName for PackedObsContentDepB { + fn friendly_name() -> &'static str { + "PackedObsContentDepB" + } + } + + impl MessageDisplay for PackedObsContentDepB { + fn message_display(&self) -> String { + "".to_string() + } + } + impl WireFormat for PackedObsContentDepB { const MIN_LEN: usize = ::MIN_LEN + ::MIN_LEN @@ -7301,6 +7457,18 @@ pub mod packed_obs_content_dep_c { pub sid: GnssSignalDep, } + impl FriendlyName for PackedObsContentDepC { + fn friendly_name() -> &'static str { + "PackedObsContentDepC" + } + } + + impl MessageDisplay for PackedObsContentDepC { + fn message_display(&self) -> String { + "".to_string() + } + } + impl WireFormat for PackedObsContentDepC { const MIN_LEN: usize = ::MIN_LEN + ::MIN_LEN @@ -7457,6 +7625,18 @@ pub mod packed_osr_content { } } + impl FriendlyName for PackedOsrContent { + fn friendly_name() -> &'static str { + "PackedOsrContent" + } + } + + impl MessageDisplay for PackedOsrContent { + fn message_display(&self) -> String { + "".to_string() + } + } + impl WireFormat for PackedOsrContent { const MIN_LEN: usize = ::MIN_LEN + ::MIN_LEN @@ -7689,6 +7869,18 @@ pub mod sv_az_el { pub el: i8, } + impl FriendlyName for SvAzEl { + fn friendly_name() -> &'static str { + "SvAzEl" + } + } + + impl MessageDisplay for SvAzEl { + fn message_display(&self) -> String { + "".to_string() + } + } + impl WireFormat for SvAzEl { const MIN_LEN: usize = ::MIN_LEN + ::MIN_LEN diff --git a/rust/sbp/src/messages/piksi.rs b/rust/sbp/src/messages/piksi.rs index 5d003ccd4c..4fb8a1bad4 100644 --- a/rust/sbp/src/messages/piksi.rs +++ b/rust/sbp/src/messages/piksi.rs @@ -77,6 +77,21 @@ pub mod latency { pub current: i32, } + impl FriendlyName for Latency { + fn friendly_name() -> &'static str { + "Latency" + } + } + + impl MessageDisplay for Latency { + fn message_display(&self) -> String { + format!( + "{:1} {:1} {:1} {:1}", + self.avg, self.lmin, self.lmax, self.current + ) + } + } + impl WireFormat for Latency { const MIN_LEN: usize = ::MIN_LEN + ::MIN_LEN @@ -256,7 +271,7 @@ pub mod msg_cell_modem_status { impl MessageDisplay for MsgCellModemStatus { fn message_display(&self) -> String { format!( - "{} dBm | {} %", + "{} dBm | {:1} %", self.signal_strength, self.signal_error_rate ) } @@ -801,7 +816,7 @@ pub mod msg_device_monitor { impl MessageDisplay for MsgDeviceMonitor { fn message_display(&self) -> String { format!( - "Vin: {} V | Tcpu: {} C | Trf: {} C", + "Vin: {:2} V | Tcpu: {:1} C | Trf: {:1} C", self.dev_vin, self.cpu_temperature, self.fe_temperature ) } @@ -2742,7 +2757,7 @@ pub mod msg_thread_state { impl MessageDisplay for MsgThreadState { fn message_display(&self) -> String { - format!("{} | {} | {} B", self.name, self.cpu, self.stack_free) + format!("{} | {:1} | {} B", self.name, self.cpu, self.stack_free) } } @@ -2854,7 +2869,14 @@ pub mod msg_uart_state { impl MessageDisplay for MsgUartState { fn message_display(&self) -> String { - "".to_string() + format!( + "{} | {} | {} | {} | {}", + self.uart_a.message_display(), + self.uart_b.message_display(), + self.uart_ftdi.message_display(), + self.latency.message_display(), + self.obs_period.message_display() + ) } } @@ -3033,6 +3055,18 @@ pub mod network_usage { pub interface_name: SbpString<[u8; 16], Unterminated>, } + impl FriendlyName for NetworkUsage { + fn friendly_name() -> &'static str { + "NetworkUsage" + } + } + + impl MessageDisplay for NetworkUsage { + fn message_display(&self) -> String { + "".to_string() + } + } + impl WireFormat for NetworkUsage { const MIN_LEN: usize = ::MIN_LEN + ::MIN_LEN @@ -3099,6 +3133,21 @@ pub mod period { pub current: i32, } + impl FriendlyName for Period { + fn friendly_name() -> &'static str { + "Period" + } + } + + impl MessageDisplay for Period { + fn message_display(&self) -> String { + format!( + "{:1} {:1} {:1} {:1}", + self.avg, self.pmin, self.pmax, self.current + ) + } + } + impl WireFormat for Period { const MIN_LEN: usize = ::MIN_LEN + ::MIN_LEN @@ -3163,6 +3212,26 @@ pub mod uart_channel { pub rx_buffer_level: u8, } + impl FriendlyName for UARTChannel { + fn friendly_name() -> &'static str { + "UARTChannel" + } + } + + impl MessageDisplay for UARTChannel { + fn message_display(&self) -> String { + format!( + "{:1} {:1} {} {} {:1} {:1}", + self.tx_throughput, + self.rx_throughput, + self.crc_error_count, + self.io_error_count, + self.tx_buffer_level, + self.rx_buffer_level + ) + } + } + impl WireFormat for UARTChannel { const MIN_LEN: usize = ::MIN_LEN + ::MIN_LEN diff --git a/rust/sbp/src/messages/solution_meta.rs b/rust/sbp/src/messages/solution_meta.rs index 732dcc654e..a9350d2738 100644 --- a/rust/sbp/src/messages/solution_meta.rs +++ b/rust/sbp/src/messages/solution_meta.rs @@ -60,6 +60,18 @@ pub mod gnss_input_type { } } + impl FriendlyName for GnssInputType { + fn friendly_name() -> &'static str { + "GNSSInputType" + } + } + + impl MessageDisplay for GnssInputType { + fn message_display(&self) -> String { + "".to_string() + } + } + impl WireFormat for GnssInputType { const MIN_LEN: usize = ::MIN_LEN; fn len(&self) -> usize { @@ -178,6 +190,18 @@ pub mod imu_input_type { } } + impl FriendlyName for ImuInputType { + fn friendly_name() -> &'static str { + "IMUInputType" + } + } + + impl MessageDisplay for ImuInputType { + fn message_display(&self) -> String { + "".to_string() + } + } + impl WireFormat for ImuInputType { const MIN_LEN: usize = ::MIN_LEN; fn len(&self) -> usize { @@ -817,6 +841,18 @@ pub mod odo_input_type { } } + impl FriendlyName for OdoInputType { + fn friendly_name() -> &'static str { + "OdoInputType" + } + } + + impl MessageDisplay for OdoInputType { + fn message_display(&self) -> String { + "".to_string() + } + } + impl WireFormat for OdoInputType { const MIN_LEN: usize = ::MIN_LEN; fn len(&self) -> usize { @@ -998,6 +1034,18 @@ pub mod solution_input_type { } } + impl FriendlyName for SolutionInputType { + fn friendly_name() -> &'static str { + "SolutionInputType" + } + } + + impl MessageDisplay for SolutionInputType { + fn message_display(&self) -> String { + "".to_string() + } + } + impl WireFormat for SolutionInputType { const MIN_LEN: usize = ::MIN_LEN + ::MIN_LEN; fn len(&self) -> usize { diff --git a/rust/sbp/src/messages/ssr.rs b/rust/sbp/src/messages/ssr.rs index 87a0b6b14b..fe748af79b 100644 --- a/rust/sbp/src/messages/ssr.rs +++ b/rust/sbp/src/messages/ssr.rs @@ -78,6 +78,18 @@ pub mod bounds_header { pub sol_id: u8, } + impl FriendlyName for BoundsHeader { + fn friendly_name() -> &'static str { + "BoundsHeader" + } + } + + impl MessageDisplay for BoundsHeader { + fn message_display(&self) -> String { + "".to_string() + } + } + impl WireFormat for BoundsHeader { const MIN_LEN: usize = ::MIN_LEN + ::MIN_LEN @@ -135,6 +147,18 @@ pub mod code_biases_content { pub value: i16, } + impl FriendlyName for CodeBiasesContent { + fn friendly_name() -> &'static str { + "CodeBiasesContent" + } + } + + impl MessageDisplay for CodeBiasesContent { + fn message_display(&self) -> String { + "".to_string() + } + } + impl WireFormat for CodeBiasesContent { const MIN_LEN: usize = ::MIN_LEN + ::MIN_LEN; fn len(&self) -> usize { @@ -186,6 +210,18 @@ pub mod code_phase_biases_sat_sig { pub phase_bias_bound_sig: u8, } + impl FriendlyName for CodePhaseBiasesSatSig { + fn friendly_name() -> &'static str { + "CodePhaseBiasesSatSig" + } + } + + impl MessageDisplay for CodePhaseBiasesSatSig { + fn message_display(&self) -> String { + "".to_string() + } + } + impl WireFormat for CodePhaseBiasesSatSig { const MIN_LEN: usize = ::MIN_LEN + ::MIN_LEN @@ -260,6 +296,18 @@ pub mod grid_definition_header_dep_a { pub seq_num: u8, } + impl FriendlyName for GridDefinitionHeaderDepA { + fn friendly_name() -> &'static str { + "GridDefinitionHeaderDepA" + } + } + + impl MessageDisplay for GridDefinitionHeaderDepA { + fn message_display(&self) -> String { + "".to_string() + } + } + impl WireFormat for GridDefinitionHeaderDepA { const MIN_LEN: usize = ::MIN_LEN + ::MIN_LEN @@ -340,6 +388,18 @@ pub mod gridded_correction_header { pub tropo_quality_indicator: u8, } + impl FriendlyName for GriddedCorrectionHeader { + fn friendly_name() -> &'static str { + "GriddedCorrectionHeader" + } + } + + impl MessageDisplay for GriddedCorrectionHeader { + fn message_display(&self) -> String { + "".to_string() + } + } + impl WireFormat for GriddedCorrectionHeader { const MIN_LEN: usize = ::MIN_LEN + ::MIN_LEN @@ -422,6 +482,18 @@ pub mod gridded_correction_header_dep_a { pub tropo_quality_indicator: u8, } + impl FriendlyName for GriddedCorrectionHeaderDepA { + fn friendly_name() -> &'static str { + "GriddedCorrectionHeaderDepA" + } + } + + impl MessageDisplay for GriddedCorrectionHeaderDepA { + fn message_display(&self) -> String { + "".to_string() + } + } + impl WireFormat for GriddedCorrectionHeaderDepA { const MIN_LEN: usize = ::MIN_LEN + ::MIN_LEN @@ -2788,6 +2860,18 @@ pub mod orbit_clock_bound { pub clock_bound_sig: u8, } + impl FriendlyName for OrbitClockBound { + fn friendly_name() -> &'static str { + "OrbitClockBound" + } + } + + impl MessageDisplay for OrbitClockBound { + fn message_display(&self) -> String { + "".to_string() + } + } + impl WireFormat for OrbitClockBound { const MIN_LEN: usize = ::MIN_LEN + ::MIN_LEN @@ -2880,6 +2964,18 @@ pub mod orbit_clock_bound_degradation { pub clock_bound_sig_dot: u8, } + impl FriendlyName for OrbitClockBoundDegradation { + fn friendly_name() -> &'static str { + "OrbitClockBoundDegradation" + } + } + + impl MessageDisplay for OrbitClockBoundDegradation { + fn message_display(&self) -> String { + "".to_string() + } + } + impl WireFormat for OrbitClockBoundDegradation { const MIN_LEN: usize = ::MIN_LEN + ::MIN_LEN @@ -2958,6 +3054,18 @@ pub mod phase_biases_content { pub bias: i32, } + impl FriendlyName for PhaseBiasesContent { + fn friendly_name() -> &'static str { + "PhaseBiasesContent" + } + } + + impl MessageDisplay for PhaseBiasesContent { + fn message_display(&self) -> String { + "".to_string() + } + } + impl WireFormat for PhaseBiasesContent { const MIN_LEN: usize = ::MIN_LEN + ::MIN_LEN @@ -3031,6 +3139,18 @@ pub mod stec_header { pub iod_atmo: u8, } + impl FriendlyName for STECHeader { + fn friendly_name() -> &'static str { + "STECHeader" + } + } + + impl MessageDisplay for STECHeader { + fn message_display(&self) -> String { + "".to_string() + } + } + impl WireFormat for STECHeader { const MIN_LEN: usize = ::MIN_LEN + ::MIN_LEN @@ -3106,6 +3226,18 @@ pub mod stec_header_dep_a { pub iod_atmo: u8, } + impl FriendlyName for STECHeaderDepA { + fn friendly_name() -> &'static str { + "STECHeaderDepA" + } + } + + impl MessageDisplay for STECHeaderDepA { + fn message_display(&self) -> String { + "".to_string() + } + } + impl WireFormat for STECHeaderDepA { const MIN_LEN: usize = ::MIN_LEN + ::MIN_LEN @@ -3166,6 +3298,18 @@ pub mod stec_residual { pub stddev: u8, } + impl FriendlyName for STECResidual { + fn friendly_name() -> &'static str { + "STECResidual" + } + } + + impl MessageDisplay for STECResidual { + fn message_display(&self) -> String { + "".to_string() + } + } + impl WireFormat for STECResidual { const MIN_LEN: usize = ::MIN_LEN + ::MIN_LEN @@ -3213,6 +3357,18 @@ pub mod stec_residual_no_std { pub residual: i16, } + impl FriendlyName for STECResidualNoStd { + fn friendly_name() -> &'static str { + "STECResidualNoStd" + } + } + + impl MessageDisplay for STECResidualNoStd { + fn message_display(&self) -> String { + "".to_string() + } + } + impl WireFormat for STECResidualNoStd { const MIN_LEN: usize = ::MIN_LEN + ::MIN_LEN; fn len(&self) -> usize { @@ -3259,6 +3415,18 @@ pub mod stec_sat_element { pub stec_coeff: [i16; 4], } + impl FriendlyName for STECSatElement { + fn friendly_name() -> &'static str { + "STECSatElement" + } + } + + impl MessageDisplay for STECSatElement { + fn message_display(&self) -> String { + "".to_string() + } + } + impl WireFormat for STECSatElement { const MIN_LEN: usize = ::MIN_LEN + ::MIN_LEN @@ -3315,6 +3483,18 @@ pub mod stec_sat_element_integrity { pub stec_bound_sig_dot: u8, } + impl FriendlyName for STECSatElementIntegrity { + fn friendly_name() -> &'static str { + "STECSatElementIntegrity" + } + } + + impl MessageDisplay for STECSatElementIntegrity { + fn message_display(&self) -> String { + "".to_string() + } + } + impl WireFormat for STECSatElementIntegrity { const MIN_LEN: usize = ::MIN_LEN + ::MIN_LEN @@ -3399,6 +3579,18 @@ pub mod satellite_apc { } } + impl FriendlyName for SatelliteAPC { + fn friendly_name() -> &'static str { + "SatelliteAPC" + } + } + + impl MessageDisplay for SatelliteAPC { + fn message_display(&self) -> String { + "".to_string() + } + } + impl WireFormat for SatelliteAPC { const MIN_LEN: usize = ::MIN_LEN + ::MIN_LEN @@ -3579,6 +3771,18 @@ pub mod tropospheric_delay_correction { pub stddev: u8, } + impl FriendlyName for TroposphericDelayCorrection { + fn friendly_name() -> &'static str { + "TroposphericDelayCorrection" + } + } + + impl MessageDisplay for TroposphericDelayCorrection { + fn message_display(&self) -> String { + "".to_string() + } + } + impl WireFormat for TroposphericDelayCorrection { const MIN_LEN: usize = ::MIN_LEN + ::MIN_LEN @@ -3626,6 +3830,18 @@ pub mod tropospheric_delay_correction_no_std { pub wet: i8, } + impl FriendlyName for TroposphericDelayCorrectionNoStd { + fn friendly_name() -> &'static str { + "TroposphericDelayCorrectionNoStd" + } + } + + impl MessageDisplay for TroposphericDelayCorrectionNoStd { + fn message_display(&self) -> String { + "".to_string() + } + } + impl WireFormat for TroposphericDelayCorrectionNoStd { const MIN_LEN: usize = ::MIN_LEN + ::MIN_LEN; fn len(&self) -> usize { diff --git a/rust/sbp/src/messages/system.rs b/rust/sbp/src/messages/system.rs index 3167cad891..0353d764e1 100644 --- a/rust/sbp/src/messages/system.rs +++ b/rust/sbp/src/messages/system.rs @@ -2839,6 +2839,18 @@ pub mod status_journal_item { pub report: SubSystemReport, } + impl FriendlyName for StatusJournalItem { + fn friendly_name() -> &'static str { + "StatusJournalItem" + } + } + + impl MessageDisplay for StatusJournalItem { + fn message_display(&self) -> String { + "".to_string() + } + } + impl WireFormat for StatusJournalItem { const MIN_LEN: usize = ::MIN_LEN + ::MIN_LEN; @@ -2914,6 +2926,18 @@ pub mod sub_system_report { } } + impl FriendlyName for SubSystemReport { + fn friendly_name() -> &'static str { + "SubSystemReport" + } + } + + impl MessageDisplay for SubSystemReport { + fn message_display(&self) -> String { + "".to_string() + } + } + impl WireFormat for SubSystemReport { const MIN_LEN: usize = ::MIN_LEN + ::MIN_LEN diff --git a/rust/sbp/src/messages/tracking.rs b/rust/sbp/src/messages/tracking.rs index d9e904d71e..8fbc30e427 100644 --- a/rust/sbp/src/messages/tracking.rs +++ b/rust/sbp/src/messages/tracking.rs @@ -2758,6 +2758,18 @@ pub mod measurement_state { pub cn0: u8, } + impl FriendlyName for MeasurementState { + fn friendly_name() -> &'static str { + "MeasurementState" + } + } + + impl MessageDisplay for MeasurementState { + fn message_display(&self) -> String { + "".to_string() + } + } + impl WireFormat for MeasurementState { const MIN_LEN: usize = ::MIN_LEN + ::MIN_LEN; fn len(&self) -> usize { @@ -2799,6 +2811,18 @@ pub mod tracking_channel_correlation { pub q: i16, } + impl FriendlyName for TrackingChannelCorrelation { + fn friendly_name() -> &'static str { + "TrackingChannelCorrelation" + } + } + + impl MessageDisplay for TrackingChannelCorrelation { + fn message_display(&self) -> String { + "".to_string() + } + } + impl WireFormat for TrackingChannelCorrelation { const MIN_LEN: usize = ::MIN_LEN + ::MIN_LEN; fn len(&self) -> usize { @@ -2840,6 +2864,18 @@ pub mod tracking_channel_correlation_dep { pub q: i32, } + impl FriendlyName for TrackingChannelCorrelationDep { + fn friendly_name() -> &'static str { + "TrackingChannelCorrelationDep" + } + } + + impl MessageDisplay for TrackingChannelCorrelationDep { + fn message_display(&self) -> String { + "".to_string() + } + } + impl WireFormat for TrackingChannelCorrelationDep { const MIN_LEN: usize = ::MIN_LEN + ::MIN_LEN; fn len(&self) -> usize { @@ -2885,6 +2921,18 @@ pub mod tracking_channel_state { pub cn0: u8, } + impl FriendlyName for TrackingChannelState { + fn friendly_name() -> &'static str { + "TrackingChannelState" + } + } + + impl MessageDisplay for TrackingChannelState { + fn message_display(&self) -> String { + "".to_string() + } + } + impl WireFormat for TrackingChannelState { const MIN_LEN: usize = ::MIN_LEN + ::MIN_LEN @@ -2949,6 +2997,18 @@ pub mod tracking_channel_state_dep_a { } } + impl FriendlyName for TrackingChannelStateDepA { + fn friendly_name() -> &'static str { + "TrackingChannelStateDepA" + } + } + + impl MessageDisplay for TrackingChannelStateDepA { + fn message_display(&self) -> String { + "".to_string() + } + } + impl WireFormat for TrackingChannelStateDepA { const MIN_LEN: usize = ::MIN_LEN + ::MIN_LEN @@ -3043,6 +3103,18 @@ pub mod tracking_channel_state_dep_b { } } + impl FriendlyName for TrackingChannelStateDepB { + fn friendly_name() -> &'static str { + "TrackingChannelStateDepB" + } + } + + impl MessageDisplay for TrackingChannelStateDepB { + fn message_display(&self) -> String { + "".to_string() + } + } + impl WireFormat for TrackingChannelStateDepB { const MIN_LEN: usize = ::MIN_LEN + ::MIN_LEN diff --git a/spec/yaml/swiftnav/sbp/piksi.yaml b/spec/yaml/swiftnav/sbp/piksi.yaml index 6c8054bc63..3159d299b0 100644 --- a/spec/yaml/swiftnav/sbp/piksi.yaml +++ b/spec/yaml/swiftnav/sbp/piksi.yaml @@ -104,7 +104,7 @@ definitions: - MSG_THREAD_STATE: id: 0x0017 - message_display: "{{@name}} | {{@cpu}} | {{@stack_free}} B" + message_display: "{{@name}} | {{@cpu}:1} | {{@stack_free}} B" short_desc: State of an RTOS thread desc: > The thread usage message from the device reports real-time @@ -128,6 +128,7 @@ definitions: - UARTChannel: short_desc: State of the UART channel + message_display: "{{@tx_throughput}:1} {{@rx_throughput}:1} {{@crc_error_count}} {{@io_error_count}} {{@tx_buffer_level}:1} {{@rx_buffer_level}:1}" desc: > Throughput, utilization, and error counts on the RX/TX buffers of this UART channel. The reported percentage values must @@ -159,6 +160,7 @@ definitions: 0 to 255) - Period: short_desc: base station observation message receipt period + message_display: "{{@avg}:1} {{@pmin}:1} {{@pmax}:1} {{@current}:1}" desc: > Statistics on the period of observations received from the base station. As complete observation sets are received, their time @@ -186,6 +188,7 @@ definitions: - Latency: short_desc: Receiver-to-base station latency + message_display: "{{@avg}:1} {{@lmin}:1} {{@lmax}:1} {{@current}:1}" desc: > Statistics on the latency of observations received from the base station. As observation packets are received their GPS time is @@ -213,6 +216,7 @@ definitions: - MSG_UART_STATE: id: 0x001D short_desc: State of the UART channels + message_display: "{{#uart_a}} | {{#uart_b}} | {{#uart_ftdi}} | {{#latency}} | {{#obs_period}}" desc: > The UART message reports data latency and throughput of the UART channels providing SBP I/O. On the default Piksi configuration, @@ -329,7 +333,7 @@ definitions: - MSG_DEVICE_MONITOR: id: 0x00B5 - message_display: "Vin: {{@dev_vin}} V | Tcpu: {{@cpu_temperature}} C | Trf: {{@fe_temperature}} C" + message_display: "Vin: {{@dev_vin}:2} V | Tcpu: {{@cpu_temperature}:1} C | Trf: {{@fe_temperature}:1} C" short_desc: Device temperature and voltage levels desc: > This message contains temperature and voltage level measurements from the @@ -523,7 +527,7 @@ definitions: - MSG_CELL_MODEM_STATUS: id: 0x00BE - message_display: "{{@signal_strength}} dBm | {{@signal_error_rate}} %" + message_display: "{{@signal_strength}} dBm | {{@signal_error_rate}:1} %" short_desc: Cell modem information update message desc: > If a cell modem is present on a piksi device, this message From b4969301adaf1fa1d7c14fe11cef455611c46a28 Mon Sep 17 00:00:00 2001 From: adrian-kong Date: Mon, 5 Dec 2022 12:06:53 +1100 Subject: [PATCH 7/7] update examples --- spec/example/yaml/example.yaml | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/spec/example/yaml/example.yaml b/spec/example/yaml/example.yaml index 98cb1ffb44..f8470d42dd 100644 --- a/spec/example/yaml/example.yaml +++ b/spec/example/yaml/example.yaml @@ -82,6 +82,16 @@ definitions: - UARTChannel: desc: State of the UART channel. + + # Message display (also mentioned below in MSG_UART_STATE) creates + # an enriched display format for this struct. + # The syntax of {{field}:x} represents formatting '{:x}' or 'rounding' + # + # In this example, UARTChannel will create a rust implementation of + # + # format!("{:1} | {:2}", self.tx_throughput, self.crc_error_count) + + message_display: "{{@tx_throughput}:1} | {{@crc_error_count}:2}" fields: - tx_throughput: type: float @@ -97,6 +107,25 @@ definitions: - MSG_UART_STATE: id: 0x0018 + + # Friendly name of this message, in replacement of MSG_UART_STATE + # will be displayed as UART STATE instead, this is usually autogenerated + # by shortening keywords in generator but can be manually specified here. + + friendly_name: UART STATE + + # This field creates an enriched display format for the end-user. + # Available syntax: + # {{...}} + # - enclosed in double braces represents input argument i.e. f"{args}" in python + # - this syntax begins all the following possible patterns. + # @fieldX + # - denotes some field from the current class, should be picked from one of + # the defined fields below. + # #uart0 + # - to access fields that has type using message_display + message_display: "channel: {{#uart0}}" + desc: Piksi message about the state of UART0. fields: - uart0: