File tree Expand file tree Collapse file tree 2 files changed +14
-3
lines changed Expand file tree Collapse file tree 2 files changed +14
-3
lines changed Original file line number Diff line number Diff line change @@ -304,7 +304,15 @@ def get_prefix_bytes(cls):
304
304
return cls ._prefix_bytes
305
305
306
306
@classmethod
307
- def matches (cls , entry , all_ = True ):
307
+ def matches (cls , entry ):
308
+ """Returns ``True`` if the given `_bleio.ScanEntry` advertisement fields
309
+ matches all of the given prefixes in the `match_prefixes` tuple attribute.
310
+ Subclasses may override this to match any instead of all.
311
+ """
312
+ return cls .matches_prefixes (entry , all_ = True )
313
+
314
+ @classmethod
315
+ def matches_prefixes (cls , entry , * , all_ ):
308
316
"""Returns ``True`` if the given `_bleio.ScanEntry` advertisement fields
309
317
match any or all of the given prefixes in the `match_prefixes` tuple attribute.
310
318
If `all_` is ``True``, all the prefixes must match. If ``all_`` is ``False``,
Original file line number Diff line number Diff line change @@ -184,8 +184,11 @@ def __init__(self, *services):
184
184
self .flags .le_only = True
185
185
186
186
@classmethod
187
- def matches (cls , entry , all_ = False ):
188
- return super ().matches (entry , all_ = all_ )
187
+ def matches (cls , entry ):
188
+ """Only one kind of service list need be present in a ProvideServicesAdvertisement,
189
+ so override the default behavior and match any prefix, not all.
190
+ """
191
+ return cls .matches_prefixes (entry , all_ = False )
189
192
190
193
191
194
class SolicitServicesAdvertisement (Advertisement ):
You can’t perform that action at this time.
0 commit comments