Advertisement-matching prefixes are now specified as tuples of prefixes. You no longer need to count up the bytes and include a length byte in front of each subprefix. The class attribute has been renamed from prefix to match_prefixes. This is an incompatible change; a few other libraries will need to change also. PR's will be opened for those libraries.
All the definitions of __get__(self, obj, cls) now check for obj is None, and return self in that case. This is because MicroPython/CircuitPython don't invoke descriptor protocol on obj's class, but CPython does. So to be uniform, when running in CPython, check for this case and just return the actual object.
Catch when microcontroller is not present, such as when running in CPython.
Windows doesn't have os.uname(), so catch that.
Make it easier and clearer for an Advertisement subclass to change the behavior of matches() from all to any, by providing a match_prefixes(cls, entry, all_=True) class method to call. Note that the arg is called all_, because it otherwise conflicts with the builtin function all(). See https://github.com/adafruit/circuitpython/issues/3007 for a related issue.
prefix
tomatch_prefixes
. This is an incompatible change; a few other libraries will need to change also. PR's will be opened for those libraries.__get__(self, obj, cls)
now check forobj is None
, and returnself
in that case. This is because MicroPython/CircuitPython don't invoke descriptor protocol onobj
's class, but CPython does. So to be uniform, when running in CPython, check for this case and just return the actual object.microcontroller
is not present, such as when running in CPython.os.uname()
, so catch that.Advertisement
subclass to change the behavior ofmatches()
fromall
toany
, by providing amatch_prefixes(cls, entry, all_=True)
class method to call. Note that the arg is calledall_
, because it otherwise conflicts with the builtin functionall()
. See https://github.com/adafruit/circuitpython/issues/3007 for a related issue.Fixes #82.