/*! * * Copyright (c) 2019-2020 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 messagepacker.h * date 12/9/2019 * author Behrouz NematiPour * */ #pragma once // Qt #include // Project #include namespace Can { /*! * \brief The MessageDispatcher class * \details Message Dispatcher is the class which is the mediator between CanBus Frames * and Application Messages. * The massages and frames need to be interpreted form/to hex * and also need to be splitted into frames or constructer from frames to be a message. * ---------------------------------------------------------------------------------------- * * Interpreter : message [ toHex , fromHex] * * Builder : message [ toFrame , fromFrame ] * * Dipatcher : signal->Handler( .. frame .. ) * * Handler : signal->Dispatcher( .. frame .. ) * * ---------------------------------------------------------------------------------------- * * *** UI <-> AppController <-> Dispatcher <-> Handler <-> HD *** * * ---------------------------------------------------------------------------------------- * * UI -> message -> * AppController { * signal->Dispatcher ( .. message .. ) * } * * Dispatcher { * .. * messageList[ch][frameList] += Builder.toFrame ( Interpreter.toHex ( message ) ) * .. * signal->Handler( .. frame .. ) * } * * ---------------------------------------------------------------------------------------- * * HD -> frame -> * Handler { * signal->Dispatcher ( .. frame .. ) * } * * Dispatcher { * messageList[ch][frameList] += Interpreter.fromHex( frame ) * isComplete => Builder.fromFrame( frameList ) : singal->AppController * } * * ---------------------------------------------------------------------------------------- */ class MessageDispatcher : public QObject { Q_OBJECT //QHash _messages; public: explicit MessageDispatcher(QObject *parent = nullptr); signals: public slots: }; }