Index: sources/canbus/caninterface.cpp =================================================================== diff -u -r93d7ff58cd6fd2fea5d00587ee712a637fc941bf -rd3f916066c2d10c10fffa91fd8a7e5ac6dd86c7d --- sources/canbus/caninterface.cpp (.../caninterface.cpp) (revision 93d7ff58cd6fd2fea5d00587ee712a637fc941bf) +++ sources/canbus/caninterface.cpp (.../caninterface.cpp) (revision d3f916066c2d10c10fffa91fd8a7e5ac6dd86c7d) @@ -46,7 +46,9 @@ if ( _init ) return false; _init = true; + // coco begin validated: Manually tested since required to disable and enable the canbus if ( ! initDevice() ) return false; + // coco end if ( ! testDevice() ) return false; initConnections(); @@ -68,7 +70,9 @@ */ bool CanInterface::init(QThread &vThread) { + // coco begin validated: Manually tested since required to disable and enable the canbus if ( ! init() ) return false; + // coco end initThread(vThread); return true; } @@ -103,7 +107,9 @@ */ void CanInterface::initConnections() { + // coco begin validated: Manually tested since required to disable and enable the canbus if (_canDevice) { + // coco end connect(_canDevice, SIGNAL( framesReceived()), this , SLOT (onFrameReceive ())); @@ -161,11 +167,13 @@ { QString mError; _canDevice = QCanBus::instance()->createDevice(_canType, _canInterface, &mError); + // coco begin validated: Manually tested since required to disable and enable the canbus if (!_canDevice) { status(tr("Device Creation"), mError); LOG_ERROR(status()); return false; } + // coco end return true; } @@ -192,8 +200,9 @@ */ void CanInterface::quitDevice() { - if (!_canDevice) - return; + // coco begin validated: Manually tested since required to disable and enable the canbus + if (!_canDevice) return; + // coco end _canDevice->disconnectDevice(); delete _canDevice; _canDevice = nullptr; @@ -231,8 +240,9 @@ */ bool CanInterface::transmit(const QCanBusFrame &vFrame) { - if( !_canDevice ) - return false; + // coco begin validated: Manually tested since required to disable and enable the canbus + if( !_canDevice ) return false; + //coco end return _canDevice->writeFrame(vFrame); } @@ -293,8 +303,11 @@ */ FrameCount CanInterface::erCount() { + // coco begin validated: CANBus error handling has been tested manually. + // since it requires massive can messages sent/received to catch the error Types::safeIncrement(_erFrameCount); return _erFrameCount; + // coco end } /*! @@ -305,6 +318,8 @@ */ QString CanInterface::frameFlags(const QCanBusFrame &vFrame) { + // coco begin validated: CANBus error handling has been tested manually. + // since it requires massive can messages sent/received to catch the error QString result = QLatin1String(" --- "); if (vFrame.hasBitrateSwitch()) @@ -315,6 +330,7 @@ result[3] = QLatin1Char('L'); return result; + // coco end } /*! @@ -324,6 +340,8 @@ */ void CanInterface::onFrameError(QCanBusDevice::CanBusError vError) { + // coco begin validated: CANBus error handling has been tested manually. + // since it requires massive can messages sent/received to catch the error erCount(); switch (vError) { case QCanBusDevice::ReadError: @@ -341,6 +359,7 @@ } emit didFrameError(_canStatus); } +// coco end /*! * \brief CanInterface::onFrameWritten @@ -363,8 +382,9 @@ */ void CanInterface::onFrameReceive () { - if (!_canDevice) - return; + // coco begin validated: Manually tested since required to disable and enable the canbus + if (!_canDevice) return; + // coco end while (_canDevice->framesAvailable()) { const QCanBusFrame frame = _canDevice->readFrame(); rxCount();