Bugfix: two separate failsafe instances were used
This commit is contained in:
parent
b2805570ea
commit
f9536be1e3
2 changed files with 10 additions and 10 deletions
|
@ -30,7 +30,7 @@ use super::{
|
|||
pub type RootEndpointHandler<'a> = handler_chain_type!(
|
||||
DescriptorCluster,
|
||||
BasicInfoCluster<'a>,
|
||||
GenCommCluster,
|
||||
GenCommCluster<'a>,
|
||||
NwCommCluster,
|
||||
AdminCommCluster<'a>,
|
||||
NocCluster<'a>,
|
||||
|
@ -107,7 +107,7 @@ pub fn wrap<'a>(
|
|||
.chain(
|
||||
endpoint_id,
|
||||
general_commissioning::ID,
|
||||
GenCommCluster::new(rand),
|
||||
GenCommCluster::new(failsafe, rand),
|
||||
)
|
||||
.chain(
|
||||
endpoint_id,
|
||||
|
|
|
@ -121,17 +121,17 @@ struct FailSafeParams {
|
|||
bread_crumb: u8,
|
||||
}
|
||||
|
||||
pub struct GenCommCluster {
|
||||
pub struct GenCommCluster<'a> {
|
||||
data_ver: Dataver,
|
||||
expiry_len: u16,
|
||||
failsafe: RefCell<FailSafe>,
|
||||
failsafe: &'a RefCell<FailSafe>,
|
||||
}
|
||||
|
||||
impl GenCommCluster {
|
||||
pub fn new(rand: Rand) -> Self {
|
||||
impl<'a> GenCommCluster<'a> {
|
||||
pub fn new(failsafe: &'a RefCell<FailSafe>, rand: Rand) -> Self {
|
||||
Self {
|
||||
data_ver: Dataver::new(rand),
|
||||
failsafe: RefCell::new(FailSafe::new()),
|
||||
failsafe,
|
||||
// TODO: Arch-Specific
|
||||
expiry_len: 120,
|
||||
}
|
||||
|
@ -291,7 +291,7 @@ impl GenCommCluster {
|
|||
}
|
||||
}
|
||||
|
||||
impl Handler for GenCommCluster {
|
||||
impl<'a> Handler for GenCommCluster<'a> {
|
||||
fn read(&self, attr: &AttrDetails, encoder: AttrDataEncoder) -> Result<(), Error> {
|
||||
GenCommCluster::read(self, attr, encoder)
|
||||
}
|
||||
|
@ -307,9 +307,9 @@ impl Handler for GenCommCluster {
|
|||
}
|
||||
}
|
||||
|
||||
impl NonBlockingHandler for GenCommCluster {}
|
||||
impl<'a> NonBlockingHandler for GenCommCluster<'a> {}
|
||||
|
||||
impl ChangeNotifier<()> for GenCommCluster {
|
||||
impl<'a> ChangeNotifier<()> for GenCommCluster<'a> {
|
||||
fn consume_change(&mut self) -> Option<()> {
|
||||
self.data_ver.consume_change(())
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue