Comments (4)
HI! I'm not sure I follow. The CentralManager
is not an Actor, only the waitUntilReadyExecutor
. I think it might be more correct to pass in a conditional block to the enqueue
function, so that after it awaits it checks the given conditional block before enqueuing. I haven't encountered this issue yet, but I'll put it in the backlog.
For now timeouts are not handled by the library. But yes, I hope to eventually add convenience overloads.
from asyncbluetooth.
Hi! We've encountered this bug now too. Unfortunately we don't see this on all devices and it doesn't happen every time. We couldn't find the common denominator. I created a timeout mechanism around the waitUntilReady that retries it it times out. If the bug presents itself and the retry happens, the waitUntilReady always returns directly. I did walk through this repo trying to find out why this happens, but unfortunately your "magic" is too difficult for me :).
Please let me know if you could use more information.
from asyncbluetooth.
Did some extra digging. I guess there is a very small window inside waitUntilReady where first you check the state and afterwards you enqueue to the waitUntilReadyExecutor. If centralManagerDidUpdateState is called in between, then to my knowledge the executor will never be called (until the state changes, but that'd only happen when bluetooth is manually disabled/enabled). @manolofdez What do you think?
from asyncbluetooth.
Yeah. Actually, it should only hold up that first call to waitUntilReady
. If it changed before enqueuing it, subsequent calls should be able to continue because the waitUntilReady
function will first check immediately before enqueuing.
That said, we can check whether Bluetooth is ready in the enqueued block to avoid waiting indefinitely on that first call. I'll merge this. If you can, please let me know if this fixes it.
from asyncbluetooth.
Related Issues (20)
- Notify support HOT 2
- QUESTION: Why .eventPublisher starts scanning for peripherals.
- setNotifyValue - How to correctly stop notifications? HOT 1
- Unable to connect to X because a connection attempt is already in progress after turning off/on bluetooth HOT 2
- How to read characteristics with 16 bit UUID HOT 1
- Crash while writing on service to which we have subscribed notify on update value HOT 2
- Crash when switching off bluetooth while scan is ongoing HOT 3
- Crash when chaining operations in different Tasks HOT 2
- Peripheral.setNotifyValue is not called when we write value manually HOT 1
- Suggestion about CBConnectPeripheralOptionEnableAutoReconnect HOT 1
- Please create a new release with latest changes HOT 1
- Feature request: Changing behaviour of the logger HOT 2
- Noob question: Why is CentralManager eventPublisher not an AsyncStream? HOT 1
- Privacy manifest (PrivacyInfo.xcprivacy) missing HOT 1
- Doesn't compile with BUILD_LIBRARY_FOR_DISTRIBUTION=YES HOT 4
- Add Sendable for strict concurrency set to complete in Xcode compiler settings HOT 3
- peripheral.setNotifyValue(Bool, forCharacteristicWithCBUUID:) method never responds HOT 3
- Xcode 16 crash on scan HOT 4
- characteristicValueUpdatedPublisher causes runtime warning in Swift 6 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from asyncbluetooth.