- command uint16_t LowPowerListening.dutyCycleToSleepInterval(uint16_t dutyCycle)
- {
- if( dutyCycle >= 10000 )
- return 0;
- else if( dutyCycle <= MIN_DUTY )
- return MAX_SLEEP;
-
- return ((10000U * LISTEN_WAKEUP) / dutyCycle) - LISTEN_WAKEUP;
- }
-
- command uint16_t LowPowerListening.sleepIntervalToDutyCycle(uint16_t interval)
- {
- if( interval < MIN_SLEEP )
- return 10000;
- else if( interval >= MAX_SLEEP )
- return MIN_DUTY;
-
- return (10000U * LISTEN_WAKEUP) / (LISTEN_WAKEUP + interval);
- }
-
- command void LowPowerListening.setLocalSleepInterval(uint16_t interval)