]> pilppa.org Git - lib1wire.git/blobdiff - src_test/test_w1_datalog_read.cc
Moved files that were not w1 specific to libplp.
[lib1wire.git] / src_test / test_w1_datalog_read.cc
index 2658c46ebffb26f2fb7a2681b2faa986847f167d..80822bd76a5016f17e882f3dfb0f52423ed0e332 100644 (file)
 #include <stdlib.h>
 
 #include <plp/log.h>
+#include <plp/Date.hh>
+#include <plp/DataReader.hh>
+#include <plp/DeviceConfig.hh>
 
-#include "Date.hh"
-#include "DataReader.hh"
-#include "DeviceConfig.hh"
 #include "Factory.hh"
-#include "W1Util.hh"
 
 using namespace std;
 using namespace plp;
@@ -58,15 +57,15 @@ int main(int argc, char** argv) {
        list<Device *>::iterator        list_iter;
 
        // default values than can be overwritten with parameters
-       loc     = "/tmp/w1data";
+       loc     = DeviceConfig::get_base_dir_name();
        if (argc > 1) {
                loc     = argv[1];
                log_info("storage location: %s\n", loc.c_str());
+               DeviceConfig::set_base_dir_name(loc);
        }
        else {
                log_warning("No storage location parameter given, using default location: %s\n", loc.c_str());
        }
-       DeviceConfig::set_base_dir_name(loc);
        dev_lst = Factory::get_device_list();
        for(list_iter = dev_lst.begin(); list_iter != dev_lst.end(); list_iter++) {
                device  = (Device *)*list_iter;