Index: sources/canbus/messagehandler.cpp =================================================================== diff -u -r4c1551d45b40987c2d59c11e95760e9b6c55fc68 -rfee7fabf49befb065c89248c19e15efc9ca194e4 --- sources/canbus/messagehandler.cpp (.../messagehandler.cpp) (revision 4c1551d45b40987c2d59c11e95760e9b6c55fc68) +++ sources/canbus/messagehandler.cpp (.../messagehandler.cpp) (revision fee7fabf49befb065c89248c19e15efc9ca194e4) @@ -1,14 +1,10 @@ /*! * - * Copyright (c) 2019-2020 Diality Inc. - All Rights Reserved. + * Copyright (c) 2019-2019 Diality Inc. - All Rights Reserved. * copyright - * THIS CODE MAY NOT BE COPIED OR REPRODUCED IN ANY FORM, - * IN PART OR IN WHOLE, - * WITHOUT THE EXPLICIT PERMISSION OF THE COPYRIGHT OWNER. - * * file messagehandler.cpp * date 10/26/2019 @@ -48,9 +44,9 @@ } /*! - * \brief Message Handler connections definition + * \brief MessageHandler connections definition * \details Initializes the required signal/slot connection between this class and other objects\n - * to be able to communicate. + * to be able to communicate. */ void MessageHandler::initConnections() { @@ -63,6 +59,16 @@ this , SLOT( onFrameReceive( const QCanBusFrame &))); } +/*! + * \brief MessageHandler::transmitFrame \n + * \details Prepares a frame to be transmitted \n + * and emit signal didFrameTransmit with the frame as its argument \n + * \param vFrameId - Channel id of the CANBUS frame \n + * \param vData - The Data this frame is going to carry \n + * \note This frame is created by MessageBuilder \n + * and it can be one of the frames of a message \n + * which has been chopped into frames. \n + */ void MessageHandler::transmitFrame(Can_Id vFrameId, const QByteArray &vData) { QCanBusFrame mFrame; @@ -75,6 +81,16 @@ emit didFrameTransmit(mFrame); } +/*! + * \brief MessageHandler::checkChannel \n + * \details Checks for the channel id of the received frame \n + * which needs to be handled or ignored. \n + * \param vFrameId - Channel id of the frame \n + * \param vOK - will be set to true if the channel \n + * is valid and a variable has been passed to \n + * \return The Category if the channels from the UI \n + * perspective \ref MessageHandler::ChannelGroup \n + */ MessageHandler::ChannelGroup MessageHandler::checkChannel(quint32 vFrameId, bool *vOK) { bool ok = true; @@ -110,14 +126,26 @@ return channelGroup; } +/*! + * \brief MessageHandler::onFrameTransmit \n + * \details This the slot connected to the MessageDispatcher didFrameTransmit signal. \n + * When a frame needs to be send to CANBUS, \n + * this slot will call transmitFrame method to do the job. \n + * \param vCan_ID - CANBUS Can Id target of the frame. \n + * \param vData - The data which this frame will carry. \n + */ void MessageHandler::onFrameTransmit(Can_Id vCan_ID, const QByteArray &vData) { transmitFrame(vCan_ID, vData); } /*! - * \brief MessageHandler::onRead - * \param vFrame + * \brief MessageHandler::onFrameReceive + * \details This the slot connected to the CanInterface didFrameReceive signal. \n + * When a frame received over the CANBUS, \n + * this slot will be called to check the channel if should be listened to. \n + * and will emit didFrameReceive if should be handled and ignored otherwise. \n + * \param vFrame - The frame has to be sent */ void MessageHandler::onFrameReceive(const QCanBusFrame &vFrame) {