mirror of
https://github.com/bluekitchen/btstack.git
synced 2025-02-20 18:40:31 +00:00
hci: provided error code in hardware error callback
This commit is contained in:
parent
e63eef5d93
commit
c2e1fa6005
@ -721,8 +721,8 @@ void BTstackManager::setPublicBdAddr(bd_addr_t addr){
|
||||
memcpy(public_bd_addr, addr ,6);
|
||||
}
|
||||
|
||||
void bluetooth_hardware_error(){
|
||||
printf("Bluetooth Hardware Error event. Restarting...\n\n\n");
|
||||
void bluetooth_hardware_error(uint8_t error){
|
||||
printf("Bluetooth Hardware Error event 0x%02x. Restarting...\n\n\n", error);
|
||||
#ifdef __AVR__
|
||||
wdt_enable(WDTO_15MS);
|
||||
// wait for watchdog to trigger
|
||||
|
@ -1729,7 +1729,7 @@ static void event_handler(uint8_t *packet, int size){
|
||||
case HCI_EVENT_HARDWARE_ERROR:
|
||||
log_error("Hardware Error: 0x%02x", packet[2]);
|
||||
if (hci_stack->hardware_error_callback){
|
||||
(*hci_stack->hardware_error_callback)();
|
||||
(*hci_stack->hardware_error_callback)(packet[2]);
|
||||
} else {
|
||||
// if no special requests, just reboot stack
|
||||
hci_power_control_off();
|
||||
@ -3617,7 +3617,7 @@ int hci_get_sco_packet_length(void){
|
||||
/**
|
||||
* @brief Set callback for Bluetooth Hardware Error
|
||||
*/
|
||||
void hci_set_hardware_error_callback(void (*fn)(void)){
|
||||
void hci_set_hardware_error_callback(void (*fn)(uint8_t error)){
|
||||
hci_stack->hardware_error_callback = fn;
|
||||
}
|
||||
|
||||
|
@ -570,7 +570,7 @@ typedef struct {
|
||||
void (*local_version_information_callback)(uint8_t * local_version_information);
|
||||
|
||||
// hardware error callback
|
||||
void (*hardware_error_callback)(void);
|
||||
void (*hardware_error_callback)(uint8_t error);
|
||||
|
||||
// basic configuration
|
||||
const char * local_name;
|
||||
@ -713,7 +713,7 @@ void hci_set_link_key_db(btstack_link_key_db_t const * link_key_db);
|
||||
/**
|
||||
* @brief Set callback for Bluetooth Hardware Error
|
||||
*/
|
||||
void hci_set_hardware_error_callback(void (*fn)(void));
|
||||
void hci_set_hardware_error_callback(void (*fn)(uint8_t error));
|
||||
|
||||
/**
|
||||
* @brief Set callback for local information from Bluetooth controller right after HCI Reset
|
||||
|
Loading…
x
Reference in New Issue
Block a user