Index: sources/canbus/caninterface.cpp =================================================================== diff -u -r9a3ee027dbc33f39ee7df2a9dc5a7897c6b1854d -rf623529d6ec25b555f3ac2248d71fc2b5e7063d6 --- sources/canbus/caninterface.cpp (.../caninterface.cpp) (revision 9a3ee027dbc33f39ee7df2a9dc5a7897c6b1854d) +++ sources/canbus/caninterface.cpp (.../caninterface.cpp) (revision f623529d6ec25b555f3ac2248d71fc2b5e7063d6) @@ -62,11 +62,12 @@ void CanInterface::connection() { - connect(_canDevice, SIGNAL(framesReceived()), - this , SLOT ( onRead())); - connect(_canDevice, SIGNAL(errorOccurred(QCanBusDevice::CanBusError)), - this , SLOT ( onError(QCanBusDevice::CanBusError))); - + if (_canDevice) { + connect(_canDevice, SIGNAL(framesReceived()), + this , SLOT ( onRead())); + connect(_canDevice, SIGNAL(errorOccurred(QCanBusDevice::CanBusError)), + this , SLOT ( onError(QCanBusDevice::CanBusError))); + } connect(_MessageHandler, SIGNAL(didActionPerform(QCanBusFrame)), this , SLOT( onActionPerform(QCanBusFrame))); connect(_MessageHandler, SIGNAL(didActionRequest(QCanBusFrame)), @@ -75,13 +76,20 @@ void CanInterface::status(const QString &vDescription, QString vError) { + QString mError=""; + if (_canDevice) { + mError = _canDevice->errorString() + vError; + } + else { + mError = vError; + } _canStatus = tr("%1 '%2[%3]', %4") .arg(vDescription) .arg(_canType) .arg(_canInterface) - .arg(_canDevice->errorString() + vError) + .arg(mError) ; - qDebug() << _canStatus; + // qDebug() << _canStatus; } void CanInterface::send(const QCanBusFrame &vFrame) @@ -155,9 +163,9 @@ const QString flags = frameFlags(frame); - qDebug() << time + flags + view; + // qDebug() << time + flags + view; // TODO : Needs to be investigated on how the messages on canBus will be received. - // my require to be moved at the end of the function. + // may require to be moved at the end of the function, to not to be called for each message. emit didRead(frame); } }