mirror of
https://github.com/bluekitchen/btstack.git
synced 2025-01-05 21:59:45 +00:00
posix-like ports: unify sigint handler
This commit is contained in:
parent
c08bd42b42
commit
b96c8f447a
@ -75,13 +75,14 @@ static void packet_handler (uint8_t packet_type, uint16_t channel, uint8_t *pack
|
||||
|
||||
static void sigint_handler(int param){
|
||||
UNUSED(param);
|
||||
|
||||
#ifndef _WIN32
|
||||
|
||||
printf("CTRL-C - SIGINT received, shutting down..\n");
|
||||
log_info("sigint_handler: shutting down");
|
||||
|
||||
// reset anyway
|
||||
btstack_stdin_reset();
|
||||
#endif
|
||||
|
||||
log_info(" <= SIGINT received, shutting down..\n");
|
||||
// power down
|
||||
hci_power_control(HCI_POWER_OFF);
|
||||
hci_close();
|
||||
log_info("Good bye, see you.\n");
|
||||
|
@ -108,13 +108,15 @@ static void packet_handler (uint8_t packet_type, uint16_t channel, uint8_t *pack
|
||||
}
|
||||
|
||||
static void sigint_handler(int param){
|
||||
UNUSED(param);
|
||||
|
||||
printf("CTRL-C - SIGINT received, shutting down..\n");
|
||||
log_info("sigint_handler: shutting down");
|
||||
|
||||
#ifndef _WIN32
|
||||
// reset anyway
|
||||
btstack_stdin_reset();
|
||||
#endif
|
||||
|
||||
log_info(" <= SIGINT received, shutting down..\n");
|
||||
// power down
|
||||
hci_power_control(HCI_POWER_OFF);
|
||||
hci_close();
|
||||
log_info("Good bye, see you.\n");
|
||||
|
@ -79,13 +79,15 @@ static hci_transport_config_uart_t config = {
|
||||
static btstack_packet_callback_registration_t hci_event_callback_registration;
|
||||
|
||||
static void sigint_handler(int param){
|
||||
UNUSED(param);
|
||||
|
||||
printf("CTRL-C - SIGINT received, shutting down..\n");
|
||||
log_info("sigint_handler: shutting down");
|
||||
|
||||
#ifndef _WIN32
|
||||
// reset anyway
|
||||
btstack_stdin_reset();
|
||||
#endif
|
||||
|
||||
log_info(" <= SIGINT received, shutting down..\n");
|
||||
// power down
|
||||
hci_power_control(HCI_POWER_OFF);
|
||||
hci_close();
|
||||
log_info("Good bye, see you.\n");
|
||||
|
@ -46,13 +46,17 @@ void hal_led_toggle(void){
|
||||
}
|
||||
|
||||
static void sigint_handler(int param){
|
||||
UNUSED(param);
|
||||
|
||||
// reset even if not setup before
|
||||
printf("CTRL-C = SIGINT received, shutting down..\n");
|
||||
log_info("sigint_handler: shutting down");
|
||||
|
||||
// reset anyway
|
||||
btstack_stdin_reset();
|
||||
|
||||
log_info(" <= SIGINT received, shutting down..\n");
|
||||
// hci_power_control(HCI_POWER_OFF);
|
||||
// hci_close();
|
||||
// power down
|
||||
hci_power_control(HCI_POWER_OFF);
|
||||
hci_close();
|
||||
log_info("Good bye, see you.\n");
|
||||
exit(0);
|
||||
}
|
||||
|
@ -72,13 +72,15 @@ static void packet_handler (uint8_t packet_type, uint16_t channel, uint8_t *pack
|
||||
}
|
||||
|
||||
static void sigint_handler(int param){
|
||||
UNUSED(param);
|
||||
|
||||
printf("CTRL-C - SIGINT received, shutting down..\n");
|
||||
log_info("sigint_handler: shutting down");
|
||||
|
||||
#ifndef _WIN32
|
||||
// reset anyway
|
||||
btstack_stdin_reset();
|
||||
#endif
|
||||
|
||||
log_info(" <= SIGINT received, shutting down..\n");
|
||||
// power down
|
||||
hci_power_control(HCI_POWER_OFF);
|
||||
hci_close();
|
||||
log_info("Good bye, see you.\n");
|
||||
|
Loading…
Reference in New Issue
Block a user