diff --git a/src/netif.rs b/src/netif.rs index 7a2384f..370961a 100644 --- a/src/netif.rs +++ b/src/netif.rs @@ -14,8 +14,6 @@ use esp_idf_svc::handle::RawHandle; use esp_idf_svc::netif::{EspNetif, IpEvent}; use esp_idf_svc::sys::{esp, esp_netif_get_ip6_linklocal, EspError, ESP_FAIL}; -use log::info; - use rs_matter::utils::notification::Notification; use crate::error::Error; @@ -86,8 +84,6 @@ pub fn get_ips(netif: &EspNetif) -> Result<(Ipv4Addr, Ipv6Addr, u32), Error> { let mut ipv6: esp_idf_svc::sys::esp_ip6_addr_t = Default::default(); - info!("Waiting for IPv6 address"); - esp!(unsafe { esp_netif_get_ip6_linklocal(netif.handle() as _, &mut ipv6) })?; let ipv6: Ipv6Addr = [ diff --git a/src/stack.rs b/src/stack.rs index af22b16..6aa9368 100644 --- a/src/stack.rs +++ b/src/stack.rs @@ -32,6 +32,8 @@ use crate::nvs; const MAX_SUBSCRIPTIONS: usize = 3; const MAX_IM_BUFFERS: usize = 10; const PSM_BUFFER_SIZE: usize = 4096; +const MAX_RESPONDERS: usize = 4; +const MAX_BUSY_RESPONDERS: usize = 2; #[cfg(all( not(esp32h2), @@ -202,12 +204,14 @@ where info!( "Responder memory: Responder={}B, Runner={}B", core::mem::size_of_val(&responder), - core::mem::size_of_val(&responder.run::<4, 4>()) + core::mem::size_of_val(&responder.run::()) ); - // Run the responder with up to 4 handlers (i.e. 4 exchanges can be handled simultenously) + // Run the responder with up to MAX_RESPONDERS handlers (i.e. MAX_RESPONDERS exchanges can be handled simultenously) // Clients trying to open more exchanges than the ones currently running will get "I'm busy, please try again later" - responder.run::<4, 4>().await?; + responder + .run::() + .await?; Ok(()) } @@ -225,7 +229,7 @@ where let socket = async_io::Async::::bind(MDNS_SOCKET_BIND_ADDR)?; join_multicast_v4(&socket, MDNS_IPV4_BROADCAST_ADDR, Ipv4Addr::UNSPECIFIED)?; - join_multicast_v6(&socket, MDNS_IPV6_BROADCAST_ADDR, 0)?; + join_multicast_v6(&socket, MDNS_IPV6_BROADCAST_ADDR, interface)?; self.matter() .run_builtin_mdns(