mirror of
https://github.com/pybricks/pybricks-code.git
synced 2026-09-14 10:35:11 +00:00
firmware/sagas: add delay after connecting
This adds a delay after connecting to a hub when flashing firmware via BLE before sending any commands. This gives the OS Bluetooth stack time to finish enumerating the Bluetooth device before we start trying to interact with the device. Hopefully this fixes issues for some people who are seeing problems while flashing firmware. Issue: https://github.com/orgs/pybricks/discussions/792
This commit is contained in:
@@ -6,8 +6,10 @@
|
||||
|
||||
### Fixed
|
||||
- Fixed app freezing when checking for updates and update server is unreachable ([pybricks-code#1299]).
|
||||
- Added delay to try to mitigate errors when flashing firmware on city hubs ([support#792]).
|
||||
|
||||
[pybricks-code#1299]: https://github.com/pybricks/pybricks-code/issues/1299
|
||||
[support#792]: https://github.com/orgs/pybricks/discussions/792
|
||||
|
||||
## [2.0.0-beta.10] - 2022-11-11
|
||||
|
||||
|
||||
@@ -393,6 +393,12 @@ function* handleFlashFirmware(action: ReturnType<typeof flashFirmware>): Generat
|
||||
return;
|
||||
}
|
||||
|
||||
// istanbul ignore if
|
||||
if (process.env.NODE_ENV !== 'test') {
|
||||
// give OS Bluetooth stack some time to settle
|
||||
yield* delay(1000);
|
||||
}
|
||||
|
||||
const nextMessageId = yield* getContext<() => number>('nextMessageId');
|
||||
|
||||
const infoAction = yield* put(infoRequest(nextMessageId()));
|
||||
|
||||
Reference in New Issue
Block a user