I haven't used the pull requests yet, so that's why i'm posting it here.
The retry mechanism starts a nextCommand, but nextCommand sets the retry count to 0, this should only set the retry count to 0 when it's not a retry message.
/**
* Execute the next command in the subscribe queue.
* A queue is used because the calls have to be executed sequentially.
* If the read or write fails, the next command in the queue is executed.
*/
private void nextCommand() {
// Make sure only one thread can execute this method
synchronized (this) {
// If there is still a command being executed then bail out
if (commandQueueBusy) {
return;
}
// Check if we still have a valid gatt object
if (bluetoothGatt == null) {
Timber.e("gatt is 'null' for peripheral '%s', clearing command queue", getAddress());
commandQueue.clear();
commandQueueBusy = false;
return;
}
// Execute the next command in the queue
final Runnable bluetoothCommand = commandQueue.peek();
if (bluetoothCommand != null) {
commandQueueBusy = true;
I haven't used the pull requests yet, so that's why i'm posting it here. The retry mechanism starts a nextCommand, but nextCommand sets the retry count to 0, this should only set the retry count to 0 when it's not a retry message.
if(!isRetrying) nrTries = 0;