From: Mika Laitio Date: Tue, 14 Aug 2012 22:50:55 +0000 (+0300) Subject: api changes X-Git-Url: http://pilppa.com/gitweb/?a=commitdiff_plain;h=4d74e78c278d9cd16e4b823b1cf0bbf8453f60af;p=lib1wire.git api changes Signed-off-by: Mika Laitio --- diff --git a/src/W1Device.cc b/src/W1Device.cc index 22f5559..a15f3d8 100644 --- a/src/W1Device.cc +++ b/src/W1Device.cc @@ -56,7 +56,7 @@ W1Device::~W1Device() { } } -string W1Device::get_name() { +string Device::get_name() { DeviceConfig *cfg; if (name.empty() == true) { @@ -69,9 +69,10 @@ string W1Device::get_name() { return name; } -void W1Device::set_name(string name_param) { +void Device::set_name(string name_param) { DeviceConfig *cfg; + log_debug("set_name started\n"); if (name.compare(name_param) != 0) { name = name_param; cfg = DeviceConfig::get_device_config(id); @@ -168,6 +169,6 @@ void W1Device::save_and_clean_cache() { pthread_mutex_unlock(&plock); } -const DataReader *W1Device::get_device_data() { +const DataReader *W1Device::get_datareader() { return reader; } diff --git a/src/W1Device.hh b/src/W1Device.hh index 28d4d38..0a905d3 100644 --- a/src/W1Device.hh +++ b/src/W1Device.hh @@ -35,11 +35,9 @@ namespace w1 { std::string device_type_param, dirent *direntry_param); ~W1Device(); - std::string get_name(); - void set_name(std::string name_param); void printout(); plp::Data *get_data(); - const plp::DataReader *get_device_data(); + const plp::DataReader *get_datareader(); protected: std::string dir_path; std::string slave_file; diff --git a/src_test/test_w1_datalog_read.cc b/src_test/test_w1_datalog_read.cc index 064831b..b840af5 100644 --- a/src_test/test_w1_datalog_read.cc +++ b/src_test/test_w1_datalog_read.cc @@ -52,7 +52,8 @@ int main(int argc, char** argv) { if (dev != NULL) { device = dynamic_cast(dev); if (device != NULL) { - reader = device->get_device_data(); + reader = device->get_datareader(); + device->get_name(); if (reader != NULL) { dr = ((DataReader *)reader)->get_data_range(); if (dr != NULL) { diff --git a/src_test/test_w1_datalog_write.cc b/src_test/test_w1_datalog_write.cc index 93acbd1..3d33cf0 100644 --- a/src_test/test_w1_datalog_write.cc +++ b/src_test/test_w1_datalog_write.cc @@ -96,7 +96,7 @@ int main(int argc, char** argv) { else { log_debug("could not find devices.\n"); } - log_debug("trying to start emptying list\n"); + log_debug("trying to empty device list\n"); while (device_list.empty() == false) { device = device_list.back(); device_list.pop_back();