From e66bcf66c11497d7bac810a2b9f51fdf63cc9f00 Mon Sep 17 00:00:00 2001 From: Alexei Chetroi Date: Fri, 31 Jan 2025 19:06:47 -0500 Subject: [PATCH] Set power source to mains on non sleepy end devices --- MLight/mods/device-nwk-join-control.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/MLight/mods/device-nwk-join-control.c b/MLight/mods/device-nwk-join-control.c index b0aef7c..fd3be20 100644 --- a/MLight/mods/device-nwk-join-control.c +++ b/MLight/mods/device-nwk-join-control.c @@ -15,6 +15,10 @@ #define rz_led_blink_pattern(count, length, pattern, ledIndex) #endif // SL_CATALOG_RZ_LED_BLINK_PRESENT +#ifndef ZDO_POWER_DESCRIPTOR +#define ZDO_POWER_DESCRIPTOR 0x0220 +#endif // ZDO_POWER_DESCRIPTOR + #define LED_BLINK_SHORT_MS 100 #define LED_BLINK_LONG_MS 750 #define LED_BLINK_IDENTIFY_MS 500 @@ -121,6 +125,11 @@ void emberAfStackStatusCallback(EmberStatus status) default: break; } +#if SLI_ZIGBEE_PRIMARY_NETWORK_DEVICE_TYPE == SLI_ZIGBEE_NETWORK_DEVICE_TYPE_END_DEVICE + if ( EMBER_NETWORK_UP == status ) { + emberSetPowerDescriptor(ZDO_POWER_DESCRIPTOR); + } +#endif // SLI_ZIGBEE_PRIMARY_NETWORK_DEVICE_TYPE == SLI_ZIGBEE_NETWORK_DEVICE_TYPE_END_DEVICE dnjcStackStatusCb(status); }