Index: sources/canbus/messageacknowmodel.cpp =================================================================== diff -u -r939d1bae9a394697d46ca913a2dc3442bf8ef82f -r1ec7b44e6d1d66460d2da943ff65f3c0c0755d8f --- sources/canbus/messageacknowmodel.cpp (.../messageacknowmodel.cpp) (revision 939d1bae9a394697d46ca913a2dc3442bf8ef82f) +++ sources/canbus/messageacknowmodel.cpp (.../messageacknowmodel.cpp) (revision 1ec7b44e6d1d66460d2da943ff65f3c0c0755d8f) @@ -117,6 +117,16 @@ moveToThread(qApp->thread()); } +/*! + * \brief MessageAcknowModel::onAcknowTransmit + * \details This slot is called MessageDispatcher sends a message from UI which requires Acknow. + * An Acknow model will be added to list of the Acknow required messages. + * The connection will be made to be notified by that message when it's timed out. + * And the timer for that message will be started. + * \param vCan_Id - Denali message Can channel + * \param vSequence - Sequence number of the message which requires Acknow + * \param vFrameList - List of the frames to be sent on retries. + */ void MessageAcknowModel::onAcknowTransmit(Can_Id vCan_Id, Sequence vSequence, const FrameList &vFrameList) { _acknowList[vSequence] = new Private::AcknowModel(vCan_Id, vSequence, vFrameList); @@ -127,17 +137,46 @@ _acknowList[vSequence]->start(); } +/*! + * \brief Private::AcknowModel::start + * \details It starts the message timer which is waiting for the Acknow + * on each interval will notify the MessageDispatcher to retry + */ +void Private::AcknowModel::start() { + _timerId = startTimer(_interval); +} + +/*! + * \brief MessageAcknowModel::onAcknowReceive + * \details This slot is called when the Acknow request for the specific message with the sequence number vSequence + * has been received. + * \param vSequence - Sequence number of the message which required Acknow + */ void MessageAcknowModel::onAcknowReceive(Sequence vSequence) { _acknowList[vSequence]->deleteLater(); _acknowList.remove(vSequence); } +/*! + * \brief MessageAcknowModel::onFramesTransmit + * \details This slot will be called when a message which is waiting for Acknow didn't get the Acknow + * during the interval and retries to transmit the message again. + * \param vCan_Id - The can channel for the Denali message + * \param vSequence - The sequence number of the message + * \param vFrameList - The list of the frame(s) needs to be sent. + */ void MessageAcknowModel::onFramesTransmit(Can_Id vCan_Id, Sequence vSequence, const FrameList &vFrameList) { emit didFramesTransmit(vCan_Id, vSequence, vFrameList); } +/*! + * \brief MessageAcknowModel::onFailedTransmit + * \details After the _retry amount of retries this slot will be called + * to notify the outside of the failure Acknow. + * \param vSequence - The sequence number of the message + */ void MessageAcknowModel::onFailedTransmit(Sequence vSequence) { _acknowList[vSequence]->deleteLater();