Hotwheels-Cluster 1.2
Creation of Cluster APP for SEA:ME project.
 
Loading...
Searching...
No Matches
CanBusManager.hpp
Go to the documentation of this file.
1
16
17#ifndef CANBUSMANAGER_HPP
18#define CANBUSMANAGER_HPP
19
21#include <QObject>
22#include <QThread>
23
28class CanBusManager : public QObject {
29 Q_OBJECT
30public:
31 explicit CanBusManager(const std::string &spi_device,
32 QObject *parent = nullptr);
33 CanBusManager(IMCP2515Controller *controller, QObject *parent = nullptr);
35 bool initialize();
36
37 QThread *getThread() const { return m_thread; }
38
39 signals:
44 void speedUpdated(float newSpeed);
49 void rpmUpdated(int newRpm);
50
51private:
55 QThread *m_thread = nullptr;
60 void connectSignals();
61};
62
63#endif // CANBUSMANAGER_HPP
Definition of the IMCP2515Controller class.
void rpmUpdated(int newRpm)
Signal emitted when the RPM is updated.
QThread * getThread() const
void speedUpdated(float newSpeed)
Signal emitted when the speed is updated.
void connectSignals()
Method to connect signals.
bool ownsMCP2515Controller
Flag to indicate if the MCP2515 controller is owned by the CanBusManager.
QThread * m_thread
Pointer to the QThread object.
bool initialize()
Initializes the CanBusManager.
~CanBusManager()
Destroy the CanBusManager::CanBusManager object.
IMCP2515Controller * m_controller
Pointer to the IMCP2515Controller object.
CanBusManager(const std::string &spi_device, QObject *parent=nullptr)
Construct a new CanBusManager::CanBusManager object.
Interface for the MCP2515 CAN controller. QObject.