Index: sources/canbus/caninterface.cpp =================================================================== diff -u -rde2f87e15fa05b1c45581cfedd8f1af0c47c2b48 -rd6c7d6c382fe56e19d132f6ba0bcbbc1e6b2060f --- sources/canbus/caninterface.cpp (.../caninterface.cpp) (revision de2f87e15fa05b1c45581cfedd8f1af0c47c2b48) +++ sources/canbus/caninterface.cpp (.../caninterface.cpp) (revision d6c7d6c382fe56e19d132f6ba0bcbbc1e6b2060f) @@ -31,6 +31,11 @@ */ CanInterface::CanInterface(QObject *parent) : QObject(parent) {} +/*! + * \brief CanInterface Initialization + * \details Initializes the CANBUS and check if can be connected + * \return true if connected false otherwise + */ bool CanInterface::init() { QString mError; @@ -54,14 +59,23 @@ return true; } +/*! + * \brief CanInterface status + * \details CanInterface status description + * \return + */ QString CanInterface::status() const { return _canStatus; } +/*! + * \brief CanInterface connection + * \details Initializes the required signal/slot connection between this class and other objects\n + * to be able to communicate. + */ void CanInterface::connection() { - if (_canDevice) { connect(_canDevice, SIGNAL(framesReceived()), this , SLOT ( onRead())); @@ -74,6 +88,12 @@ this , SLOT( onActionRequest(QCanBusFrame))); } +/*! + * \brief CanInterface status + * \details Sets the Can interface status description + * \param vDescription Description about the Can Interface error + * \param vError Qt Can Interface Error + */ void CanInterface::status(const QString &vDescription, QString vError) { QString mError=""; @@ -89,16 +109,24 @@ .arg(_canInterface) .arg(mError) ; - // qDebug() << _canStatus; } +/*! + * \brief CanInterface send + * \details send a frame over the CAN Bus + * \param vFrame CAN message frame + */ void CanInterface::send(const QCanBusFrame &vFrame) { if( !_canDevice ) return; _canDevice->writeFrame(vFrame); } +/*! + * \brief CanInterface quit + * \details Quit the Can Interface by disconnecting the bus and device. + */ void CanInterface::quit() { if (!_canDevice) @@ -111,6 +139,12 @@ status(tr("Disconnected")); } +/*! + * \brief frameFlags + * \details Can message frame type as flags + * \param frame Can message frame + * \return Frame flag + */ static QString frameFlags(const QCanBusFrame &frame) { QString result = QLatin1String(" --- "); @@ -125,6 +159,11 @@ return result; } +/*! + * \brief CanInterface onError + * \details Can Bus error handler which sets the can status description + * \param vError CanBus error + */ void CanInterface::onError(QCanBusDevice::CanBusError vError) { switch (vError) { @@ -141,6 +180,10 @@ emit didError(_canStatus); } +/*! + * \brief CanInterface onRead + * \details CanBus read handler + */ void CanInterface::onRead() { if (!_canDevice) @@ -170,12 +213,24 @@ } } +/*! + * \brief CanInterface onActionPerform + * \details sends a Can message frame of the can message of the performed action + * This is a response from application UI to HD device + * \param vFrame Can message frame + */ void CanInterface::onActionPerform(const QCanBusFrame &vFrame) { // TODO : Process Frame send(vFrame); } +/*! + * \brief CanInterface onActionRequest + * \details sends a Can message frame of the can message of the requested action + * This is a request for action from application UI to HD device + * \param vFrame Can message frame + */ void CanInterface::onActionRequest(const QCanBusFrame &vFrame) { // TODO : Process Frame