From c9e22a6121454294680c9f99f9546e476acf00a7 Mon Sep 17 00:00:00 2001 From: Noam Rathaus Date: Sun, 9 Apr 2023 13:05:02 +0300 Subject: [PATCH] Implement fix for https://github.com/bmwcarit/pypbap/issues/5 --- pbapclient.py | 2 +- pbapheaders.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/pbapclient.py b/pbapclient.py index 324c6bf..263c421 100644 --- a/pbapclient.py +++ b/pbapclient.py @@ -48,7 +48,7 @@ def pull_phonebook( "ListStartOffset": headers.ListStartOffset(list_startoffset), } application_parameters = headers.App_Parameters(data, encoded=False) - header_list = [headers.PBAPType("x-bt/phonebook")] + header_list = [headers.PBAPType(b"x-bt/phonebook")] if application_parameters.data: header_list.append(application_parameters) diff --git a/pbapheaders.py b/pbapheaders.py index 88ceee9..29dcc9f 100644 --- a/pbapheaders.py +++ b/pbapheaders.py @@ -70,11 +70,11 @@ def encode(self, data): def decode(self): headers, data = super(VariableLengthProperty, self).decode() - tagid, length = headers + _, length = headers return struct.unpack(self.fmt.format(len=length), data)[0] -class PBAPType(UnicodeHeader): +class PBAPType(Type): code = 0x42