]> pilppa.com Git - lib1wire.git/commitdiff
api changes
authorMika Laitio <lamikr@pilppa.org>
Tue, 14 Aug 2012 22:50:55 +0000 (01:50 +0300)
committerMika Laitio <lamikr@pilppa.org>
Tue, 14 Aug 2012 22:50:55 +0000 (01:50 +0300)
Signed-off-by: Mika Laitio <lamikr@pilppa.org>
src/W1Device.cc
src/W1Device.hh
src_test/test_w1_datalog_read.cc
src_test/test_w1_datalog_write.cc

index 22f555960dad5d9a9e1e7de48fd8f9560fe83b52..a15f3d8c18a1ec7355fa59553b99c560323aaec0 100644 (file)
@@ -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;
 }
index 28d4d3852cf217fc17159e1a04698128e4ac0387..0a905d3a3e618dbcb45eb402341e044d48093bea 100644 (file)
@@ -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;
index 064831b4bc8c71432bd57b1e87294792e73effd3..b840af5c32a08faa92bd6966c011af7bb00ccd2e 100644 (file)
@@ -52,7 +52,8 @@ int main(int argc, char** argv) {
                if (dev != NULL) {
                        device  = dynamic_cast<SensorDevice *>(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) {
index 93acbd179c08f2aadd937ef89b8c6a4dd0b04bd2..3d33cf0eabb831b9b7e1df66bbef10c671b2dc2c 100644 (file)
@@ -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();