only quit BTdaemon when (re)started by launchd

This commit is contained in:
matthias.ringwald 2009-08-30 18:17:16 +00:00
parent 19c019b4eb
commit b91e361c63

View File

@ -52,9 +52,14 @@ static void dummy_bluetooth_status_handler(BLUETOOTH_STATE state){
static void (*bluetooth_status_handler)(BLUETOOTH_STATE state) = dummy_bluetooth_status_handler;
static void daemon_no_connections_timeout(){
#ifdef USE_LAUNCHD
printf("No connection for %u seconds -> POWER OFF and quit\n", DAEMON_NO_CONNECTION_TIMEOUT);
hci_power_control( HCI_POWER_OFF);
exit(0);
#else
printf("No connection for %u seconds -> POWER OFF\n", DAEMON_NO_CONNECTION_TIMEOUT);
hci_power_control( HCI_POWER_OFF);
#endif
}
static int btstack_command_handler(connection_t *connection, uint8_t *packet, uint16_t size){