Index: sources/canbus/caninterface.h =================================================================== diff -u -re1605219ac2baf49ef21d0889f845ac53d59c3c1 -r56d00a82669a7a2c00ab90109a89dbec8db27527 --- sources/canbus/caninterface.h (.../caninterface.h) (revision e1605219ac2baf49ef21d0889f845ac53d59c3c1) +++ sources/canbus/caninterface.h (.../caninterface.h) (revision 56d00a82669a7a2c00ab90109a89dbec8db27527) @@ -21,7 +21,7 @@ #include "main.h" // Define -#define _CanInterface CanInterface::I() +#define _CanInterface Can::CanInterface::I() // forward declarations class tst_canbus; @@ -56,22 +56,33 @@ QString _canStatus = ""; bool _enableConsoleOut = false; - // Singleton - SINGLETON(CanInterface) + QThread *_thread = nullptr; + bool _init = false; -public: +// Singleton +SINGLETON(CanInterface) + +public slots: bool init(); + bool init(QThread &vThread); + +private slots: void quit(); +public: QString status() const; void enableConsoleOut(bool vEnabled) { _enableConsoleOut = vEnabled; } + + void quitDevice(); private: void initConnections(); - bool createDevice(); - bool checkDevice (); - void deleteDevice(); + void initThread(QThread &vThread); + void quitThread(); + bool initDevice(); + bool testDevice(); + void status (const QString &vDescription, QString vError = ""); bool transmit (const QCanBusFrame &vFrame); void consoleOut (const QCanBusFrame &vFrame);