]> pilppa.com Git - libplp.git/commitdiff
cleanups
authorMika Laitio <lamikr@pilppa.org>
Thu, 16 Jun 2011 22:46:53 +0000 (01:46 +0300)
committerMika Laitio <lamikr@pilppa.org>
Thu, 16 Jun 2011 22:46:53 +0000 (01:46 +0300)
Signed-off-by: Mika Laitio <lamikr@pilppa.org>
src/DataReader.cc
src/DeviceConfig.cc

index 9731bce6170c6e007e2d4bda7042f6507ce1b5d9..00f861a61dc116907712e6e8bb10ac7c52ca4492 100644 (file)
@@ -34,6 +34,7 @@ bool string_to_number(NumberDataType& result,
 DataReader::DataReader(string device_id_param) {
        string  base_dir;
 
+       log_debug("device_id: %s\n", device_id_param.c_str());
        device_config   = NULL;
        device_id       = device_id_param;
        base_dir        = DeviceConfig::get_base_dir_name();
index c3e8bad047e2a915f18b493fadd46d6b40f0254e..9b3a1007c7e6b7841ef3a3e1ba307a3226749f32 100644 (file)
@@ -287,6 +287,8 @@ ConfigHandle *DeviceConfig::load_device_config(string device_id_param) {
        struct uci_package      *pkg;
        string                  cfg_fl;
        string                  cfg_dir;
+       int                     b_count;
+       char                    *fname;
        ConfigHandle            *ret_val;
 
        ret_val = NULL;
@@ -299,14 +301,11 @@ ConfigHandle *DeviceConfig::load_device_config(string device_id_param) {
                if (access(cfg_fl.c_str(), R_OK) == 0) {
                        ctx     = uci_alloc_context();
                        if (ctx != NULL) {
-                               //log_debug("uci_set_confdir: %s\n", cfg_dir.c_str());
+                               log_debug("confdir: %s, file: %s\n", cfg_dir.c_str(), cfg_fl.c_str());
                                uci_set_confdir(ctx, cfg_dir.c_str());
                                err_flg = uci_load(ctx, cfg_fl.c_str(), &pkg);
                                if (err_flg == UCI_OK) {
                                        //log_debug("Loaded device configuration: %s.\n", cfg_fl.c_str());
-                                       int b_count;
-                                       char *fname;
-
                                        b_count = strlen(cfg_dir.c_str()) + strlen(cfg_fl.c_str()) + 10;
                                        fname   = (char *)calloc(1, b_count);
                                        if (fname != NULL) {
@@ -336,9 +335,9 @@ ConfigHandle *DeviceConfig::load_device_config(string device_id_param) {
        return ret_val;
 }
 
-DeviceConfig *DeviceConfig::get_device_config(string device_id) {
+DeviceConfig *DeviceConfig::get_device_config(string device_id_param) {
        DeviceConfig    *ret_val;
 
-       ret_val = new DeviceConfig(device_id);
+       ret_val = new DeviceConfig(device_id_param);
        return ret_val;
 }