Skip to content

Commit

Permalink
More bugfixing
Browse files Browse the repository at this point in the history
  • Loading branch information
ivmarkov committed May 1, 2024
1 parent a7d75ff commit 7d5722e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
4 changes: 0 additions & 4 deletions src/netif.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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 = [
Expand Down
12 changes: 8 additions & 4 deletions src/stack.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down Expand Up @@ -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::<MAX_RESPONDERS, MAX_BUSY_RESPONDERS>())
);

// 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::<MAX_RESPONDERS, MAX_BUSY_RESPONDERS>()
.await?;

Ok(())
}
Expand All @@ -225,7 +229,7 @@ where
let socket = async_io::Async::<std::net::UdpSocket>::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(
Expand Down

0 comments on commit 7d5722e

Please sign in to comment.