#![cfg_attr(docsrs, feature(doc_cfg))]
#![cfg_attr(not(feature = "std"), no_std)]
#[cfg(feature = "alloc")]
extern crate alloc;
extern crate core;
#[cfg(feature = "serde")]
extern crate serde;
pub use crate::{
error::{DateTimeError, MemWriterError, ParserError},
parser::{
AnyPacketRef, FixedBuffer, FixedLinearBuffer, Parser, ParserBuilder, RtcmPacketRef,
UbxParserIter, UnderlyingBuffer,
},
ubx_packets::*,
};
mod error;
mod parser;
mod ubx_packets;
pub mod proto14;
pub mod proto23;
pub mod proto27;
pub mod proto31;
#[derive(Debug)]
pub enum UbxPacket<'a> {
#[cfg(feature = "ubx_proto14")]
Proto14(proto14::PacketRef<'a>),
#[cfg(feature = "ubx_proto23")]
Proto23(proto23::PacketRef<'a>),
#[cfg(feature = "ubx_proto27")]
Proto27(proto27::PacketRef<'a>),
#[cfg(feature = "ubx_proto31")]
Proto31(proto31::PacketRef<'a>),
}
pub trait UbxProtocol: Send + Sized {
type PacketRef<'a>: Into<UbxPacket<'a>>;
const MAX_PAYLOAD_LEN: u16;
fn match_packet(
class_id: u8,
msg_id: u8,
payload: &[u8],
) -> Result<Self::PacketRef<'_>, ParserError>;
}