4 * Created on: Oct 20, 2010
17 #include <plp/Data.hh>
18 #include <plp/SensorDevice.hh>
19 #include <plp/Device.hh>
21 #ifndef W1_SCAN_ROOTDIR
22 #define W1_SCAN_ROOTDIR "/sys/bus/w1/devices"
26 #define W1_SLAVE_FILE "w1_slave";
30 class W1Device : public plp::SensorDevice {
32 W1Device(std::string device_id_param,
33 std::string device_type_param,
34 dirent *direntry_param);
36 std::string get_name();
37 void set_name(std::string name_param);
39 plp::Data *get_data();
40 plp::DataReader *get_device_data();
43 std::string slave_file;
44 std::list<plp::Data *> memory_cache;
45 plp::DataReader *reader;
46 void save_and_clean_cache();
47 virtual std::vector<double> *get_raw_data() = 0;
48 virtual unsigned int get_data_decimal_precision() = 0;
49 void cache(plp::Data *data);
50 std::string to_string(double val, int digit_count);
54 #endif /* W1DEVICE_HH_ */