You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am calling your library (version 1.7.8) function ble.withPromises.connect(scannedDeviceId, mySuccessCallbackFunction, myErrorCallbackFunction);
also tried ble.connect(scannedDeviceId, mySuccessCallbackFunction, myErrorCallbackFunction);
Both with the same behaviour (see case 4).
I am connecting to a ble device from our capacitor (version 6.0.0) app on an iPhone or android phone (iPhone 13 mini or Samsung Galaxy S10e).
Cases:
iOS and Android phone: returning PeripheralDataExtended data in mySuccessCallbackFunction successfully if ble is enabled.
iOS and Android phone: entering myErrorCallbackFunction if ble is disabled with errorMessage "Ble is disabled" from BLEError interface. This shows that myErrorCallbackFunction is working.
Android: entering myErrorCallbackFunction if ble is enabled and peripheral is not reachable (e.g. distance from phone to ble device) - errorMessage "Peripheral disconnected" from BLEError interface
iOS: not entering myErrorCallbackFunction if ble is enabled and peripheral is not reachable. There is no response from neither callback function. Also there is no "Peripheral disconnected" errorMesage like in Android. Is this intended behaviour, or some bug in the connect() function?
Thanks for your help.
The text was updated successfully, but these errors were encountered:
What you are describing here are differences between how Android and iOS treat connections.
iOS has no notion of a connection timeout, so the connect call continues until the peripheral is found and a connection is attempted. Meanwhile, Android has a connection timeout that reports roughly 20-30s after attempting to connect.
I don't have any plans to change this behaviour, as it's been this way in the plugin for too long. If you have the time though, I'd happily accept a pull request that added these notes to the documentation for connect to make this behaviour clearer to developers?
I am calling your library (version 1.7.8) function
ble.withPromises.connect(scannedDeviceId, mySuccessCallbackFunction, myErrorCallbackFunction);
also tried
ble.connect(scannedDeviceId, mySuccessCallbackFunction, myErrorCallbackFunction);
Both with the same behaviour (see case 4).
I am connecting to a ble device from our capacitor (version 6.0.0) app on an iPhone or android phone (iPhone 13 mini or Samsung Galaxy S10e).
Cases:
PeripheralDataExtended
data inmySuccessCallbackFunction
successfully if ble is enabled.myErrorCallbackFunction
if ble is disabled with errorMessage "Ble is disabled" from BLEError interface. This shows thatmyErrorCallbackFunction
is working.myErrorCallbackFunction
if ble is enabled and peripheral is not reachable (e.g. distance from phone to ble device) - errorMessage "Peripheral disconnected" from BLEError interfacemyErrorCallbackFunction
if ble is enabled and peripheral is not reachable. There is no response from neither callback function. Also there is no "Peripheral disconnected" errorMesage like in Android. Is this intended behaviour, or some bug in theconnect()
function?Thanks for your help.
The text was updated successfully, but these errors were encountered: