]> pilppa.org Git - lib1wire.git/blobdiff - src/W1CounterDevice.cc
Initial support for reading and writing device specific config data.
[lib1wire.git] / src / W1CounterDevice.cc
index 4f500e9007f4bcf4a9e2bbbb116dda8d88589e17..53c95f93a0751cd97ed55087b0b24ed77ba10c1e 100644 (file)
 using namespace std;
 using namespace w1;
 
-W1CounterDevice::W1CounterDevice(dirent *direntry,
-                               int family_code_param,
-                               string id_param): W1Device(direntry, family_code_param, id_param) {
+W1CounterDevice::W1CounterDevice(int family_code_param,
+                               string device_id_param,
+                               dirent *direntry_param): W1Device(family_code_param, device_id_param, direntry_param) {
+       string text;
+
        ifstream ifs(slave_file.c_str());
        if (ifs.is_open() == true) {
-               string text;
-
-               text    = get_time() + ": device type = " + get_devicetype_name() + ", id = " + id + ", could not read file: " + slave_file;
+               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;
                ifs.close();
@@ -44,11 +44,10 @@ bool W1CounterDevice::is_supported_family_code(int family_code) {
 }
 
 string W1CounterDevice::get_raw_value() {
-       string          ret_val;
-       string          value_line;
-       int             pos;
-       int             length;
-       int             ii;
+       string  ret_val;
+       string  value_line;
+       int     pos;
+       int     length;
 
        ret_val = "<could not read>";
        ifstream ifs(slave_file.c_str());
@@ -85,6 +84,6 @@ string W1CounterDevice::get_unit() {
        return "";
 }
 
-string W1CounterDevice::get_devicetype_name() {
+string W1CounterDevice::get_device_type() {
        return "Counter Device";
 }