const std::list<plp::Device *> *DeviceManagerClient::get_device_list(BusClient *client_param,
int *err_flg) {
- //send_request__get_device_list(client_param);
-
BusMessage *msg_req;
BusMessage *msg_rsp;
if (data_str.empty() == false) {
data = Data::parse_string(data_str);
}
- if (data == NULL) {
- data = new Data(0);
+ if (data != NULL) {
+ result->add(data);
+ log_debug("%s\n", description.c_str());
+ data->printout();
+ delete(data);
}
- result->add(data);
- log_debug("%s\n", description.c_str());
- data->printout();
- delete(data);
}
}
Data *data;
list<Device *> *ret_val;
+ ret_val = new list<Device *>;
count = msg_param->get_long_parameter(RSP__DEVICE_LIST__DEVICE_COUNT, err_flg);
log_debug("device count: %ld\n", count);
- ret_val = new list<Device *>;
if (*err_flg == PLP_OK) {
for (ii = 0; ii < count; ii++) {
+ data = NULL;
+
key.str("");
key << RSP__DEVICE_LIST__ID << ii;
id = msg_param->get_string_parameter(key.str(), err_flg);
if (*err_flg == PLP_OK) {
data = Data::parse_string(datastr);
if (data == NULL) {
- log_error("Failed to parse data items for the device: %s\n", id.c_str());
- *err_flg = PLP_ERR;
- break;
+ log_error("No data available for the device: %s\n", id.c_str());
}
}
else {
log_error("No data available for the device: %s\n", id.c_str());
- data = new Data(0);
}
dev = new DeviceData(id, type, name, state, data);
ret_val->push_back(dev);