X-Git-Url: http://pilppa.org/gitweb/?a=blobdiff_plain;f=src%2FW1TemperatureSensor.cc;h=b02bb29dd01518738b2fd59136d3b94f8a7d37d4;hb=83dba70b46600014932da34e8744ba70584077aa;hp=bfa72912943e0b9daf942c6d68f55b3b3a6eb8ad;hpb=9c47855d3ddc3d09b9733c43d420a7d5b739bd37;p=lib1wire.git diff --git a/src/W1TemperatureSensor.cc b/src/W1TemperatureSensor.cc index bfa7291..b02bb29 100644 --- a/src/W1TemperatureSensor.cc +++ b/src/W1TemperatureSensor.cc @@ -28,7 +28,6 @@ bool string_to_number(NumberDataType& result, string convert_celcius_value_to_three_digits(string raw_value) { string ret_val; - int int_val; bool suc_flg; double dbl_val; @@ -45,15 +44,15 @@ string convert_celcius_value_to_three_digits(string raw_value) { return ret_val; } -W1TemperatureSensor::W1TemperatureSensor(dirent *direntry, - int family_code_param, - string id_param): W1Device(direntry, family_code_param, id_param) { +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) { - string text; - - text = get_time() + ": device type = " + get_devicetype_name() + ", id = " + id + ", could not read file: " + slave_file + "\n"; + 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"); ifs.close(); @@ -82,8 +81,7 @@ string W1TemperatureSensor::get_raw_value() { string last_line; int pos; int length; - string formatted_data; - int int_value; + string format; ret_val = ""; ifstream ifs(slave_file.c_str()); @@ -111,6 +109,6 @@ string W1TemperatureSensor::get_unit() { return "C"; } -string W1TemperatureSensor::get_devicetype_name() { +string W1TemperatureSensor::get_device_type() { return "Temperature Sensor"; }