OSDN Git Service

Do not log unsolicited NOOP command complete events
authorAndre Eisenbach <eisenbach@google.com>
Tue, 26 Apr 2016 16:51:06 +0000 (09:51 -0700)
committerAndre Eisenbach <eisenbach@google.com>
Tue, 26 Apr 2016 16:58:56 +0000 (09:58 -0700)
Bug: 27744135
Change-Id: I683e3a9f0a116f83763ebcf4d0583ea1c89ef5b2

hci/src/hci_layer.c

index b169b03..9a9c5e6 100644 (file)
@@ -663,12 +663,17 @@ static bool filter_incoming_event(BT_HDR *packet) {
     STREAM_TO_UINT16(opcode, stream);
 
     wait_entry = get_waiting_command(opcode);
-    if (!wait_entry)
-      LOG_WARN(LOG_TAG, "%s command complete event with no matching command. opcode: 0x%x.", __func__, opcode);
-    else if (wait_entry->complete_callback)
+    if (!wait_entry) {
+      // TODO: Currently command_credits aren't parsed at all; here or in higher layers...
+      if (opcode != HCI_COMMAND_NONE) {
+        LOG_WARN(LOG_TAG, "%s command complete event with no matching command (opcode: 0x%04x).",
+            __func__, opcode);
+      }
+    } else if (wait_entry->complete_callback) {
       wait_entry->complete_callback(packet, wait_entry->context);
-    else if (wait_entry->complete_future)
+    } else if (wait_entry->complete_future) {
       future_ready(wait_entry->complete_future, packet);
+    }
 
     goto intercepted;
   } else if (event_code == HCI_COMMAND_STATUS_EVT) {