QModbusDeviceIdentification Class
The QModbusDeviceIdentification is a container class representing the physical and functional description of a Modbus server. More...
Header: | #include <QModbusDeviceIdentification> |
qmake: | QT += serialbus |
Since: | Qt 5.8 |
Public Types
enum | ConformityLevel { BasicConformityLevel, RegularConformityLevel, ExtendedConformityLevel, BasicIndividualConformityLevel, RegularIndividualConformityLevel, ExtendedIndividualConformityLevel } |
enum | ObjectId { VendorNameObjectId, ProductCodeObjectId, MajorMinorRevisionObjectId, VendorUrlObjectId, ..., UndefinedObjectId } |
enum | ReadDeviceIdCode { BasicReadDeviceIdCode, RegularReadDeviceIdCode, ExtendedReadDeviceIdCode, IndividualReadDeviceIdCode } |
Public Functions
QModbusDeviceIdentification() | |
QModbusDeviceIdentification::ConformityLevel | conformityLevel() const |
bool | contains(uint objectId) const |
bool | insert(uint objectId, const QByteArray &data) |
bool | isValid() const |
QList<int> | objectIds() const |
void | remove(uint objectId) |
void | setConformityLevel(QModbusDeviceIdentification::ConformityLevel level) |
QByteArray | value(uint objectId) const |
Static Public Members
Detailed Description
The QModbusDeviceIdentification is a container class representing the physical and functional description of a Modbus server.
The Device Identification interface is modeled as an address space composed of a set of addressable data elements. The data elements are called objects and an ObjectId identifies them.
Member Type Documentation
enum QModbusDeviceIdentification::ConformityLevel
Defines the identification conformity level of the device and type of supported access.
Constant | Value | Description |
---|---|---|
QModbusDeviceIdentification::BasicConformityLevel | 0x01 | Basic identification (stream access). |
QModbusDeviceIdentification::RegularConformityLevel | 0x02 | Regular identification (stream access). |
QModbusDeviceIdentification::ExtendedConformityLevel | 0x03 | Extended identification (stream access). |
QModbusDeviceIdentification::BasicIndividualConformityLevel | 0x81 | Basic identification (stream access and individual access). |
QModbusDeviceIdentification::RegularIndividualConformityLevel | 0x82 | Regular identification (stream access and individual access). |
QModbusDeviceIdentification::ExtendedIndividualConformityLevel | 0x83 | Extended identification (stream access and individual access). |
See also ReadDeviceIdCode.
enum QModbusDeviceIdentification::ObjectId
This enum describes the possible server objects. The interface consists of three categories of objects:
Basic Device Identification. All objects of this category are mandatory.
Constant | Value | Description |
---|---|---|
QModbusDeviceIdentification::VendorNameObjectId | 0x00 | The vendor name of the device. |
QModbusDeviceIdentification::ProductCodeObjectId | 0x01 | The product code of the device. |
QModbusDeviceIdentification::MajorMinorRevisionObjectId | 0x02 | The product version numbering. |
Regular Device Identification. All objects of this category are standard defined and optional.
Constant | Value | Description |
---|---|---|
QModbusDeviceIdentification::VendorUrlObjectId | 0x03 | The vendor URL of the device. |
QModbusDeviceIdentification::ProductNameObjectId | 0x04 | The product name of the device. |
QModbusDeviceIdentification::ModelNameObjectId | 0x05 | The model name of the device. |
QModbusDeviceIdentification::UserApplicationNameObjectId | 0x06 | The user application name of the device. |
Reserved range (i.e., ReservedObjectId >= ObjectId < ProductDependentObjectId). Do not use.
Constant | Value | Description |
---|---|---|
QModbusDeviceIdentification::ReservedObjectId | 0x07 | First value of reserved object Ids. |
Extended Device Identification. All of these data are device dependent and optional.
Constant | Value | Description |
---|---|---|
QModbusDeviceIdentification::ProductDependentObjectId | 0x80 | First possible value of product dependent identifiers. |
QModbusDeviceIdentification::UndefinedObjectId | 0x100 | Do not use. |
enum QModbusDeviceIdentification::ReadDeviceIdCode
Defines the access type of the read identification request.
Stream access:
Constant | Value | Description |
---|---|---|
QModbusDeviceIdentification::BasicReadDeviceIdCode | 0x01 | Request to get the basic device identification. |
QModbusDeviceIdentification::RegularReadDeviceIdCode | 0x02 | Request to get the regular device identification. |
QModbusDeviceIdentification::ExtendedReadDeviceIdCode | 0x03 | Request to get the extended device identification. |
Individual access:
Constant | Value | Description |
---|---|---|
QModbusDeviceIdentification::IndividualReadDeviceIdCode | 0x04 | Request to get one specific identification object. |
Member Function Documentation
QModbusDeviceIdentification::QModbusDeviceIdentification()
Default constructs an instance of QModbusDeviceIdentification.
QModbusDeviceIdentification::ConformityLevel QModbusDeviceIdentification::conformityLevel() const
See also setConformityLevel().
bool QModbusDeviceIdentification::contains(uint objectId) const
bool QModbusDeviceIdentification::insert(uint objectId, const QByteArray &data)
bool QModbusDeviceIdentification::isValid() const
QList<int> QModbusDeviceIdentification::objectIds() const
void QModbusDeviceIdentification::remove(uint objectId)
void QModbusDeviceIdentification::setConformityLevel(QModbusDeviceIdentification::ConformityLevel level)
See also conformityLevel().