camel-temperature/src/main/java/io/silverspoon/device/OneWireTemperatureSensor.java
public float readTemperature() throws IOException {

      byte[] encoded = Files.readAllBytes(new File(deviceFile, "w1_slave").toPath());

      String tmp = new String(encoded);
      int tmpIndex = tmp.indexOf("t=");

      if (tmpIndex < 0) {
         throw new IOException("Could not read temperature!");
      }

      return Integer.parseInt(tmp.substring(tmpIndex + 2).trim()) / 1000f;
   }
public float readTemperature() throws IOException {

      byte[] encoded = Files.readAllBytes(new File(deviceFile, "w1_slave").toPath());

      String tmp = new String(encoded);
      int tmpIndex = tmp.indexOf("t=");

      if (tmpIndex < 0) {
         throw new IOException("Could not read temperature!");
      }

      return Integer.parseInt(tmp.substring(tmpIndex + 2).trim()) / 1000f;
   }
public float readTemperature ( ) throws IOException { byte [ ] encoded = Files . readAllBytes ( new File ( deviceFile , "w1_slave" ) . toPath ( ) ) ; String tmp = new String ( encoded ) ; int tmpIndex = tmp . indexOf ( "t=" ) ; if ( tmpIndex < 0 ) { throw new IOException ( "Could not read temperature!" ) ; } return Integer . parseInt ( tmp . substring ( tmpIndex + 2 ) . trim ( ) ) / 1000f ; }
Read temperature from the sensors.
@return temperature
@throws IOException
@see {@link TemperatureSensor#readTemperature()}
Read temperature from the sensors .