-
Notifications
You must be signed in to change notification settings - Fork 14
/
Copy pathtestqmodbusmaster.h
49 lines (39 loc) · 1.17 KB
/
testqmodbusmaster.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
/****************************************************************************
**
** SPDX-License-Identifier: LGPL-3.0-or-later
** SPDX-FileCopyrightText: 2012 - present, Karol Drożak <[email protected]>
**
****************************************************************************/
#ifndef TESTQMODBUSMASTER_H
#define TESTQMODBUSMASTER_H
#include <QObject>
#include "qmodbusmaster.h"
#define IP "127.0.0.1"
#define PORT 502
class TestQModbusMaster : public QObject
{
Q_OBJECT
public:
explicit TestQModbusMaster (QObject *parent = 0);
~TestQModbusMaster ();
private slots:
void testConstructor ();
void testSetBroadcast ();
void testSetSlave ();
void testConnection ();
void testWriteBit ();
void testWriteRegister ();
void testWriteBits ();
void testWriteRegisters ();
void testReadBits ();
void testReadInputBits ();
void testReadRegisters ();
void testReadInputRegisters ();
void testReportSlaveId ();
void testFlush ();
private:
Modbus::QModbusMaster * modbus;
Modbus::QModbusBits bits;
Modbus::QModbusRegisters regs;
};
#endif // TESTQMODBUSMASTER_H