RxAndroidBle
RxAndroidBle copied to clipboard
[Idea] Add custom operation timeout for each operation rather than for the whole connection
Hello! First of all, thanks for the amazing library.
I am using it in one of my projects and I came across this situation I've mentioned in a Stackoverflow question. To sum up, what I want to achieve is to change the operation timeout after the connection is already established.
However, after taking a look at different commits made in the past to address the issues #118 and #321 , I've also come up with the idea that, instead of being able to change the timeout for the whole connection after being established, it would be even better to have an extra method for writing/reading characteristics that accepts a timeout
parameter for that specific operation. Then, if it is not provided, will use the one that was set while establishing the connection or the default 30s.
PD: I would love to be able to help adding this functionality by myself and make a PR, but I am not confident enough with my programming skills. I feel I could do it in this version of the code #118, but I got lost after the changes made in #321 .
Just an idea, maybe it is not possible to do. Cheers, Diego.
Finally, I found a better workaround for the just works bonding and operations on encrypted characteristics problem. I posted it in this comment..
Anyway, maybe the timeout idea is still useful for something else.
Cheers.
Hmmm... I am actually thinking if the operation timeout should not be longer if bonding is in progress. If the OS will not callback the BluetoothGattCallback
it will not be possible to call any more actions on BluetoothGatt
anyway regardless of the library timeout