src/droidplug/java/.../Peripheral.java discoverServices (~L296-301): the onServicesDiscovered command callback does
if (status != BluetoothGatt.GATT_SUCCESS) {
throw new RuntimeException("Unable to discover services");
}
outside of asyncWithFuture, so the exception escapes to the Binder thread instead of completing the future.
Failure scenario: discovery returns 129/133 → discover_services() hangs forever and the peripheral's command queue is permanently wedged.
Fix direction: wrap in asyncWithFuture so the failure completes the future exceptionally and the queue advances.
src/droidplug/java/.../Peripheral.javadiscoverServices(~L296-301): theonServicesDiscoveredcommand callback doesoutside of
asyncWithFuture, so the exception escapes to the Binder thread instead of completing the future.Failure scenario: discovery returns 129/133 →
discover_services()hangs forever and the peripheral's command queue is permanently wedged.Fix direction: wrap in
asyncWithFutureso the failure completes the future exceptionally and the queue advances.