Merge pull request #72 from google/uael/public-str-address

address: add public information to the stringified value
This commit is contained in:
Lucas Abel
2022-11-14 17:16:47 -08:00
committed by GitHub
2 changed files with 5 additions and 2 deletions

View File

@@ -1753,7 +1753,10 @@ class Address:
'''
String representation of the address, MSB first
'''
return ':'.join([f'{x:02X}' for x in reversed(self.address_bytes)])
str = ':'.join([f'{x:02X}' for x in reversed(self.address_bytes)])
if not self.is_public:
return str
return str + '/P'
# -----------------------------------------------------------------------------

View File

@@ -59,7 +59,7 @@ def test_HCI_LE_Connection_Complete_Event():
# -----------------------------------------------------------------------------
def test_HCI_LE_Advertising_Report_Event():
address = Address('00:11:22:33:44:55')
address = Address('00:11:22:33:44:55/P')
report = HCI_LE_Advertising_Report_Event.Report(
HCI_LE_Advertising_Report_Event.Report.FIELDS,
event_type = HCI_LE_Advertising_Report_Event.ADV_IND,