Repository navigation
Add an opt-in macOS BLE bench transport - #611
Draft
rafael2reis wants to merge 1 commit into
Draft
rafael2reis wants to merge 1 commit into
rafael2reis wants to merge 1 commit into
Conversation
Validate GATT and packet integrity, isolate asynchronous BLE IO, and support bounded TOC-based telemetry with mandatory flight/write guards. Preserve existing transports and provide simulated integration tests and documentation. Assisted-by: OpenAI Codex
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add an opt-in macOS BLE transport for bench inspection and telemetry without Crazyradio. Normal driver registration remains unchanged;
init_drivers(enable_ble_driver=True)adds BLE, with Bleak installed only through the optionalbleextra.The driver validates the selected CoreBluetooth UUID/name and GATT profile, drains startup messages, and checks byte-exact 8/20/31-byte echo before cflib setup. It uses documented UP/DOWN framing, bounded queues and timeouts, health echoes, and a dedicated event-loop thread. BLE retry timing is adjusted without changing other transports. Log initialization avoids a global reset and cleanup targets only blocks successfully created by this session.
This initial version is always bench-only: flight/supervisor commands, parameter writes, raw-memory operations and bootloader payloads are blocked. There is no URI switch to enable flight. TOC/parameter reads and bounded TOC-backed logging are allowed. A short-circuit before retry scheduling prevents blocked requests from creating retry timers.
Validation:
Corrected nRF UP framing is required; see bitcraze/crazyflie2-nrf-firmware#127. macOS is the only hardware-tested platform. The URI currently uses a CoreBluetooth UUID; Linux/Windows addressing, multiple devices and flight are not claimed supported. Service discovery does not authenticate the device. Scanning all registered drivers can still invoke radio and disable BLE on the drone; the BLE-only scanner is documented.
Maintainer feedback is requested on the initial platform scope, mandatory bench policy and location of transport-specific setup/timeout behavior. The separate updater/checksum experiment and hardware identifiers are not included.
This is a draft. Developed with OpenAI Codex assistance; hardware behavior was exercised on the contributor's Mac/Crazyflie. Draft pending contributor and maintainer review.