]> pilppa.org Git - lib1wire.git/blobdiff - src/W1TemperatureSensor.cc
added W1CounterDevice
[lib1wire.git] / src / W1TemperatureSensor.cc
index 20dc3f388b9fb228736f9143c3d9188dc3b6b150..84db272a83d7aa17a1b9f58a1054f70ac75ec955 100644 (file)
@@ -5,7 +5,6 @@
  *      Author: lamikr
  */
 #include <fstream>
-#include <vector>
 #include <iostream>
 #include <sstream>
 #include <iomanip>
@@ -48,9 +47,9 @@ W1TemperatureSensor::W1TemperatureSensor(dirent *direntry, int family_code_param
        if (ifs.is_open() == false) {
                string text;
 
-               text    = get_time() + ": device type = temperature sensor, id = " + id + ", could not read file: " + slave_file;
+               text    = get_time() + ": device type = " + get_devicetype_name() + ", id = " + id + ", could not read file: " + slave_file;
                cout << text << endl;
-               cout << "verify that you have w1_therm kernel module loaded" << endl;
+               cout << "verify that you have w1_therm kernel module loaded." << endl;
        }
        else {
                ifs.close();
@@ -74,14 +73,13 @@ bool W1TemperatureSensor::is_supported_family_code(int family_code) {
 }
 
 string W1TemperatureSensor::get_value() {
-       vector<string>  text_file;
-       string                  temp;
-       string                  ret_val;
-       string                  last_line;
-       int                             pos;
-       int                             length;
-       string                  formatted_data;
-       int                             int_value;
+       string          temp;
+       string          ret_val;
+       string          last_line;
+       int             pos;
+       int             length;
+       string          formatted_data;
+       int             int_value;
 
        ret_val = "<could not read>";
        ifstream ifs(slave_file.c_str());