Replies: 1 comment
-
Very good points. For Apple platform we do spin up Coroutines in order to monitor out-of-band states of peripherals, but we could launch those later (at time of connect). Javascript kind of throws a wrench in things, whereas the The major drawback I see with passing a
I do favor keeping API surfaces smaller, so opportunities to do so are worth thinking about. Although in this case, I think
Similar to above, this does make sense as far as the implementation details of Kable, but the edge-case of developers calling |
Beta Was this translation helpful? Give feedback.
-
Hello,
thanks for nice library for BLE. I started using it in a project and it seems to work nice.
Here's a few questions/ideas I have for the peripheral.
Anyways we are giving CoroutineScope implicitly for connect() function and that coroutine scope should be used for the connection.
Maybe you could make the connect function awaitCancellation() and cancel the connect-functions's coroutine scope to make the connection to disconnect.
Then you could also remove the disconnect function and make the interface event neater. All the cleanup could be done at cancellation handler of the connect function.
Also the Identifier/BluetoothDevice/Advertisement could be given as parameter for connect function so it would not be necessary to give it when constructing the peripheral.
Just ideas. Maybe there are reasons behind these...
Beta Was this translation helpful? Give feedback.
All reactions