/*! * * Copyright (c) 2020-2024 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 ProtoInterface.h * \author (last) Behrouz NematiPour * \date (last) 18-Jul-2023 * \author (original) Behrouz NematiPour * \date (original) 26-Aug-2020 * */ #pragma once // Qt #include #include #include #include "CanMessage.h" // namespace namespace proto { /*! * \brief Protobuf interface * \details This class contains the interface to Protobuf * And utilizes Qt QProtoBus to interact with the CANBus * This class works only with the QProtoBusFrame frames. * On the OS side there is a driver installed to convert SPI to CAN * Since the GUI Board by itself does not contain the CANBus. * Application would know nothing about the SPI-TO-CAN */ class ProtoInterface : public QObject { Q_OBJECT public: ProtoInterface(QObject *parent = nullptr); void quitDevice(); public Q_SLOTS: bool init(); bool init(QThread &vThread); void onCanMessageReceive(const QDateTime timestamp, const Can::Message msg); void quit(); private: void initConnections(); void initThread(QThread &vThread); void quitThread(); bool _init = false; }; } // namespace Proto