You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
32 lines
735 B
32 lines
735 B
4 years ago
|
#ifndef MODBUSWRAPPER_H
|
||
|
#define MODBUSWRAPPER_H
|
||
|
|
||
|
#include <QObject>
|
||
|
#include <QThread>
|
||
|
#include <ModbusMaster.h>
|
||
|
class ModbusWrapper : public QObject
|
||
|
{
|
||
|
Q_OBJECT
|
||
|
public:
|
||
|
explicit ModbusWrapper(QObject *parent = nullptr);
|
||
|
~ModbusWrapper();
|
||
|
void initWrapper(QString serialPort, int slaveAddress);
|
||
|
void stopWrapper();
|
||
|
QBitArray getCoilWrapper( int startAddress, quint16 numberOfEntries);
|
||
|
|
||
|
signals:
|
||
|
void openConnectionOrder(QString _serialPort, int _slaveAddress);
|
||
|
void initConnectionOrder();
|
||
|
void stopConnectionOrder();
|
||
|
QBitArray getCoilOrder(int startAddress, quint16 numberOfEntries);
|
||
|
|
||
|
public slots:
|
||
|
|
||
|
|
||
|
private:
|
||
|
modBusMaster *modBusObj;
|
||
|
QThread workerThread;
|
||
|
};
|
||
|
|
||
|
#endif // MODBUSWRAPPER_H
|