From c68bdf905b5e6f5223857e4dacbed1ce30515869 Mon Sep 17 00:00:00 2001 From: "matthias.ringwald" Date: Wed, 8 Jun 2011 16:13:30 +0000 Subject: [PATCH] add callback for harware error event - intended for embedded systems and allows to reset the system --- src/bt_control.h | 1 + src/hci.c | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/src/bt_control.h b/src/bt_control.h index e31209c55..d13024e67 100644 --- a/src/bt_control.h +++ b/src/bt_control.h @@ -65,4 +65,5 @@ typedef struct { void (*register_for_power_notifications)(void (*cb)(POWER_NOTIFICATION_t event)); + void (*hw_error)(void); } bt_control_t; diff --git a/src/hci.c b/src/hci.c index 9d6cf3dc3..8f8cbdaf3 100644 --- a/src/hci.c +++ b/src/hci.c @@ -492,6 +492,12 @@ static void event_handler(uint8_t *packet, int size){ } break; + case HCI_EVENT_HARDWARE_ERROR: + if(hci_stack.control->hw_error){ + (*hci_stack.control->hw_error)(); + } + break; + default: break; }