mirror of
https://github.com/bluekitchen/btstack.git
synced 2025-04-16 08:42:28 +00:00
only quit BTdaemon when (re)started by launchd
This commit is contained in:
parent
19c019b4eb
commit
b91e361c63
@ -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 (*bluetooth_status_handler)(BLUETOOTH_STATE state) = dummy_bluetooth_status_handler;
|
||||||
|
|
||||||
static void daemon_no_connections_timeout(){
|
static void daemon_no_connections_timeout(){
|
||||||
|
#ifdef USE_LAUNCHD
|
||||||
printf("No connection for %u seconds -> POWER OFF and quit\n", DAEMON_NO_CONNECTION_TIMEOUT);
|
printf("No connection for %u seconds -> POWER OFF and quit\n", DAEMON_NO_CONNECTION_TIMEOUT);
|
||||||
hci_power_control( HCI_POWER_OFF);
|
hci_power_control( HCI_POWER_OFF);
|
||||||
exit(0);
|
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){
|
static int btstack_command_handler(connection_t *connection, uint8_t *packet, uint16_t size){
|
||||||
|
Loading…
x
Reference in New Issue
Block a user