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 checked the documentation and FAQ without finding a solution
I checked to make sure that this issue has not already been filed
I'm sure that question is related to the library itself and not Bluetooth Low Energy or Classic in general. If that so, please post your question on StackOverflow.
I'm running the latest version
Question
We have encountered a significant inconsistency in the behavior of the timeout parameter in the connectToDevice method between iOS and Android platforms when using the react-native-ble-plx library.
Behavior:
On iOS, the timeout parameter functions as expected. It sets a limit on the duration for attempting a Bluetooth connection to a device.
On Android, however, the timeout parameter behaves differently and unexpectedly. Rather than acting solely as a connection attempt limiter, it appears to be functioning as a maximum duration for the connection itself. This means that once a connection is established, it automatically disconnects after the specified timeout duration. This behaviour is inconsistent with the iOS implementation and the expected functionality of a connection timeout. Also a disconnectListener gets fired up with an error of 'null'.
Steps to Reproduce:
Initialize the BLE manager and call the connectToDevice method with a timeout parameter on an Android device.
Observe that the device connects successfully but then disconnects after the specified timeout duration.
Perform the same steps on an iOS device and observe that the timeout only limits the connection attempt duration without affecting the connection's stability post-establishment.
The text was updated successfully, but these errors were encountered:
I can confirm the issue (3.1.2) on Android (Samsung S23). If the timeout is not specified, the device will keep the connection.
When the timeout is specified, the connection drops after some seconds with error: null as if it was disconnected by cancelDeviceConnection
A bit more information
The communication is done by writeCharacteristicWithoutResponseForDevice and monitorCharacteristicForDevice. May be this is helpful. No issues for iOS
Seems like on Android the timeout-timer is not reset after successful device connection or so, so it will trigger a disconnect after the timeout no matter connected successfully or not. On iOS it works.
Prerequisites
Question
We have encountered a significant inconsistency in the behavior of the timeout parameter in the connectToDevice method between iOS and Android platforms when using the react-native-ble-plx library.
Behavior:
On iOS, the timeout parameter functions as expected. It sets a limit on the duration for attempting a Bluetooth connection to a device.
On Android, however, the timeout parameter behaves differently and unexpectedly. Rather than acting solely as a connection attempt limiter, it appears to be functioning as a maximum duration for the connection itself. This means that once a connection is established, it automatically disconnects after the specified timeout duration. This behaviour is inconsistent with the iOS implementation and the expected functionality of a connection timeout. Also a disconnectListener gets fired up with an error of 'null'.
Steps to Reproduce:
Initialize the BLE manager and call the connectToDevice method with a timeout parameter on an Android device.
Observe that the device connects successfully but then disconnects after the specified timeout duration.
Perform the same steps on an iOS device and observe that the timeout only limits the connection attempt duration without affecting the connection's stability post-establishment.
The text was updated successfully, but these errors were encountered: