From aa4acd2909e7e7902546c864b9f59c5bb7f3f054 Mon Sep 17 00:00:00 2001 From: Nerivec <62446222+Nerivec@users.noreply.github.com> Date: Thu, 21 Nov 2024 12:13:07 +0100 Subject: [PATCH] Allow toggle nwk steering from button --- src/zigbee_router/app.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/zigbee_router/app.c b/src/zigbee_router/app.c index c7b7332f..4e16e4cd 100644 --- a/src/zigbee_router/app.c +++ b/src/zigbee_router/app.c @@ -97,9 +97,13 @@ static void button_event_handler(sl_zigbee_af_event_t *event) } } else if (state == SL_ZIGBEE_NO_NETWORK) { if (button_long_press) { + sl_zigbee_app_debug_println("Btn long press: nwk down: reboot btl"); bootloader_rebootAndInstall(); } else { - if (!sl_zigbee_af_event_is_scheduled(&commissioning_event)) { + if (sl_zigbee_af_event_is_scheduled(&commissioning_event)) { + sl_zigbee_app_debug_println("Btn press: nwk down: stop nwk steering"); + sl_zigbee_af_event_set_inactive(&commissioning_event); + } else { sl_zigbee_app_debug_println("Btn press: nwk down: start nwk steering"); sl_zigbee_af_event_set_active(&commissioning_event); }