Skip to content

bleio: add central and scanner functionality, cleanup bleio API, some code restructure #1993

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 30 commits into from
Jul 18, 2019

Conversation

dhalbert
Copy link
Collaborator

@dhalbert dhalbert commented Jul 11, 2019

  • Add BLE central functionality to Service, Characteristic, and CharacteristicBuffer. Add new native classes Central and Scanner.
  • Deleted remnants of Device code (was combined central and peripheral).
  • Remove AddressType. Now it's just an integer. Address changed correspondingly.
  • Deleted AdvertisementData. BLE Advertisement data is now constructed in Python, in adafruit_ble.advertising.
  • Broadcaster removed as a separate class for beacons to avoid a lot of duplicated code. Now handled by Peripheral.
  • Stopped using bleio object struct fields directly in shared-bindings/. Use common-hal operations instead.
  • Updated copyrights in many places.
  • Moved some bleio object structs out of shared-module into ports/nrf/common-hal, as they were not necessarily port-independent.
  • Renamed static list_clear() in py/objlist.c to public mp_obj_list_clear(), because I had a use for it elsewhere.
  • Used unsigned constant in shared-module/displayio/TileGrid.c to fix gcc warning.
  • Updated frozen modules.

This new version of bleio requires an updated version of Adafruit_CircuitPython_BLE (adafruit_ble) library. Changes are in adafruit/Adafruit_CircuitPython_BLE#15.

dhalbert added 28 commits May 17, 2019 15:47
… now

2. Add scan response capability to advertising.
…n_hal

routines instead. Changes made but not yet tested.
@dhalbert dhalbert requested review from tannewt and jerryneedell July 11, 2019 23:16
Copy link
Member

@tannewt tannewt left a comment

Choose a reason for hiding this comment

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

This is super exciting! I like the simplifications you've done and the move to common hal. A number of small questions I have for now. I'm excited for the world where a scan reveals all of the circuitpython powered devices I have going around me.

@dhalbert dhalbert added this to the 5.x milestone Jul 17, 2019
Copy link
Member

@tannewt tannewt left a comment

Choose a reason for hiding this comment

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

Looks good to me! Thank you for your hard work on this.

@tannewt tannewt merged commit 74be29c into adafruit:master Jul 18, 2019
@dhalbert dhalbert deleted the ble-scanner branch July 19, 2019 14:29
This was referenced Jul 31, 2019
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