-
Notifications
You must be signed in to change notification settings - Fork 56
Add Apple Notification support and fix HID #38
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
This adds HID Server, Current Time Service and Apple Notification Service Client support.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very impressive you got ANCS working so fast, and the code really shows the value of the declarative service stuff.
initial_value = bytes(max_length) | ||
if max_length is None: | ||
max_length = 0 | ||
initial_value = b"" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
max_length
of 0 is not very useful. I think this should throw an error if both max_length
and initial_value
are unspecified.
I was worried that UARTService
might break also because it was assuming a default of 20, but I see that ComplexCharacteristic
still has a default of 20. Should ComplexCharacteristic
set default length=None
but also a similar check and not allow None
for both length
and initial_value
? I think so. Then StreamIn
and StreamOut
would explicitly pass in 20
, or have add an optional max_length=20
parameter, or maybe pass in all the length-related parameters.
And other services that assume a default of 20 should be checked and modified if necessary.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So, I started tweaking this but I think it's a bigger rabbit hole than it first appears. I'd rather wait to tackle this later with BLE MIDI.
It is a rabbit hole because the 20 bytes is knowledge that this layer shouldn't actually have because it varies with the MTU. Hardcoding it here limits the throughput of stream characteristics. I agree there should be a check that initial value or max length is set for fixed characteristics but it's best put in _bleio where the stack has knowledge of its limits.
I confirmed that the Color Picker demo still works due to the 20 default in ComplexCharacteristic.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just one thing! I agree with your other comments -- better done in _bleio
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
Updating https://github.com/adafruit/Adafruit_CircuitPython_BLE to 3.1.0 from 3.0.0: > Merge pull request adafruit/Adafruit_CircuitPython_BLE#40 from tannewt/support_magic_light > Merge pull request adafruit/Adafruit_CircuitPython_BLE#39 from dhalbert/bleradio-name-address > Merge pull request adafruit/Adafruit_CircuitPython_BLE#38 from tannewt/support_ancs
This also reworks the Sphinx rendering