add snoop support

This commit is contained in:
Gilles Boccon-Gibod
2023-03-02 14:34:49 -08:00
parent e7b39c4188
commit a5275ade29
4 changed files with 160 additions and 0 deletions

View File

@@ -1846,6 +1846,8 @@ class HCI_Packet:
Abstract Base class for HCI packets
'''
hci_packet_type: int
@staticmethod
def from_bytes(packet):
packet_type = packet[0]
@@ -1864,6 +1866,9 @@ class HCI_Packet:
def __init__(self, name):
self.name = name
def __bytes__(self) -> bytes:
raise NotImplementedError
def __repr__(self) -> str:
return self.name
@@ -1875,6 +1880,9 @@ class HCI_CustomPacket(HCI_Packet):
self.hci_packet_type = payload[0]
self.payload = payload
def __bytes__(self) -> bytes:
return self.payload
# -----------------------------------------------------------------------------
class HCI_Command(HCI_Packet):