]> pilppa.org Git - lib1wire.git/blobdiff - src/W1Device.cc
Started defining generic device type base classes that could be used
[lib1wire.git] / src / W1Device.cc
index 429a5e822baacb581aa17bcf9bf5c3b10ee4aee5..4c108e3857fdb500c5a296c3f3b2f8809212cc72 100644 (file)
@@ -14,7 +14,7 @@
 
 #include "DeviceConfig.hh"
 #include "Factory.hh"
-#include "Store.hh"
+#include "StoreDay.hh"
 #include "W1Device.hh"
 
 using namespace std;
@@ -32,7 +32,7 @@ W1Device::W1Device(int family_code_param,
        temp_str        = W1_SLAVE_FILE;
        dir_path        = rootdir + "/" + direntry_param->d_name;
        slave_file      = dir_path + "/" + temp_str;
-       log_debug("w1 data file: %s\n", slave_file.c_str());
+       log_debug("1-wire device's data file: %s\n", slave_file.c_str());
        family_code     = family_code_param;
        id              = device_id_param;
        name            = "";
@@ -85,7 +85,7 @@ void W1Device::printout() {
        Data    *data;
        string  text;
 
-       data    = get_and_collect_data();
+       data    = get_data();
        if (data != NULL) {
                text    = data->to_string();
                cout << text << endl;
@@ -104,8 +104,7 @@ string W1Device::to_string(double dbl_val, int digit_count) {
        return ret_val;
 }
 
-
-Data *W1Device::get_and_collect_data() {
+Data *W1Device::get_data() {
        Data            *ret_val;
        vector<double>  *vect;
 
@@ -130,7 +129,7 @@ void W1Device::save_data() {
        int                     dec_precision;
 
        dec_precision   = get_data_decimal_precision();
-       Store::save(id, &memory_cache, dec_precision);
+       StoreDay::save(id, &memory_cache, dec_precision);
        for(iter = memory_cache.begin(); iter != memory_cache.end(); iter++) {
                data    = (Data *)*iter;
                delete(data);