app/src/main/java/de/kai_morich/simple_bluetooth_le_terminal/SerialService.java
// Retry connection for a maximum of 5 minutes, with increasing interval between retries

Retry connection for a maximum of 5 minutes, with increasing interval between retries
Retry connection for a maximum of 5 minutes with increasing interval between retries
private boolean retryConnection() {
        if (retryConnectionStartTime == 0) {
            retryConnectionStartTime = Calendar.getInstance().getTimeInMillis();
        } else if ((reconnectTimeout != 0 && Calendar.getInstance().getTimeInMillis() - retryConnectionStartTime > reconnectTimeout) || macAddress == null) {
            return true;
        }
        if (this.socket != null) {
            socket.disconnect();
        }
        sendTaskerDebugIntent("Trying to reconnect");
        connectToMac(macAddress);
        return false;
    }
private boolean retryConnection ( ) { if ( retryConnectionStartTime == 0 ) { retryConnectionStartTime = Calendar . getInstance ( ) . getTimeInMillis ( ) ; } else if ( ( reconnectTimeout != 0 && Calendar . getInstance ( ) . getTimeInMillis ( ) - retryConnectionStartTime > reconnectTimeout ) || macAddress == null ) { return true ; } if ( this . socket != null ) { socket . disconnect ( ) ; } sendTaskerDebugIntent ( "Trying to reconnect" ) ; connectToMac ( macAddress ) ; return false ; }
Retry connection for a maximum of 5 minutes, with increasing interval between retries
Retry connection for a maximum of 5 minutes with increasing interval between retries