lib/device_value_checker.js
function performRetry(devRes, scriptRes) {
    		var currentAttempt = context.currentAttempt;
			var maxAttempts = context.maxAttempts;
			var delay = context.delay;
			debug('in performRetry', currentAttempt, maxAttempts, delay);
    		if(currentAttempt < maxAttempts) {
    			context.currentAttempt += 1;
    			setTimeout(checkDeviceValue, delay);
    		} else {
    			if(context.rejectOnError) {
    				reportResult(devRes, scriptRes, 'reject');
    			} else {
    				reportResult(devRes, scriptRes, 'resolve');
    			}
    		}
    	}
function performRetry(devRes, scriptRes) {
    		var currentAttempt = context.currentAttempt;
			var maxAttempts = context.maxAttempts;
			var delay = context.delay;
			debug('in performRetry', currentAttempt, maxAttempts, delay);
    		if(currentAttempt < maxAttempts) {
    			context.currentAttempt += 1;
    			setTimeout(checkDeviceValue, delay);
    		} else {
    			if(context.rejectOnError) {
    				reportResult(devRes, scriptRes, 'reject');
    			} else {
    				reportResult(devRes, scriptRes, 'resolve');
    			}
    		}
    	}
function performRetry ( devRes , scriptRes ) { var currentAttempt = context . currentAttempt ; var maxAttempts = context . maxAttempts ; var delay = context . delay ; debug ( 'in performRetry' , currentAttempt , maxAttempts , delay ) ; if ( currentAttempt < maxAttempts ) { context . currentAttempt += 1 ; setTimeout ( checkDeviceValue , delay ) ; } else { if ( context . rejectOnError ) { reportResult ( devRes , scriptRes , 'reject' ) ; } else { reportResult ( devRes , scriptRes , 'resolve' ) ; } } }
This function performs the re-try logic.  It re-attempts a read or reports the results.
This function performs the re - try logic . It re - attempts a read or reports the results .