Merge pull request #135 from google/gbg/snoop

add snoop support
This commit is contained in:
Gilles Boccon-Gibod
2023-03-07 09:16:33 -08:00
committed by GitHub
4 changed files with 160 additions and 0 deletions

View File

@@ -1850,6 +1850,8 @@ class HCI_Packet:
Abstract Base class for HCI packets
'''
hci_packet_type: int
@staticmethod
def from_bytes(packet):
packet_type = packet[0]
@@ -1868,6 +1870,9 @@ class HCI_Packet:
def __init__(self, name):
self.name = name
def __bytes__(self) -> bytes:
raise NotImplementedError
def __repr__(self) -> str:
return self.name
@@ -1879,6 +1884,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):