Improve Broadcast Scanning

This commit is contained in:
Josh Wu
2024-11-15 17:57:13 +08:00
parent 5a72eefb89
commit c88b32a406
7 changed files with 233 additions and 61 deletions

View File

@@ -1624,6 +1624,9 @@ class AdvertisingData:
[bytes([len(x[1]) + 1, x[0]]) + x[1] for x in self.ad_structures]
)
def to_bytes(self) -> bytes:
return bytes(self)
def to_string(self, separator=', '):
return separator.join(
[AdvertisingData.ad_data_to_string(x[0], x[1]) for x in self.ad_structures]