From 16d33199eb144d575bbd69dfd27615edb8aff0ed Mon Sep 17 00:00:00 2001 From: SneKarnataki Date: Wed, 20 Sep 2023 05:30:29 +0000 Subject: [PATCH] Change in sdp.py file while testing hid profile, TEXT_STRING: lambda x: DataElement(DataElement.TEXT_STRING, x.decode('utf8')) changed to TEXT_STRING: lambda x: DataElement(DataElement.TEXT_STRING, x) as we were facing error "UnicodeDecodeError: 'utf-8' codec can't decode byte 0xa1 in position 4: invalid start byte" while fetching sdp records. --- bumble/sdp.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bumble/sdp.py b/bumble/sdp.py index ae013017..06be980c 100644 --- a/bumble/sdp.py +++ b/bumble/sdp.py @@ -167,7 +167,7 @@ class DataElement: UUID: lambda x: DataElement( DataElement.UUID, core.UUID.from_bytes(bytes(reversed(x))) ), - TEXT_STRING: lambda x: DataElement(DataElement.TEXT_STRING, x.decode('utf8')), + TEXT_STRING: lambda x: DataElement(DataElement.TEXT_STRING, x), BOOLEAN: lambda x: DataElement(DataElement.BOOLEAN, x[0] == 1), SEQUENCE: lambda x: DataElement( DataElement.SEQUENCE, DataElement.list_from_bytes(x)