#ifndef MAINCLASS_H #define MAINCLASS_H #include #include #include "inputbusiness.h" class MainClass : public QObject { Q_OBJECT public: explicit MainClass(QObject *parent = 0); enum DeviceType { Gpio, Random }; signals: public slots: void main(); void maySend(); inline __suseconds_t getTime() const; private: InputBusiness* m_input; QTimer* m_timer; DeviceType m_device; QHostAddress m_address; QList m_channels; int m_port; bool m_verbose; int m_interval; __suseconds_t m_lastTime; void getOpts(); }; __suseconds_t MainClass::getTime() const { struct timeval time; gettimeofday(&time, NULL); return 1000000 * time.tv_sec + time.tv_usec; } #endif // MAINCLASS_H