use crate::{ubx_checksum, MemWriter, MemWriterError, UbxPacketCreator, UbxPacketMeta};
use ublox_derive::ubx_packet_send;
#[ubx_packet_send]
#[ubx(class = 6, id = 1, fixed_payload_len = 3)]
struct CfgMsgSinglePort {
msg_class: u8,
msg_id: u8,
rate: u8,
}
impl CfgMsgSinglePortBuilder {
#[inline]
pub fn set_rate_for<T: UbxPacketMeta>(rate: u8) -> Self {
Self {
msg_class: T::CLASS,
msg_id: T::ID,
rate,
}
}
}
#[ubx_packet_send]
#[ubx(class = 6, id = 1, fixed_payload_len = 8)]
struct CfgMsgAllPorts {
msg_class: u8,
msg_id: u8,
rates: [u8; 6],
}
impl CfgMsgAllPortsBuilder {
#[inline]
pub fn set_rate_for<T: UbxPacketMeta>(rates: [u8; 6]) -> Self {
Self {
msg_class: T::CLASS,
msg_id: T::ID,
rates,
}
}
}