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; }