#include <plp/log.h>
+#include "W1Store.hh"
#include "W1Scanner.hh"
using namespace w1;
using namespace std;
-int main(int argc, char** argv)
-{
+int main(int argc, char** argv) {
W1Scanner *scanner;
list<W1Device *> device_list;
int round;
int interval_seconds;
int store_interval;
+ string location;
- interval_seconds = 60;
- store_interval = 10;
+ location = "/tmp/";
+ if (argc > 1) {
+ location = argv[1];
+ log_info("storage location: %s\n", location.c_str());
+ }
+ W1Store::set_location(location.c_str());
+ interval_seconds = 3;
+ store_interval = 3;
scanner = new W1Scanner();
device_list = scanner->get_device_list();
round = 0;
for(list<W1Device *>::iterator list_iter = device_list.begin(); list_iter != device_list.end(); list_iter++)
{
W1Device *device = (W1Device *)*list_iter;
-/*
- string name = device->get_name();
- string value = device->get_value();
- string unit = device->get_unit();
- cout << name << ": " << value << " " << unit << endl;
-*/
+
device->printout();
sleep(1);
if (round >= store_interval) {