bug fix for processing version when no match found

This commit is contained in:
Paul
2020-01-03 21:19:22 +01:00
parent 5ce0b64bb4
commit 5577685d85

View File

@@ -1711,7 +1711,7 @@ void _process_Version(_EMS_RxTelegram * EMS_RxTelegram) {
uint8_t i = 0; uint8_t i = 0;
uint8_t found_index = 0; uint8_t found_index = 0;
bool typeFound = false; bool typeFound = false;
while ((i < _EMS_Devices_max) || (!typeFound)) { while ((i < _EMS_Devices_max) && (!typeFound)) {
if (EMS_Devices[i].product_id == product_id) { if (EMS_Devices[i].product_id == product_id) {
// we have a matching product id // we have a matching product id
// now lets see if there is a matching device_id since product_id can be on multiple devices // now lets see if there is a matching device_id since product_id can be on multiple devices
@@ -1721,6 +1721,7 @@ void _process_Version(_EMS_RxTelegram * EMS_RxTelegram) {
if ((EMS_Devices_Types[j].device_type == device_type) && (EMS_Devices_Types[j].device_id == device_id)) { if ((EMS_Devices_Types[j].device_type == device_type) && (EMS_Devices_Types[j].device_id == device_id)) {
typeFound = true; typeFound = true;
found_index = i; found_index = i;
break;
} }
} }
} }