ZUNO_SETUP_SLEEPING_MODE()This macro defines how Z-Uno will manage power mode. It is very important to define correct mode because the behavior of the device changes dramatically depending on it. At the start, we recommend you to debug and develop your program using ZUNO_SLEEPING_MODE_ALWAYS_AWAKE mode, because that’s the easiest one.
If not specified in the project, ZUNO_SETUP_SLEEPING_MODE(ZUNO_SLEEPING_MODE_ALWAYS_AWAKE) is assumed. ZUNO_SETUP_SLEEPING_MODE(mode) mode Mode to manage power There is only three possible values available:
- ZUNO_SLEEPING_MODE_ALWAYS_AWAKE — device is always awake, reachable and helps to form mesh network acting as router (default mode). Used for mains powered devices.
- ZUNO_SLEEPING_MODE_SLEEPING — device wakes up by user request (interrupt) or periodically. Does not help to form mesh. Used for battery powered devices.
- ZUNO_SLEEPING_MODE_FREQUENTLY_AWAKE — device wakes up by user request (interrupt) or on packet received. Always available but does not help to form mesh. Used for battery powered devices. In Z-Wave this type of devices is called FLiRS
ZUNO_SETUP_SLEEPING_MODE(ZUNO_SLEEPING_MODE_SLEEPING); ZUNO_SETUP_SLEEPING_MODE(ZUNO_SLEEPING_MODE_ALWAYS_AWAKE); ZUNO_SETUP_SLEEPING_MODE(ZUNO_SLEEPING_MODE_FREQUENTLY_AWAKE);
|Mode||setup() called||loop() called||Wakes up||Routing for other Z-Wave devices|
|on interrupt||periodically||on command received|
|ZUNO_SLEEPING_MODE_ALWAYS_AWAKE||once after power on||eternally||—||—||—||Yes|
|ZUNO_SLEEPING_MODE_SLEEPING||on each wake up||until zunoSendDeviceToSleep() is called||Yes||Yes||No||No|
|ZUNO_SLEEPING_MODE_FREQUENTLY_AWAKE||on each wake up||until zunoSendDeviceToSleep() is called||Yes||No||Yes||No|