using namespace std;
using namespace w1;
-W1CounterDevice::W1CounterDevice(dirent *direntry,
- int family_code_param,
- string id_param): W1Device(direntry, family_code_param, id_param) {
- ifstream ifs(slave_file.c_str());
- if (ifs.is_open() == false) {
- string text;
+W1CounterDevice::W1CounterDevice(int family_code_param,
+ string device_id_param,
+ dirent *direntry_param): W1Device(family_code_param, device_id_param, direntry_param) {
+ string text;
- text = get_time() + ": device type = " + get_devicetype_name() + ", id = " + id + ", could not read file: " + slave_file;
+ 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;
- }
- else {
ifs.close();
}
}
return ret_val;
}
-string W1CounterDevice::get_value() {
- string ret_val;
- string value_line;
- int pos;
- int length;
- int ii;
+string W1CounterDevice::get_raw_value() {
+ string ret_val;
+ string value_line;
+ int pos;
+ int length;
ret_val = "<could not read>";
ifstream ifs(slave_file.c_str());
return "";
}
-string W1CounterDevice::get_devicetype_name() {
+string W1CounterDevice::get_device_type() {
return "Counter Device";
}