feat: export uninitialized_device & add docs
Signed-off-by: Lachezar Lechev <elpiel93@gmail.com>
This commit is contained in:
parent
f2ac8521b1
commit
1b2ba0bfab
2 changed files with 11 additions and 1 deletions
|
|
@ -11,7 +11,7 @@ pub mod register;
|
|||
mod socket;
|
||||
pub mod tcp;
|
||||
pub mod udp;
|
||||
mod uninitialized_device;
|
||||
pub mod uninitialized_device;
|
||||
|
||||
pub use device::{Device, DeviceRefMut, InactiveDevice};
|
||||
pub use host::{Dhcp, Host, HostConfig, Manual};
|
||||
|
|
|
|||
10
src/udp.rs
10
src/udp.rs
|
|
@ -78,6 +78,7 @@ impl UdpSocket {
|
|||
}
|
||||
}
|
||||
|
||||
/// Sets a new destination before performing the send operation.
|
||||
fn send_to<SpiBus: Bus>(
|
||||
&mut self,
|
||||
bus: &mut SpiBus,
|
||||
|
|
@ -88,6 +89,9 @@ impl UdpSocket {
|
|||
self.send(bus, send_buffer)
|
||||
}
|
||||
|
||||
/// Receive data and mutate the `receive_buffer`.
|
||||
///
|
||||
/// If [`Interrupt::Receive`] is not set, it will always return [`NbError::WouldBlock`].
|
||||
fn receive<SpiBus: Bus>(
|
||||
&mut self,
|
||||
bus: &mut SpiBus,
|
||||
|
|
@ -139,6 +143,12 @@ impl UdpSocket {
|
|||
self.socket.command(bus, socketn::Command::Close)?;
|
||||
Ok(())
|
||||
}
|
||||
|
||||
/// returns the index of the socket
|
||||
#[inline]
|
||||
pub fn index(&self) -> u8 {
|
||||
self.socket.index
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug)]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue