W1TemperatureSensor::W1TemperatureSensor(int family_code_param,
string device_id_param,
dirent *direntry_param): W1Device(family_code_param, device_id_param, direntry_param) {
- string text;
-
- log_debug("trying to open file: %s\n", slave_file.c_str());
ifstream ifs(slave_file.c_str());
if (ifs.is_open() == false) {
- text = get_time() + ": device type = " + get_device_type() + ", id = " + id + ", could not read file: " + slave_file + "\n";
- log_debug(text.c_str());
- log_debug("verify that you have w1_therm kernel module loaded.\n");
+ 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_therm kernel module loaded.\n");
ifs.close();
}
}
string W1TemperatureSensor::get_device_type() {
return "Temperature Sensor";
}
+
+unsigned int W1TemperatureSensor::get_data_decimal_precision() {
+ return 3;
+}