aboutsummaryrefslogtreecommitdiffstats
path: root/sources/pyside6
diff options
context:
space:
mode:
Diffstat (limited to 'sources/pyside6')
-rw-r--r--sources/pyside6/PySide6/QtSerialBus/CMakeLists.txt53
-rw-r--r--sources/pyside6/PySide6/QtSerialBus/typesystem_serialbus.xml65
-rw-r--r--sources/pyside6/cmake/PySideHelpers.cmake1
-rw-r--r--sources/pyside6/doc/extras/QtSerialBus.rst46
-rw-r--r--sources/pyside6/doc/modules.rst8
-rw-r--r--sources/pyside6/doc/qtmodules/pyside-qtserialbus.qdocconf.in2
-rw-r--r--sources/pyside6/tests/QtSerialBus/CMakeLists.txt1
7 files changed, 176 insertions, 0 deletions
diff --git a/sources/pyside6/PySide6/QtSerialBus/CMakeLists.txt b/sources/pyside6/PySide6/QtSerialBus/CMakeLists.txt
new file mode 100644
index 000000000..13fcb54a0
--- /dev/null
+++ b/sources/pyside6/PySide6/QtSerialBus/CMakeLists.txt
@@ -0,0 +1,53 @@
+project(QtSerialBus)
+
+set(QtSerialBus_OPTIONAL_SRC )
+set(QtSerialBus_DROPPED_ENTRIES )
+
+set(QtSerialBus_SRC
+ ${QtSerialBus_GEN_DIR}/qcanbus_wrapper.cpp
+ ${QtSerialBus_GEN_DIR}/qcanbusdevice_wrapper.cpp
+ ${QtSerialBus_GEN_DIR}/qcanbusdevice_filter_wrapper.cpp
+ ${QtSerialBus_GEN_DIR}/qcanbusdeviceinfo_wrapper.cpp
+ ${QtSerialBus_GEN_DIR}/qcanbusfactory_wrapper.cpp
+ ${QtSerialBus_GEN_DIR}/qcanbusframe_wrapper.cpp
+ ${QtSerialBus_GEN_DIR}/qcanbusframe_timestamp_wrapper.cpp
+ ${QtSerialBus_GEN_DIR}/qmodbusclient_wrapper.cpp
+ ${QtSerialBus_GEN_DIR}/qmodbusdataunit_wrapper.cpp
+ ${QtSerialBus_GEN_DIR}/qmodbusdevice_wrapper.cpp
+ ${QtSerialBus_GEN_DIR}/qmodbusdeviceidentification_wrapper.cpp
+ ${QtSerialBus_GEN_DIR}/qmodbuspdu_wrapper.cpp
+ ${QtSerialBus_GEN_DIR}/qmodbusreply_wrapper.cpp
+ ${QtSerialBus_GEN_DIR}/qmodbusrequest_wrapper.cpp
+ ${QtSerialBus_GEN_DIR}/qmodbusrtuserialclient_wrapper.cpp
+ ${QtSerialBus_GEN_DIR}/qmodbusrtuserialserver_wrapper.cpp
+ ${QtSerialBus_GEN_DIR}/qmodbusserver_wrapper.cpp
+ ${QtSerialBus_GEN_DIR}/qmodbustcpclient_wrapper.cpp
+ ${QtSerialBus_GEN_DIR}/qmodbustcpconnectionobserver_wrapper.cpp
+ ${QtSerialBus_GEN_DIR}/qmodbustcpserver_wrapper.cpp
+# module is always needed
+ ${QtSerialBus_GEN_DIR}/qtserialbus_module_wrapper.cpp
+)
+
+set(QtSerialBus_include_dirs ${QtSerialBus_SOURCE_DIR}
+ ${QtSerialBus_BINARY_DIR}
+ ${Qt${QT_MAJOR_VERSION}Core_INCLUDE_DIRS}
+ ${Qt${QT_MAJOR_VERSION}Network_INCLUDE_DIRS}
+ ${Qt${QT_MAJOR_VERSION}SerialPort_INCLUDE_DIRS}
+ ${Qt${QT_MAJOR_VERSION}SerialBus_INCLUDE_DIRS}
+ ${libpyside_SOURCE_DIR}
+ ${QtCore_GEN_DIR}
+ ${QtNetwork_GEN_DIR}
+ ${QtSerialPort_GEN_DIR})
+
+set(QtSerialBus_libraries pyside6
+ ${Qt${QT_MAJOR_VERSION}SerialBus_LIBRARIES})
+
+set(QtSerialBus_deps QtCore QtNetwork QtSerialPort)
+
+create_pyside_module(NAME QtSerialBus
+ INCLUDE_DIRS QtSerialBus_include_dirs
+ LIBRARIES QtSerialBus_libraries
+ DEPS QtSerialBus_deps
+ TYPESYSTEM_PATH QtSerialBus_SOURCE_DIR
+ SOURCES QtSerialBus_SRC
+ DROPPED_ENTRIES QtSerialBus_DROPPED_ENTRIES)
diff --git a/sources/pyside6/PySide6/QtSerialBus/typesystem_serialbus.xml b/sources/pyside6/PySide6/QtSerialBus/typesystem_serialbus.xml
new file mode 100644
index 000000000..94905f918
--- /dev/null
+++ b/sources/pyside6/PySide6/QtSerialBus/typesystem_serialbus.xml
@@ -0,0 +1,65 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+// Copyright (C) 2022 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+-->
+
+<typesystem package="PySide6.QtSerialBus">
+ <load-typesystem name="QtCore/typesystem_core.xml" generate="no"/>
+ <load-typesystem name="QtNetwork/typesystem_network.xml" generate="no"/>
+ <load-typesystem name="QtSerialPort/typesystem_serialport.xml" generate="no"/>
+
+ <object-type name="QCanBus"/>
+ <object-type name="QCanBusDevice">
+ <enum-type name="CanBusError"/>
+ <enum-type name="CanBusDeviceState"/>
+ <enum-type name="CanBusStatus"/>
+ <enum-type name="ConfigurationKey"/>
+ <enum-type name="Direction" flags="Directions"/>
+ <modify-function signature="deviceInfo()const" access="final"/>
+ <value-type name="Filter">
+ <enum-type name="FormatFilter" flags="FormatFilters"/>
+ </value-type>
+ </object-type>
+ <value-type name="QCanBusDeviceInfo"> <!-- deleted default constructor -->
+ <modify-function signature="swap(QCanBusDeviceInfo&amp;)" remove="all"/>
+ </value-type>
+ <object-type name="QCanBusFactory"/>
+ <value-type name="QCanBusFrame">
+ <enum-type name="FrameType"/>
+ <enum-type name="FrameError" flags="FrameErrors"/>
+ <value-type name="TimeStamp"/>
+ </value-type>
+ <object-type name="QModbusClient"/>
+ <value-type name="QModbusDataUnit">
+ <enum-type name="RegisterType"/>
+ </value-type>
+ <object-type name="QModbusDevice">
+ <enum-type name="Error"/>
+ <enum-type name="State"/>
+ <enum-type name="ConnectionParameter"/>
+ <enum-type name="IntermediateError"/>
+ </object-type>
+ <value-type name="QModbusDeviceIdentification">
+ <enum-type name="ObjectId"/>
+ <enum-type name="ReadDeviceIdCode"/>
+ <enum-type name="ConformityLevel"/>
+ </value-type>
+ <object-type name="QModbusPdu">
+ <enum-type name="ExceptionCode"/>
+ <enum-type name="FunctionCode"/>
+ <modify-field name="ExceptionByte" remove="true"/> <!-- Link error -->
+ </object-type>
+ <object-type name="QModbusReply">
+ <enum-type name="ReplyType"/>
+ </object-type>
+ <object-type name="QModbusRequest"/>
+ <object-type name="QModbusRtuSerialClient"/>
+ <object-type name="QModbusRtuSerialServer"/>
+ <object-type name="QModbusServer">
+ <enum-type name="Option"/>
+ </object-type>
+ <object-type name="QModbusTcpClient"/>
+ <object-type name="QModbusTcpConnectionObserver"/>
+ <object-type name="QModbusTcpServer"/>
+</typesystem>
diff --git a/sources/pyside6/cmake/PySideHelpers.cmake b/sources/pyside6/cmake/PySideHelpers.cmake
index d2277be93..49d273672 100644
--- a/sources/pyside6/cmake/PySideHelpers.cmake
+++ b/sources/pyside6/cmake/PySideHelpers.cmake
@@ -103,6 +103,7 @@ macro(collect_optional_modules)
Scxml
Sensors
SerialPort
+ SerialBus
StateMachine
TextToSpeech
Charts
diff --git a/sources/pyside6/doc/extras/QtSerialBus.rst b/sources/pyside6/doc/extras/QtSerialBus.rst
new file mode 100644
index 000000000..a6493a2ae
--- /dev/null
+++ b/sources/pyside6/doc/extras/QtSerialBus.rst
@@ -0,0 +1,46 @@
+The Qt Serial Bus API provides classes and functions to access the various
+industrial serial buses and protocols, such as CAN, ModBus, and others.
+
+Getting Started
+^^^^^^^^^^^^^^^
+
+To include the definitions of modules classes, use the following
+directive:
+
+::
+
+ import PySide6.QtSerialBus
+
+Supported Buses and Protocols
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+ * Qt CAN Bus
+ * Qt Modbus
+
+Logging Categories
+^^^^^^^^^^^^^^^^^^
+
+The QtSerialBus module exports the following logging categories:
+
+.. list-table::
+ :header-rows: 1
+
+ * - Logging Category
+ - Description
+ * - qt.canbus
+ - Enables standard logging inside the Qt CAN Bus classes
+ * - qt.canbus.plugins
+ - Enables low level logging inside the Qt CAN Bus plugin classes. To set logging for a specific plugin, use ``qt.canbus.plugins.pluginname``, e.g. ``qt.canbus.plugins.socketcan``. ``qt.canbus.plugins*`` affects all plugins.
+ * - qt.modbus
+ - Enables standard logging inside the Qt Modbus classes
+ * - qt.modbus.lowlevel
+ - Enables low level logging including individual packet content inside the Qt Modbus classes
+
+Logging categories can be used to enable additional warning and debug output
+for QtSerialBus.
+
+A quick way to enable all Qt Modbus logging is to add the following line:
+
+.. code-block:: python
+
+ QLoggingCategory.setFilterRules("qt.modbus* = true")
diff --git a/sources/pyside6/doc/modules.rst b/sources/pyside6/doc/modules.rst
index 482657958..c4c8852bf 100644
--- a/sources/pyside6/doc/modules.rst
+++ b/sources/pyside6/doc/modules.rst
@@ -209,6 +209,14 @@ Qt Modules Supported by Qt for Python
---
+ :mod:`Qt Serial Bus <PySide6.QtSerialBus>`
+ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+ Provides access to serial industrial bus interfaces. Currently, the module
+ supports the CAN bus and Modbus protocols.
+
+ ---
+
:mod:`Qt Serial Port <PySide6.QtSerialPort>`
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
diff --git a/sources/pyside6/doc/qtmodules/pyside-qtserialbus.qdocconf.in b/sources/pyside6/doc/qtmodules/pyside-qtserialbus.qdocconf.in
new file mode 100644
index 000000000..4c67664a5
--- /dev/null
+++ b/sources/pyside6/doc/qtmodules/pyside-qtserialbus.qdocconf.in
@@ -0,0 +1,2 @@
+include(@QT_SRC_DIR@/../qtserialbus/src/serialbus/doc/qtserialbus.qdocconf)
+include(../pyside-config.qdocconf)
diff --git a/sources/pyside6/tests/QtSerialBus/CMakeLists.txt b/sources/pyside6/tests/QtSerialBus/CMakeLists.txt
new file mode 100644
index 000000000..2f7cb08b9
--- /dev/null
+++ b/sources/pyside6/tests/QtSerialBus/CMakeLists.txt
@@ -0,0 +1 @@
+# Please add some tests, here