Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit af3934cf authored by Alice Kuo's avatar Alice Kuo Committed by Automerger Merge Worker
Browse files

Support ase attribute handle assignment as dump ISO data am: c35fd28f

Original change: https://android-review.googlesource.com/c/platform/packages/modules/Bluetooth/+/1952558

Change-Id: I5757321d84b3fef48cba1153c4e1e4cc8b31619e
parents 7b5c2220 c35fd28f
Loading
Loading
Loading
Loading
+13 −0
Original line number Diff line number Diff line
@@ -117,6 +117,7 @@ AUDIO_LOCATION_CENTER = 0x04
packet_number = 0
debug_enable = False
add_header = False
ase_handle = 0xFFFF


class Connection:
@@ -231,6 +232,10 @@ def parse_att_read_by_type_rsp(packet, connection_handle):

def parse_att_write_cmd(packet, connection_handle, timestamp):
    attribute_handle, packet = unpack_data(packet, 2, False)
    global ase_handle
    if ase_handle != 0xFFFF:
       connection_map[connection_handle].ase_handle = ase_handle

    if connection_map[connection_handle].ase_handle == attribute_handle:
        if debug_enable:
            debug_print("Action with ASE Control point")
@@ -497,18 +502,26 @@ def main():
        "--header",
        help="Add the header for LC3 Conformance Interoperability Test Software V.1.0.3.",
        action="store_true")
    parser.add_argument(
        "--ase_handle",
        help="Set the ASE handle manually.",
        type=int)

    argv = parser.parse_args()
    BTSNOOP_FILE_NAME = argv.btsnoop_file

    global debug_enable
    global add_header
    global ase_handle
    if argv.verbose:
        debug_enable = True

    if argv.header:
        add_header = True

    if argv.ase_handle:
        ase_handle = int(argv.ase_handle)

    with open(BTSNOOP_FILE_NAME, "rb") as btsnoop_file:
        if btsnoop_file.read(16) != BTSNOOP_HEADER:
            print("Invalid btsnoop header")