config = get_device_config(device_id);
if (config != NULL) {
// if not, create default device config
config = get_device_config(device_id);
if (config != NULL) {
// if not, create default device config
type = config->get_cfg_value(DEVICE_CONFIG_VALUE_KEY__TYPE);
if (type.empty() == true) {
type = ret_val->get_device_type();
type = config->get_cfg_value(DEVICE_CONFIG_VALUE_KEY__TYPE);
if (type.empty() == true) {
type = ret_val->get_device_type();