Index: sources/canbus/messagebuilder.cpp =================================================================== diff -u -r1ec7b44e6d1d66460d2da943ff65f3c0c0755d8f -r44a85c96ab55e424866ec4cca0270aa218355f82 --- sources/canbus/messagebuilder.cpp (.../messagebuilder.cpp) (revision 1ec7b44e6d1d66460d2da943ff65f3c0c0755d8f) +++ sources/canbus/messagebuilder.cpp (.../messagebuilder.cpp) (revision 44a85c96ab55e424866ec4cca0270aa218355f82) @@ -1,15 +1,16 @@ /*! - * + * * Copyright (c) 2019-2020 Diality Inc. - All Rights Reserved. - * copyright - * THIS CODE MAY NOT BE COPIED OR REPRODUCED IN ANY FORM, - * IN PART OR IN WHOLE, - * WITHOUT THE EXPLICIT PERMISSION OF THE COPYRIGHT OWNER. - * - * file messagebuilder.cpp - * date 12/6/2019 - * author Behrouz NematiPour - * + * \copyright + * THIS CODE MAY NOT BE COPIED OR REPRODUCED IN ANY FORM, IN PART OR IN + * WHOLE, WITHOUT THE EXPLICIT PERMISSION OF THE COPYRIGHT OWNER. + * + * \file messagebuilder.cpp + * \author (last) Behrouz NematiPour + * \date (last) 07-May-2020 + * \author (original) Behrouz NematiPour + * \date (original) 09-Dec-2019 + * */ #include "messagebuilder.h" @@ -225,9 +226,13 @@ quint8 mExpected = 0; quint8 mBeenRead = 0; if ( ! checkCRC(crcData, mExpected, mBeenRead ) ) { // CRC is always next byte after Data - LOG_ERROR(tr("CRC error, expected %1 but got %2") - .arg(Format::toHexString(mExpected, true, eLenCRCDigits)) - .arg(Format::toHexString(mBeenRead, true, eLenCRCDigits))); + static quint64 erCRC = 0; + LOG_ERROR(tr("%1 - CRC error, expected %2 but got %3 : %4") + .arg(++erCRC) + .arg(Format::toHexString(mExpected, true, eLenCRCDigits)) + .arg(Format::toHexString(mBeenRead, true, eLenCRCDigits)) + .arg(Format::toHexString(vMessage.data)) + ); return false; } return true; @@ -421,6 +426,7 @@ return; } QByteArray view; + // coco begin validated: printPayload and specially vUseColor is for debugging purposes and has been validated manually. if (vUseColor) { QList byteList; byteList = vPayload.toHex('.').split('.'); @@ -445,6 +451,7 @@ view = Format::toHexString(vCan_Id, false, eLenChannelDigits).toLatin1() + " " + vPayload.toHex('.'); fprintf(stderr, "%s\n", view.constData()); } + // coco end } /*!