pub struct Bus<P> { /* private fields */ }Available on crate feature
std only.Expand description
A wired M-Bus behind a port.
Implementations§
Source§impl<P: Read + Write> Bus<P>
impl<P: Read + Write> Bus<P>
Sourcepub fn new(port: P, baud: Baud) -> Self
pub fn new(port: P, baud: Baud) -> Self
A bus at baud (the baud rate the port is opened with), with 50 ms of slack on
every response timeout for USB and network latency.
Sourcepub const fn slack(self, slack: Duration) -> Self
pub const fn slack(self, slack: Duration) -> Self
Extra time added to every response timeout: more for a gateway on the network, zero for a UART on the same board.
Sourcepub fn port_mut(&mut self) -> &mut P
pub fn port_mut(&mut self) -> &mut P
The port, e.g. to change its baud rate after master::set_baud.
Sourcepub fn into_inner(self) -> P
pub fn into_inner(self) -> P
The port back.
Sourcepub fn readout(&mut self, target: Target) -> Result<Vec<Telegram>, Error>
pub fn readout(&mut self, target: Target) -> Result<Vec<Telegram>, Error>
Read every telegram of one meter.
Sourcepub fn run_readout(&mut self, readout: Readout) -> Result<Vec<Telegram>, Error>
pub fn run_readout(&mut self, readout: Readout) -> Result<Vec<Telegram>, Error>
Read every telegram with a configured Readout (retries, telegram limit).
Sourcepub fn search(&mut self) -> Result<Found, Error>
pub fn search(&mut self) -> Result<Found, Error>
Find every meter on the bus by secondary address (wildcard search). Each selection waits for the whole response window, so colliding replies are seen.
Trait Implementations§
Auto Trait Implementations§
impl<P> Forget for Bus<P>
impl<P> Freeze for Bus<P>where
P: Freeze,
impl<P> Move for Bus<P>
impl<P> RefUnwindSafe for Bus<P>where
P: RefUnwindSafe,
impl<P> Send for Bus<P>where
P: Send,
impl<P> Sync for Bus<P>where
P: Sync,
impl<P> Unpin for Bus<P>where
P: Unpin,
impl<P> UnsafeUnpin for Bus<P>where
P: UnsafeUnpin,
impl<P> UnwindSafe for Bus<P>where
P: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more