Skip to content

Commit

Permalink
Fixing shared stack
Browse files Browse the repository at this point in the history
  • Loading branch information
ryan-summers committed Mar 16, 2023
1 parent 3b6de4d commit e8757f0
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/shared.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@
use shared_bus::{AtomicCheckMutex, BusMutex};

/// A manager for a shared network stack.
pub struct NetworkManager<'a, DeviceT, Clock>
pub struct NetworkManager<'a, Device, Clock>
where
DeviceT: for<'c> smoltcp::phy::Device<'c>,
Device: smoltcp::phy::Device,
Clock: embedded_time::Clock,
u32: From<Clock::T>,
{
mutex: AtomicCheckMutex<crate::NetworkStack<'a, DeviceT, Clock>>,
mutex: AtomicCheckMutex<crate::NetworkStack<'a, Device, Clock>>,
}

/// A basic proxy that references a shared network stack.
Expand Down Expand Up @@ -94,17 +94,17 @@ where
forward! {bind(socket: &mut S::UdpSocket, local_port: u16) -> Result<(), S::Error>}
}

impl<'a, DeviceT, Clock> NetworkManager<'a, DeviceT, Clock>
impl<'a, Device, Clock> NetworkManager<'a, Device, Clock>
where
DeviceT: for<'x> smoltcp::phy::Device<'x>,
Device: smoltcp::phy::Device,
Clock: embedded_time::Clock,
u32: From<Clock::T>,
{
/// Construct a new manager for a shared network stack
///
/// # Args
/// * `stack` - The network stack that is being shared.
pub fn new(stack: crate::NetworkStack<'a, DeviceT, Clock>) -> Self {
pub fn new(stack: crate::NetworkStack<'a, Device, Clock>) -> Self {
Self {
mutex: AtomicCheckMutex::create(stack),
}
Expand All @@ -117,7 +117,7 @@ where
/// concurrency listed in the description of this file for usage.
pub fn acquire_stack(
&'_ self,
) -> NetworkStackProxy<'_, crate::NetworkStack<'a, DeviceT, Clock>> {
) -> NetworkStackProxy<'_, crate::NetworkStack<'a, Device, Clock>> {
NetworkStackProxy { mutex: &self.mutex }
}
}

0 comments on commit e8757f0

Please sign in to comment.