Skip to content

Commit fe9028e

Browse files
authored
Run the handler tasks too (#11)
1 parent 0ec63e9 commit fe9028e

File tree

4 files changed

+9
-3
lines changed

4 files changed

+9
-3
lines changed

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ rust-version = "1.77"
1414

1515
[patch.crates-io]
1616
#rs-matter = { git = "https://github.com/project-chip/rs-matter" }
17-
rs-matter = { git = "https://github.com/ivmarkov/rs-matter", branch = "next" }
17+
rs-matter = { git = "https://github.com/ivmarkov/rs-matter", branch = "global-handler-access" }
1818
#rs-matter = { path = "../rs-matter/rs-matter" }
1919
#edge-nal = { git = "https://github.com/ivmarkov/edge-net" }
2020
#edge-nal-std = { git = "https://github.com/ivmarkov/edge-net" }

examples/light.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
//! If you want to use Ethernet, utilize `EthMatterStack` instead.
77
//!
88
//! The example implements a fictitious Light device (an On-Off Matter cluster).
9+
#![recursion_limit = "256"]
910

1011
use core::pin::pin;
1112

examples/light_eth.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
//! its credentials etc. and can assume it "pre-exists".
99
//!
1010
//! The example implements a fictitious Light device (an On-Off Matter cluster).
11+
#![recursion_limit = "256"]
1112

1213
use core::pin::pin;
1314

src/lib.rs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,11 @@ use core::net::{Ipv4Addr, Ipv6Addr, SocketAddr, SocketAddrV6};
1414
use core::pin::pin;
1515

1616
use edge_nal::{UdpBind, UdpSplit};
17-
use embassy_futures::select::{select4, Either4};
17+
use embassy_futures::select::{select, select4, Either4};
1818
use embassy_sync::blocking_mutex::raw::NoopRawMutex;
1919

2020
use persist::{KvBlobBuffer, KvBlobStore, MatterPersist, NetworkPersist};
21+
2122
use rs_matter::dm::clusters::basic_info::BasicInfoConfig;
2223
use rs_matter::dm::clusters::dev_att::DevAttDataFetcher;
2324
use rs_matter::dm::clusters::gen_diag::NetifDiag;
@@ -31,6 +32,7 @@ use rs_matter::transport::network::{Address, ChainedNetwork, NetworkReceive, Net
3132
use rs_matter::utils::epoch::Epoch;
3233
use rs_matter::utils::init::{init, Init};
3334
use rs_matter::utils::rand::Rand;
35+
use rs_matter::utils::select::Coalesce;
3436
use rs_matter::utils::storage::pooled::PooledBuffers;
3537
use rs_matter::{BasicCommData, Matter, MATTER_PORT};
3638

@@ -477,7 +479,9 @@ where
477479
// Reset the Matter transport buffers and all sessions first
478480
// self.matter().reset_transport()?;
479481

480-
self.run_responder(handler).await
482+
select(self.run_responder(&handler), handler.run())
483+
.coalesce()
484+
.await
481485
}
482486

483487
async fn run_psm<S, C>(&self, persist: &MatterPersist<'_, S, C>) -> Result<(), Error>

0 commit comments

Comments
 (0)