Skip to content

Commit

Permalink
Merge pull request #4 from dhalbert/match-prefix
Browse files Browse the repository at this point in the history
prefix -> match_prefixes
  • Loading branch information
evaherrada authored Jun 18, 2020
2 parents 10c82e3 + f6e3c0a commit 3db827a
Showing 1 changed file with 8 additions and 11 deletions.
19 changes: 8 additions & 11 deletions adafruit_ble_adafruit/adafruit_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,13 +66,14 @@ class AdafruitServerAdvertisement(Advertisement):
"""Advertise the Adafruit company ID and the board USB PID.
"""

prefix = struct.pack(
"<BBHBH",
0x6,
_MANUFACTURING_DATA_ADT,
_ADAFRUIT_COMPANY_ID,
struct.calcsize("<HH"),
_PID_DATA_ID,
match_prefixes = (
struct.pack(
"<BHBH",
_MANUFACTURING_DATA_ADT,
_ADAFRUIT_COMPANY_ID,
struct.calcsize("<HH"),
_PID_DATA_ID,
),
)
manufacturer_data = LazyObjectField(
ManufacturerData,
Expand All @@ -90,10 +91,6 @@ def __init__(self):
self.flags.general_discovery = True
self.flags.le_only = True

@classmethod
def matches(cls, entry):
return entry.matches(cls.prefix, all=False)


class AdafruitService(Service):
"""Common superclass for all Adafruit board services."""
Expand Down

0 comments on commit 3db827a

Please sign in to comment.