-
Notifications
You must be signed in to change notification settings - Fork 14
/
Copy pathqmodbus.h
43 lines (37 loc) · 1.56 KB
/
qmodbus.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
/****************************************************************************
**
** SPDX-License-Identifier: LGPL-3.0-or-later
** SPDX-FileCopyrightText: 2012 - present, Karol Drożak <[email protected]>
**
****************************************************************************/
#ifndef QMODBUS_H
#define QMODBUS_H
#include <QObject>
#if defined(QMODBUS_LIBRARY)
# define QMODBUSSHARED_EXPORT Q_DECL_EXPORT
#else
# define QMODBUSSHARED_EXPORT Q_DECL_IMPORT
#endif
namespace Modbus {
typedef enum
{
None = 0,//MODBUS_ERROR_RECOVERY_NONE
Link = (1<<1),//MODBUS_ERROR_RECOVERY_LINK
Protocol = (1<<2)//MODBUS_ERROR_RECOVERY_PROTOCOL
} errorRecoveryMode;
typedef enum
{
IllegalFunction = 0x01,//MODBUS_EXCEPTION_ILLEGAL_FUNCTION, // (1)
IllegalDataAddress,// = MODBUS_EXCEPTION_ILLEGAL_DATA_ADDRESS, // (2)
IllegalDataValue,// = MODBUS_EXCEPTION_ILLEGAL_DATA_VALUE, // (3)
SlaveOrServerFailure,// = MODBUS_EXCEPTION_SLAVE_OR_SERVER_FAILURE, // (4)
Acknowledge,// = MODBUS_EXCEPTION_ACKNOWLEDGE, // (5)
SlaveOrServerBusy,// = MODBUS_EXCEPTION_SLAVE_OR_SERVER_BUSY, // (6)
NegativeAcknowledge,// = MODBUS_EXCEPTION_NEGATIVE_ACKNOWLEDGE, // (7)
MemoryParity,// = MODBUS_EXCEPTION_MEMORY_PARITY, // (8)
NotDefined,// = MODBUS_EXCEPTION_NOT_DEFINED, // (9)
GatewayPath,// = MODBUS_EXCEPTION_GATEWAY_PATH, // (10)
GatewayTarget// = MODBUS_EXCEPTION_GATEWAY_TARGET // (11)
} modbusException;
};
#endif // QMODBUS_H