Skip to content

Commit 10af94a

Browse files
committed
pbio/drv/bluetooth_cc2640: Fix failed read not raising.
When pairing with an Xbox Controller, reading a specific characteristic will fail if the controller was never paired. This is our way to find out. But the error was not raised, so it would wait indefinitely on the next discover command that would not complete.
1 parent 352bb8f commit 10af94a

2 files changed

Lines changed: 2 additions & 1 deletion

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
- Fixed Powered Up remote light getting the wrong color ([support#2497]).
2929
- Fix shutdown animation not visible when shutting down due to Bluetooth glitches.
3030
- Fixed Powered Up remote raising the wrong exception on timeout.
31+
- Fixed Xbox Controller connection waiting indefinitely if it isn't in pairing mode.
3132

3233
[support#1962]: https://github.com/pybricks/support/issues/1962
3334
[support#2468]: https://github.com/pybricks/support/issues/2468

lib/pbio/drv/bluetooth/bluetooth_stm32_cc2640.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -721,7 +721,7 @@ pbio_error_t pbdrv_bluetooth_peripheral_read_characteristic_func(pbio_os_state_t
721721

722722
DEBUG_PRINT("Read %04x with status %d\n", peri->char_now->handle, status);
723723

724-
PBIO_OS_ASYNC_END(PBIO_SUCCESS);
724+
PBIO_OS_ASYNC_END(ble_error_to_pbio_error(status));
725725
}
726726

727727
pbio_error_t pbdrv_bluetooth_peripheral_write_characteristic_func(pbio_os_state_t *state, void *context) {

0 commit comments

Comments
 (0)