public void registerSensor(Sensor s,int i){
  if ((i < 0) || (i > (inputBits[nodeType] - 1)) || (i > MAXSENSORS)) {
    log.error("Unexpected sensor ordinal in registerSensor: " + Integer.toString(i + 1));
    return;
  }
  hasActiveSensors=true;
  if (sensorArray[i] == null) {
    sensorArray[i]=s;
    if (lastUsedSensor < i) {
      lastUsedSensor=i;
    }
  }
 else {
    log.warn("multiple registration of same sensor: CS" + Integer.toString((getNodeAddress() * SerialSensorManager.SENSORSPERNODE) + i + 1));
  }
}

public void registerSensor ( Sensor s , int i ) { if ( ( i < 0 ) || ( i > ( inputBits [ nodeType ] - 1 ) ) || ( i > MAXSENSORS ) ) { log . error ( "Unexpected sensor ordinal in registerSensor: " + Integer . toString ( i + 1 ) ) ; return ; } hasActiveSensors = true ; if ( sensorArray [ i ] == null ) { sensorArray [ i ] = s ; if ( lastUsedSensor < i ) { lastUsedSensor = i ; } } else { log . warn ( "multiple registration of same sensor: CS" + Integer . toString ( ( getNodeAddress ( ) * SerialSensorManager . SENSORSPERNODE ) + i + 1 ) ) ; } }
the numbers here are 0 to maxsensors , not 1 to maxsensors .
