Skip to content

Fix BLE transport initialization - #541

Open
HuagoSR wants to merge 1 commit into
ob-f:masterfrom
ISIP-CART:fix/ble-transport-initialization
Open

HuagoSR wants to merge 1 commit into
ob-f:masterfrom
ISIP-CART:fix/ble-transport-initialization

Conversation

@HuagoSR

@HuagoSR HuagoSR commented Sep 9, 2026

Copy link
Copy Markdown

Summary

  • initialize the BLE manager only once
  • select only the official OpenBot UART service, RX, and TX characteristics
  • allow writes only after UART notifications are enabled and clear stale state on failures or disconnects
  • label BLE receive broadcasts with from="ble" instead of from="usb"

Why

The Android robot app initialized its BLE manager twice, selected any writable/notifiable characteristic exposed by a peripheral, and treated a physical BLE connection as immediately writable. This could replace connection state during startup, select characteristics outside the OpenBot UART service, or dereference missing characteristics before service and notification setup completed.

This is the transport-only follow-up requested in #523. It does not include cart-following code, custom firmware support, write queuing, reconnect behavior, or developer notes.

Tests

  • ./gradlew :robot:testDebugUnitTest (11 tests, including 6 new BLE regression tests)
  • ./gradlew :robot:assembleDebug
  • repository google-java-format check on all four changed Java files

The build emits the existing Android Gradle Plugin/compileSdk and D8 navigation warnings; both tasks complete successfully.

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.

1 participant