]> pilppa.org Git - lib1wire.git/blobdiff - src/W1CounterDevice.cc
storage data cleanup. allow specifying storage dir location
[lib1wire.git] / src / W1CounterDevice.cc
index d33956293e1b4faf4230ceb78ae899a5501da8a9..2566e1d4888114c0ccad31f28965a510948f39a0 100644 (file)
@@ -59,10 +59,10 @@ string W1CounterDevice::get_value() {
                while(getline(ifs, value_line)) {
                        length  = value_line.length();
                        if (length > 0) {
-                               pos     = value_line.find("c=");
+                               pos     = value_line.find("crc=YES c=");
                                if ((pos >= 0) &&
-                                   (pos + 2 < length)) {
-                                       value_line      = value_line.substr(pos + 2);
+                                   (pos + 10 < length)) {
+                                       value_line      = value_line.substr(pos + 10);
                                }
                                else {
                                        value_line      = "";
@@ -80,7 +80,6 @@ string W1CounterDevice::get_value() {
                }
                ifs.close();
        }
-       add_to_memory_cache(ret_val);
        return ret_val;
 }