Index: sources/canbus/messageinterpreter.cpp =================================================================== diff -u -r9d2940c9f09ace35e4e0501a61d46b6bdf789dab -r028d387c263ec7d991263db45bebabc27223c379 --- sources/canbus/messageinterpreter.cpp (.../messageinterpreter.cpp) (revision 9d2940c9f09ace35e4e0501a61d46b6bdf789dab) +++ sources/canbus/messageinterpreter.cpp (.../messageinterpreter.cpp) (revision 028d387c263ec7d991263db45bebabc27223c379) @@ -65,14 +65,11 @@ { bool ok = true; vPayload.clear(); - int l = vData.length(); - quint8 ix = 0; + int count = vData.count(); switch (vActionId) { // notice we are in transmit mode case Gui::GuiActionType::PowerOff: - ix = static_cast(Gui::GuiActionIndx::PowerOff_Response); - if (l >= ix + 1) { - quint8 tmp = vData[ix].toUInt(); - vPayload += tmp; + if (count) { + vPayload += vData[0].toUInt(); } else { QString mActionIdHexString = Format::toHexString(vActionId); LOG_ERROR(tr("Incorrect data for Message ID (UI) '%1'").arg(mActionIdHexString)); @@ -86,7 +83,7 @@ // Mentioned in the switch/case to be registered as a valid message. // // Note : added this line to be able to do the Fake Test - if (vData.count()) { + if (count) { vPayload = Format::fromVariant(vData[0]); } break; @@ -98,13 +95,13 @@ break; case Gui::GuiActionType::String: - if (vData.count()) { + if (count) { vPayload = Format::fromVariant(vData[0]); } break; case Gui::GuiActionType::AdjustBloodDialysateReq: - if (vData.count()) { + if (count) { vPayload = Format::fromVariant(vData); } break;