def ConnectionCompleteCapture(): return Capture( HciMatchers.EventWithCode( hci_packets.EventCode.CONNECTION_COMPLETE), lambda packet: hci_packets.ConnectionCompleteView( HciMatchers.ExtractEventWithCode( packet.event, hci_packets.EventCode.CONNECTION_COMPLETE)))
def get_handle(packet_bytes): if b'\x03\x0b\x00' in packet_bytes: nonlocal conn_handle cc_view = hci_packets.ConnectionCompleteView( hci_packets.EventPacketView( bt_packets.PacketViewLittleEndian( list(packet_bytes)))) conn_handle = cc_view.GetConnectionHandle() return True return False
def ConnectionCompleteCapture(): return Capture( lambda packet: packet.payload[0:3] == b'\x03\x0b\x00', lambda packet: hci_packets.ConnectionCompleteView( hci_packets.EventPacketView( bt_packets.PacketViewLittleEndian(list(packet.payload)))))
def ConnectionCompleteCapture(): return Capture(lambda packet: b'\x03\x0b\x00' in packet.event, lambda packet: hci_packets.ConnectionCompleteView( hci_packets.EventPacketView( bt_packets.PacketViewLittleEndian( list(packet.event)))))