OSDN Git Service

Add ISO type support on btsnooz.py script
authorAlice Kuo <aliceypkuo@google.com>
Fri, 15 Jan 2021 03:39:52 +0000 (11:39 +0800)
committerAlice Kuo <aliceypkuo@google.com>
Mon, 18 Jan 2021 02:49:20 +0000 (02:49 +0000)
Support to decode the ISO packet from the compressed btsnoop in
bugreport.

Bug: 150670922
Bug: 177616528
Test: btsnooz.py bugreport-*.txt which contain ISO traffic.
Tag: #feature
Change-Id: I070ec3023ed2ef65c3d1fce90dcfe2b9d695a89f

tools/scripts/btsnooz.py

index 95d59ce..4f70f9e 100755 (executable)
@@ -33,9 +33,11 @@ import zlib
 TYPE_IN_EVT = 0x10
 TYPE_IN_ACL = 0x11
 TYPE_IN_SCO = 0x12
+TYPE_IN_ISO = 0x17
 TYPE_OUT_CMD = 0x20
 TYPE_OUT_ACL = 0x21
 TYPE_OUT_SCO = 0x22
+TYPE_OUT_ISO = 0x2d
 
 
 def type_to_direction(type):
@@ -44,7 +46,7 @@ def type_to_direction(type):
   0 = sent packet
   1 = received packet
   """
-    if type in [TYPE_IN_EVT, TYPE_IN_ACL, TYPE_IN_SCO]:
+    if type in [TYPE_IN_EVT, TYPE_IN_ACL, TYPE_IN_SCO, TYPE_IN_ISO]:
         return 1
     return 0
 
@@ -61,6 +63,8 @@ def type_to_hci(type):
         return '\x03'
     if type == TYPE_IN_EVT:
         return '\x04'
+    if type == TYPE_IN_ISO or type == TYPE_OUT_ISO:
+        return '\x05'
     raise RuntimeError("type_to_hci: unknown type (0x{:02x})".format(type))