Index: denali.pro.user =================================================================== diff -u -r39a9d9b3930ab483df75da6c2e7bf8838fa8ff5e -r526875e8db8cf0c97f5cd8aa90564e41d42f5fde --- denali.pro.user (.../denali.pro.user) (revision 39a9d9b3930ab483df75da6c2e7bf8838fa8ff5e) +++ denali.pro.user (.../denali.pro.user) (revision 526875e8db8cf0c97f5cd8aa90564e41d42f5fde) @@ -1,6 +1,6 @@ - + EnvironmentId Index: main.cpp =================================================================== diff -u -r27cc308ff5113a9386899d3c8f8b29962a8498e1 -r526875e8db8cf0c97f5cd8aa90564e41d42f5fde --- main.cpp (.../main.cpp) (revision 27cc308ff5113a9386899d3c8f8b29962a8498e1) +++ main.cpp (.../main.cpp) (revision 526875e8db8cf0c97f5cd8aa90564e41d42f5fde) @@ -85,6 +85,7 @@ bool gSendEmptyKeepAwake = false ; bool gFakeSeqAtBegin = false ; bool gDisableUnhandledReport = false ; +bool gEnableDialinUnhandled = false ; bool gDisableTimeout = false ; bool gDisableAlarmNoMinimize = false ; @@ -178,13 +179,21 @@ parser.addOption(optionFakeSeqAtBegin); // --- -u : disable-unhandled-report - QCommandLineOption optionDisableUnhandledReport(QStringList() << "u" << "disable-unhandled-report", - QCoreApplication::translate("main", "Disable unhandled messages report as an error in the log")); + QCommandLineOption optionDisableUnhandledReport( + QStringList() << "u" << "disable-unhandled-report", + QCoreApplication::translate("main", "Disable unhandled messages report as an error in the log")); parser.addOption(optionDisableUnhandledReport); + // --- -d : enable-dialin-unhandled + QCommandLineOption optionEnableDialinUnhandled( + QStringList() << "d" << "enable-dialin-unhandled", + QCoreApplication::translate("main", "Enable the Dialin messages logged as unhandled")); + parser.addOption(optionEnableDialinUnhandled); + // --- -q : disable-timeout - QCommandLineOption optionDisableTimeout(QStringList() << "q" << "disable-timeout", - QCoreApplication::translate("main", "Disables HD communication timeout")); + QCommandLineOption optionDisableTimeout( + QStringList() << "q" << "disable-timeout", + QCoreApplication::translate("main", "Disables HD communication timeout")); parser.addOption(optionDisableTimeout); // --- -a : disable-alarm-no-minimize @@ -199,6 +208,7 @@ gConsoleoutFrameInterface = parser.isSet(optionConsoleoutFrameInterface ); gConsoleoutLogs = parser.isSet(optionConsoleoutLogs ); gDisableUnhandledReport = parser.isSet(optionDisableUnhandledReport ); + gEnableDialinUnhandled = parser.isSet(optionEnableDialinUnhandled ); gDisableTimeout = parser.isSet(optionDisableTimeout ); gDisableAlarmNoMinimize = parser.isSet(optionDisableAlarmMoMinimize ); Index: sources/canbus/FrameInterface.cpp =================================================================== diff -u -r27cc308ff5113a9386899d3c8f8b29962a8498e1 -r526875e8db8cf0c97f5cd8aa90564e41d42f5fde --- sources/canbus/FrameInterface.cpp (.../FrameInterface.cpp) (revision 27cc308ff5113a9386899d3c8f8b29962a8498e1) +++ sources/canbus/FrameInterface.cpp (.../FrameInterface.cpp) (revision 526875e8db8cf0c97f5cd8aa90564e41d42f5fde) @@ -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 from Debug Channels. + ok = gEnableDialinUnhandled; break; case eChlid_HD_DG : @@ -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; } Index: sources/canbus/MessageInterpreter.cpp =================================================================== diff -u -r27cc308ff5113a9386899d3c8f8b29962a8498e1 -r526875e8db8cf0c97f5cd8aa90564e41d42f5fde --- sources/canbus/MessageInterpreter.cpp (.../MessageInterpreter.cpp) (revision 27cc308ff5113a9386899d3c8f8b29962a8498e1) +++ sources/canbus/MessageInterpreter.cpp (.../MessageInterpreter.cpp) (revision 526875e8db8cf0c97f5cd8aa90564e41d42f5fde) @@ -375,7 +375,7 @@ switch (identifySource(vMessage.can_id)) { case Can_Source::eCan_HD: ok = interpretMessage_HD(vMessage, vData); break; case Can_Source::eCan_DG: ok = interpretMessage_DG(vMessage, vData); break; - default : break; + default : logUnhandledMessage(vMessage ); break; // ok is still false. } return ok; } @@ -674,10 +674,9 @@ bool MessageInterpreter::logUnhandledMessage(const Message &vMessage) const { bool ok = false; quint16 id = vMessage.actionId; - if (_messageList.contains(id)) { + QString logString; if (_messageList.contains(id)) { ok = true; QStringList items = _messageList[id]; - QString logString; int index = 0; for ( int i = 0; i < items.count(); i++ ) { QString item = items[i]; @@ -728,5 +727,8 @@ } LOG_DATUM(logString); } + else { + LOG_DEBUG(QString("Undefined unhandled message [%1]").arg(id, 0, 16)); + } return ok; } Index: sources/main.h =================================================================== diff -u -r27cc308ff5113a9386899d3c8f8b29962a8498e1 -r526875e8db8cf0c97f5cd8aa90564e41d42f5fde --- sources/main.h (.../main.h) (revision 27cc308ff5113a9386899d3c8f8b29962a8498e1) +++ sources/main.h (.../main.h) (revision 526875e8db8cf0c97f5cd8aa90564e41d42f5fde) @@ -61,6 +61,7 @@ extern bool gSendEmptyKeepAwake ; extern bool gFakeSeqAtBegin ; extern bool gDisableUnhandledReport ; +extern bool gEnableDialinUnhandled ; extern bool gDisableTimeout ; extern bool gDisableAlarmNoMinimize ; //--------------------------------------------------------------------------------//