Index: sources/canbus/FrameInterface.cpp =================================================================== diff -u -r1b24a85761c65a685fac98f396e244af97b94443 -r526875e8db8cf0c97f5cd8aa90564e41d42f5fde --- sources/canbus/FrameInterface.cpp (.../FrameInterface.cpp) (revision 1b24a85761c65a685fac98f396e244af97b94443) +++ sources/canbus/FrameInterface.cpp (.../FrameInterface.cpp) (revision 526875e8db8cf0c97f5cd8aa90564e41d42f5fde) @@ -1,15 +1,15 @@ /*! * - * Copyright (c) 2019-2020 Diality Inc. - All Rights Reserved. + * Copyright (c) 2020-2022 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 - * \author (last) Behrouz NematiPour - * \date (last) 26-Aug-2020 - * \author (original) Behrouz NematiPour - * \date (original) 26-Aug-2020 + * \file FrameInterface.cpp + * \author (last) Behrouz NematiPour + * \date (last) 22-Sep-2021 + * \author (original) Behrouz NematiPour + * \date (original) 26-Aug-2020 * */ #include "FrameInterface.h" @@ -47,7 +47,7 @@ startTimer(1, Qt::PreciseTimer); - LOG_DEBUG("UI," + tr("%1 Initialized").arg(metaObject()->className())); + LOG_DEBUG(tr("%1 Initialized").arg(metaObject()->className())); return true; } @@ -118,7 +118,7 @@ /*! * \brief FrameInterface::quitThread - * \details Moves this object to main thread to be handled by QApplicaiton + * \details Moves this object to main thread to be handled by QApplication * And to be destroyed there. */ void FrameInterface::quitThread() @@ -137,7 +137,7 @@ * \brief FrameInterface::transmitFrame * \details Prepares a frame to be transmitted * and emit signal didFrameTransmit with the frame as its argument - * \param vFrameId - Channel id of the CANBUS frame + * \param vFrameId - Channel id of the CANBus frame * \param vData - The Data this frame is going to carry * \note This frame is created by MessageBuilder * and it can be one of the frames of a message @@ -148,7 +148,7 @@ QCanBusFrame mFrame; mFrame.setFrameId(vCan_Id); if (vData.length() > Can::eLenCanFrame) { - LOG_DEBUG(QString("Payload can't be larger than %1 bytes").arg(Can::eLenCanFrame)); + LOG_DEBUG(QString("Payload cannot be larger than %1 bytes").arg(Can::eLenCanFrame)); return; } mFrame.setPayload(vData); @@ -178,9 +178,13 @@ case eDG_Dialin: case eDialin_UI: case eUI_Dialin: - channelGroup = ChannelGroup::eChannel_Ignores; + if ( gEnableDialinUnhandled ) { + channelGroup = ChannelGroup::eChannel_Listens; + } else { + channelGroup = ChannelGroup::eChannel_Ignores; + } debugChannel = true; - ok = false; // it's still false since UI is not handling any messages coming form Debug Channels. + ok = gEnableDialinUnhandled; break; case eChlid_HD_DG : @@ -228,7 +232,7 @@ /*! * \brief FrameInterface::onFrameReceive * \details This the slot connected to the CanInterface didFrameReceive signal. - * When a frame received over the CANBUS, + * When a frame received over the CANBus, * this slot will be called to check the channel if should be listened to. * and will emit didFrameReceive if should be handled and ignored otherwise. * \param vFrame - The frame has to be sent @@ -241,11 +245,17 @@ quint32 mFrameId = vFrame.frameId(); ChannelGroup channelGroup = checkChannel(mFrameId, &ok, &debugChannel); - if (!ok) { - QString message = "Unexpected Channel\r\n"; - if (debugChannel) message = "Debug Channel\r\n"; - LOG_DEBUG(message + - Format::toHexString(mFrameId, false, eLenChannelDigits) + " -- " + vFrame.payload().toHex(' ')); + + QString logMessage; + if ( debugChannel ) { + logMessage = "Debug Channel\r\n" + + Format::toHexString(mFrameId, false, eLenChannelDigits) + " -- " + vFrame.payload().toHex(' '); + LOG_DEBUG(logMessage); + } + if ( ! ok ) { + logMessage = "Unexpected Channel\r\n" + + Format::toHexString(mFrameId, false, eLenChannelDigits) + " -- " + vFrame.payload().toHex(' '); + LOG_DEBUG(logMessage); return; } @@ -260,9 +270,9 @@ /*! * \brief FrameInterface::onFrameTransmit * \details This the slot connected to the MessageDispatcher didFrameTransmit signal. - * When a frame needs to be send to CANBUS, + * When a frame needs to be send to CANBus, * this slot will call transmitFrame method to do the job. - * \param vCan_Id - CANBUS Can Id target of the frame. + * \param vCan_Id - CANBus Can Id target of the frame. * \param vData - The data which this frame will carry. */ void FrameInterface::onFrameTransmit(Can_Id vCan_Id, const QByteArray &vData)