Skip to content
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

Add ability to disable BLE workflow #5089

Merged
merged 2 commits into from Aug 5, 2021

Conversation

tannewt
Copy link
Member

@tannewt tannewt commented Aug 3, 2021

Call supervisor.disable_ble_workflow() and the BLE workflow will
be disabled until the chip is reset.

This also includes a couple fixes:

  1. Terminals can now be deinit by setting the tilegrid to NULL. This
    prevents using the tilegrid before display is init.
  2. Fix BLE serial send amount when sending more than a single packet.

Fixes #5049

Call `supervisor.disable_ble_workflow()` and the BLE workflow will
be disabled until the chip is reset.

This also includes a couple fixes:
1. Terminals can now be deinit by setting the tilegrid to NULL. This
  prevents using the tilegrid before display is init.
2. Fix BLE serial send amount when sending more than a single packet.

Fixes micropython#5049
@tannewt
Copy link
Member Author

tannewt commented Aug 4, 2021

@jepler I fixed the build so please take a look.

Copy link
Member

@jepler jepler left a comment

Choose a reason for hiding this comment

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

Thanks, and thanks for some quick answers in discord about the change. No problems spotted, but no testing performed.

@tannewt tannewt merged commit e3fa6e2 into adafruit:main Aug 5, 2021
@ThomasAtBBTF
Copy link

ThomasAtBBTF commented Aug 6, 2021

This feature does exactly what I was asking for in #5049
Thank you!
I now can call supervisor.disable_ble_workflow() in boot.py and no "strange" devices are appearing anymore after powering on the board.
As soon as the code in for my Bluetooth HID device is ready in code.py the correct advertising starts.

Remains the question: Is one of the initial devices providing the ability for "over-the-air" updates and if so, can the original workflow be reenabled by CiruitPython code?

@tannewt
Copy link
Member Author

tannewt commented Aug 6, 2021

BLE provides functionality via services. A device can advertise different services at different times and provide different services at different times. Advertising only influences when something chooses to connect to another device. It doesn't limit what services are available once a connection is established.

If you want the BLE workflow stuff, then leave it enabled. The advertisements the core does shouldn't prevent HID from working because the HID advertisement will replace the first one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants