We have project using the common Matter Code base from SDK 1.6.1 and using a variation of the code to act as a switch sensor device time. This seems to work pretty well; however we notice that between the button states of closed and not closed.
With the provided code snippet:
void AppTask::ButtonEventHandler(Nrf::ButtonState state, Nrf::ButtonMask hasChanged)
{
if ((APPLICATION_BUTTON_MASK & state & hasChanged)) {
// button is signaling true
Nrf::GetBoard().GetLED(Nrf::DeviceLeds::LED2).Set(false);
app::Clusters::BooleanState::Attributes::StateValue::Set(1, false);
// Nrf::GetBoard().GetLED(Nrf::DeviceLeds::LED2).Set(true);
// app::Clusters::BooleanState::Attributes::StateValue::Set(1, true);
} else if ((APPLICATION_BUTTON_MASK & hasChanged)) {
// button is signaling false
Nrf::GetBoard().GetLED(Nrf::DeviceLeds::LED2).Set(true);
app::Clusters::BooleanState::Attributes::StateValue::Set(1, true);
// Nrf::GetBoard().GetLED(Nrf::DeviceLeds::LED2).Set(false);
// app::Clusters::BooleanState::Attributes::StateValue::Set(1, false);
}
}
We get the open and close state, however the one state seems to continuously transmit
I was looking at the following in dk_buttons_and_leds.c and in the function dk_buttons_init(): I see the comment:
PS Still not 'Matter' Tag I can select before posting?