Loading system/hci/src/hci_layer.cc +11 −5 Original line number Diff line number Diff line Loading @@ -25,6 +25,8 @@ #include <string.h> #include <sys/types.h> #include <unistd.h> #include <chrono> #include <mutex> #include "btcore/include/module.h" Loading Loading @@ -54,13 +56,14 @@ typedef struct { command_status_cb status_callback; void* context; BT_HDR* command; std::chrono::time_point<std::chrono::steady_clock> timestamp; } waiting_command_t; // Using a define here, because it can be stringified for the property lookup #define DEFAULT_STARTUP_TIMEOUT_MS 8000 #define STRING_VALUE_OF(x) #x // Abort if there is no response to an HCI command within two seconds. // Abort if there is no response to an HCI command. static const uint32_t COMMAND_PENDING_TIMEOUT_MS = 2000; // Our interface Loading Loading @@ -346,6 +349,7 @@ static void event_command_ready(fixed_queue_t* queue, { std::lock_guard<std::recursive_mutex> lock( commands_pending_response_mutex); wait_entry->timestamp = std::chrono::steady_clock::now(); list_append(commands_pending_response, wait_entry); // Send it off Loading Loading @@ -397,12 +401,14 @@ static void command_timed_out(UNUSED_ATTR void* context) { waiting_command_t* wait_entry = reinterpret_cast<waiting_command_t*>( list_front(commands_pending_response)); int wait_time_ms = std::chrono::duration_cast<std::chrono::milliseconds>( std::chrono::steady_clock::now() - wait_entry->timestamp) .count(); // We shouldn't try to recover the stack from this command timeout. // If it's caused by a software bug, fix it. If it's a hardware bug, fix it. LOG_ERROR( LOG_TAG, "%s hci layer timeout waiting for response to a command. opcode: 0x%x", __func__, wait_entry->opcode); LOG_ERROR(LOG_TAG, "%s: Waited %d ms for a response to opcode: 0x%x", __func__, wait_time_ms, wait_entry->opcode); LOG_EVENT_INT(BT_HCI_TIMEOUT_TAG_NUM, wait_entry->opcode); lock.unlock(); } Loading Loading
system/hci/src/hci_layer.cc +11 −5 Original line number Diff line number Diff line Loading @@ -25,6 +25,8 @@ #include <string.h> #include <sys/types.h> #include <unistd.h> #include <chrono> #include <mutex> #include "btcore/include/module.h" Loading Loading @@ -54,13 +56,14 @@ typedef struct { command_status_cb status_callback; void* context; BT_HDR* command; std::chrono::time_point<std::chrono::steady_clock> timestamp; } waiting_command_t; // Using a define here, because it can be stringified for the property lookup #define DEFAULT_STARTUP_TIMEOUT_MS 8000 #define STRING_VALUE_OF(x) #x // Abort if there is no response to an HCI command within two seconds. // Abort if there is no response to an HCI command. static const uint32_t COMMAND_PENDING_TIMEOUT_MS = 2000; // Our interface Loading Loading @@ -346,6 +349,7 @@ static void event_command_ready(fixed_queue_t* queue, { std::lock_guard<std::recursive_mutex> lock( commands_pending_response_mutex); wait_entry->timestamp = std::chrono::steady_clock::now(); list_append(commands_pending_response, wait_entry); // Send it off Loading Loading @@ -397,12 +401,14 @@ static void command_timed_out(UNUSED_ATTR void* context) { waiting_command_t* wait_entry = reinterpret_cast<waiting_command_t*>( list_front(commands_pending_response)); int wait_time_ms = std::chrono::duration_cast<std::chrono::milliseconds>( std::chrono::steady_clock::now() - wait_entry->timestamp) .count(); // We shouldn't try to recover the stack from this command timeout. // If it's caused by a software bug, fix it. If it's a hardware bug, fix it. LOG_ERROR( LOG_TAG, "%s hci layer timeout waiting for response to a command. opcode: 0x%x", __func__, wait_entry->opcode); LOG_ERROR(LOG_TAG, "%s: Waited %d ms for a response to opcode: 0x%x", __func__, wait_time_ms, wait_entry->opcode); LOG_EVENT_INT(BT_HCI_TIMEOUT_TAG_NUM, wait_entry->opcode); lock.unlock(); } Loading