add compile flag for delayed power off

This commit is contained in:
matthias.ringwald 2011-01-09 22:22:12 +00:00
parent 37d9a96df4
commit 8dd2fb2c4b

View File

@ -492,18 +492,26 @@ int main (int argc, char * const * argv){
#pragma mark manage power off timer
#define USE_POWER_OFF_TIMER
static void stop_power_off_timer(){
#ifdef USE_POWER_OFF_TIMER
if (timeout_active) {
run_loop_remove_timer(&timeout);
timeout_active = 0;
}
#endif
}
static void start_power_off_timer(){
#ifdef USE_POWER_OFF_TIMER
stop_power_off_timer();
run_loop_set_timer(&timeout, DAEMON_NO_ACTIVE_CLIENT_TIMEOUT);
run_loop_add_timer(&timeout);
timeout_active = 1;
#else
hci_power_control(HCI_POWER_OFF);
#endif
}
#pragma mark manage list of clients