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.
31 lines
713 B
31 lines
713 B
#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 init(QString serialPort, int slaveAddress);
|
|
void stop();
|
|
QBitArray getCoil( 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
|
|
|