Skip to content

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

Merged
merged 8 commits into from
Dec 5, 2019

Conversation

tannewt
Copy link
Member

@tannewt tannewt commented Dec 4, 2019

This also reworks the Sphinx rendering

@tannewt tannewt requested a review from dhalbert December 4, 2019 23:30
Copy link
Collaborator

@dhalbert dhalbert left a 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""
Copy link
Collaborator

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 ComplexCharacteristicstill 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.

Copy link
Member Author

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.

Copy link
Collaborator

@dhalbert dhalbert left a 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.

Copy link
Collaborator

@dhalbert dhalbert left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@dhalbert dhalbert merged commit 668b0bc into adafruit:master Dec 5, 2019
adafruit-adabot added a commit to adafruit/Adafruit_CircuitPython_Bundle that referenced this pull request Dec 9, 2019
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants