Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 12 additions & 12 deletions src/bluetooth_data_tools/gap.py
Original file line number Diff line number Diff line change
Expand Up @@ -221,10 +221,10 @@ def _uncached_parse_advertisement_bytes(
manufacturer_data[gap_data[start] | (gap_data[start + 1] << 8)] = gap_data[
splice_pos:end
]
elif gap_type_num in {
TYPE_16BIT_SERVICE_UUID_COMPLETE,
TYPE_16BIT_SERVICE_UUID_MORE_AVAILABLE,
}:
elif (
gap_type_num == TYPE_16BIT_SERVICE_UUID_COMPLETE
or gap_type_num == TYPE_16BIT_SERVICE_UUID_MORE_AVAILABLE
):
if service_uuids is _EMPTY_SERVICE_UUIDS:
service_uuids = []
# Parse multiple 16-bit UUIDs (each is 2 bytes)
Expand All @@ -233,10 +233,10 @@ def _uncached_parse_advertisement_bytes(
service_uuids.append(
_cached_uint16_bytes_as_uuid(gap_data[i : i + 2])
)
elif gap_type_num in {
TYPE_32BIT_SERVICE_UUID_COMPLETE,
TYPE_32BIT_SERVICE_UUID_MORE_AVAILABLE,
}:
elif (
gap_type_num == TYPE_32BIT_SERVICE_UUID_COMPLETE
or gap_type_num == TYPE_32BIT_SERVICE_UUID_MORE_AVAILABLE
):
if service_uuids is _EMPTY_SERVICE_UUIDS:
service_uuids = []
# Parse multiple 32-bit UUIDs (each is 4 bytes)
Expand All @@ -245,10 +245,10 @@ def _uncached_parse_advertisement_bytes(
service_uuids.append(
_cached_uint32_bytes_as_uuid(gap_data[i : i + 4])
)
elif gap_type_num in {
TYPE_128BIT_SERVICE_UUID_MORE_AVAILABLE,
TYPE_128BIT_SERVICE_UUID_COMPLETE,
}:
elif (
gap_type_num == TYPE_128BIT_SERVICE_UUID_COMPLETE
or gap_type_num == TYPE_128BIT_SERVICE_UUID_MORE_AVAILABLE
):
if service_uuids is _EMPTY_SERVICE_UUIDS:
service_uuids = []
service_uuids.append(_cached_uint128_bytes_as_uuid(gap_data[start:end]))
Expand Down
Loading