freemodbus: fix invalid error handling for duplicate param_key

This commit is contained in:
aleks
2021-08-09 13:54:18 +02:00
committed by bot
parent ab5c956bdf
commit 158384043d
3 changed files with 8 additions and 4 deletions

View File

@@ -444,8 +444,9 @@ static esp_err_t mbc_tcp_master_get_parameter(uint16_t cid, char* name, uint8_t*
// Set the type of parameter found in the table
*type = reg_info.param_type;
} else {
ESP_LOGD(MB_MASTER_TAG, "%s: The cid(%u) not found in the data dictionary.",
ESP_LOGE(MB_MASTER_TAG, "%s: The cid(%u) not found in the data dictionary.",
__FUNCTION__, reg_info.cid);
error = ESP_ERR_INVALID_ARG;
}
return error;
}
@@ -482,6 +483,7 @@ static esp_err_t mbc_tcp_master_set_parameter(uint16_t cid, char* name, uint8_t*
} else {
ESP_LOGE(MB_MASTER_TAG, "%s: The requested cid(%u) not found in the data dictionary.",
__FUNCTION__, reg_info.cid);
error = ESP_ERR_INVALID_ARG;
}
return error;
}