]> pilppa.org Git - lib1wire.git/blob - src_test/test_w1.cc
e8f6e2feea85028bf234476857bb56901f737b6d
[lib1wire.git] / src_test / test_w1.cc
1 /*
2  * test_w1.cc
3  *
4  *  Created on: Oct 20, 2010
5  *      Author: lamikr
6  */
7 #include <list>
8 #include <string>
9 #include <iostream>
10
11 #include <unistd.h>
12
13 #include "W1Scanner.hh"
14
15 using namespace w1;
16 using namespace std;
17
18 int main(int argc, char** argv)
19 {
20         W1Scanner                       *scanner;
21         list<W1Device *>        device_list;
22
23         scanner         = new W1Scanner();
24         device_list     = scanner->get_device_list();
25         while(1) {
26                 for(list<W1Device *>::iterator list_iter = device_list.begin(); list_iter != device_list.end(); list_iter++)
27                 {
28                         W1Device *device = (W1Device *)*list_iter;
29 /*
30                         string name     = device->get_name();
31                         string value    = device->get_value();
32                         string unit             = device->get_unit();
33                         cout << name << ": " << value << " " << unit << endl;
34 */
35                         device->printout();
36                 }
37                 sleep(60);
38         }
39         return 0;
40 }