X-Git-Url: http://pilppa.org/gitweb/?a=blobdiff_plain;f=src%2FW1CounterDevice.cc;h=82a0beda2a00e5212ee5c1a59cdc416e49b4b0cc;hb=d58713adbc518552c11fd19bd21ae8bd11ab434f;hp=3ebdbd47c50ae61404d5f5e15b74e5809d79321c;hpb=6dea0b59503a71874c4476c05044fff3c5ae26a5;p=lib1wire.git diff --git a/src/W1CounterDevice.cc b/src/W1CounterDevice.cc index 3ebdbd4..82a0bed 100644 --- a/src/W1CounterDevice.cc +++ b/src/W1CounterDevice.cc @@ -12,6 +12,8 @@ #include +#include + #include "W1CounterDevice.hh" using namespace std; @@ -32,10 +34,9 @@ W1CounterDevice::W1CounterDevice(int family_code_param, string text; ifstream ifs(slave_file.c_str()); - if (ifs.is_open() == true) { - text = get_time() + ": device type = " + get_device_type() + ", id = " + id + ", could not read file: " + slave_file; - cout << text << endl; - cout << "verify that you have w1_ds2423 kernel module loaded." << endl; + if (ifs.is_open() == false) { + log_error("%s: %s failed to read data from file: %s\n", id.c_str(), get_device_type().c_str(), slave_file.c_str()); + log_error("Verify that you have w1_ds2423 kernel module loaded.\n"); ifs.close(); } } @@ -93,3 +94,7 @@ string W1CounterDevice::get_unit() { string W1CounterDevice::get_device_type() { return "Counter Device"; } + +unsigned int W1CounterDevice::get_data_decimal_precision() { + return 0; +}