def ConnectionRequestCapture(): return Capture( HciMatchers.EventWithCode( hci_packets.EventCode.CONNECTION_REQUEST), lambda packet: hci_packets.ConnectionRequestView( HciMatchers.ExtractEventWithCode( packet.event, hci_packets.EventCode.CONNECTION_REQUEST)))
def get_connect_request(packet): if b'\x04\x0a' in packet.event: nonlocal connection_request connection_request = hci_packets.ConnectionRequestView( hci_packets.EventPacketView( bt_packets.PacketViewLittleEndian( list(packet.event)))) return True return False
def ConnectionRequestCapture(): return Capture( lambda packet: packet.payload[0:2] == b'\x04\x0a', lambda packet: hci_packets.ConnectionRequestView( hci_packets.EventPacketView( bt_packets.PacketViewLittleEndian(list(packet.payload)))))
def ConnectionRequestCapture(): return Capture(lambda packet: b'\x04\x0a' in packet.event, lambda packet: hci_packets.ConnectionRequestView( hci_packets.EventPacketView( bt_packets.PacketViewLittleEndian( list(packet.event)))))