Index: sources/canbus/frameinterface.cpp =================================================================== diff -u -r6c59703781373f33cfec27eacf1f7e4ba1374626 -r44a85c96ab55e424866ec4cca0270aa218355f82 --- sources/canbus/frameinterface.cpp (.../frameinterface.cpp) (revision 6c59703781373f33cfec27eacf1f7e4ba1374626) +++ sources/canbus/frameinterface.cpp (.../frameinterface.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 frameinterface.cpp - * date 10/26/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 frameinterface.cpp + * \author (last) Behrouz NemaiPour + * \date (last) 22-Jun-2020 + * \author (original) Behrouz NematiPour + * \date (original) 18-Dec-2019 + * */ #include "frameinterface.h" @@ -76,7 +77,7 @@ { // coco begin validated: Application termination is not correctly done in coco!!! // it has been tested and works perfectly fine in normal run. - quitThread(); + quitThread(); // validated } // coco end @@ -129,7 +130,7 @@ if ( ! _thread ) return; // runs in thread - moveToThread(qApp->thread()); + moveToThread(qApp->thread()); // validated } // coco end @@ -171,32 +172,38 @@ FrameInterface::ChannelGroup channelGroup = ChannelGroup::eChannel_Unknown; switch (vFrameId) { case eChlid_HD_DG : + // coco begin validated: The HD/DG communication has not been defined and implemented yet. case eChlid_DG_HD : + // coco end channelGroup = ChannelGroup::eChannel_Ignores; break; case eChlid_HD_UI : case eChlid_HD_Alarm : - case eChlid_DG_Alarm : case eChlid_HD_Sync : + // coco begin validated: The UI/DG communication has not been defined and implemented yet. + case eChlid_DG_Alarm : case eChlid_DG_Sync : + // coco end //case eChlid_DG_UI : // has duplicate value as eChlid_DG_Alarm channelGroup = ChannelGroup::eChannel_Listens; break; + // coco begin validated: The UI Alarm and Sync messages has not been defined and implemented yet. case eChlid_UI_Alarm : case eChlid_UI_Sync : //case eChlid_UI_DG : channelGroup = ChannelGroup::eChannel_Outputs; break; - + // coco end default: ok = false; break; } - + // coco begin validated: manually tested if (vOK) *vOK = ok; + // coco end return channelGroup; } @@ -249,8 +256,8 @@ void FrameInterface::onFrameWritten(qint64 /*vCount*/) { _transmitted = true; - removeHead(); - // Test : qDebug() << _timestamp << "Sent #" << _txFrameList.count() << vCount; + removeHead(); + // Test : qDebug() << _timestamp << "Sent #" << _txFrameList.count() << vCount; } /*! @@ -278,11 +285,16 @@ void FrameInterface::trnsmtHead() { if ( _txFrameList.isEmpty() ) { + // coco begin validated: This is a fake data generator for CANBus missing/swapped frames Testing + // will never be executed on the product and shall be removed after the CANBus issues has been resolved. + // has been tested manually if ( gSendEmptyKeepAwake ) { transmitFrame(eChlid_LOWEST,QByteArray()); // Keep the CANBus awake. return; } - } else { + } + // coco end + else { Frame frame = _txFrameList.first(); transmitFrame(frame.can_Id, frame.data); // Test : qDebug() << _timestamp << "Tsmt #" << _txFrameList.count(); @@ -313,9 +325,11 @@ void FrameInterface::appendHead(Can_Id vCan_Id, const QByteArray &vData) { Frame frame = Frame(vCan_Id, vData); + // coco begin validated: has been manually tested by sending over 4000 frames and not received by anyother node. if (_txFrameList.count() >= _txFrameList_Max) { LOG_ERROR(tr("Transmit buffer overflow of %1").arg(_txFrameList_Max)); return; + // coco end } _txFrameList.append(frame); }