Qt Serial Bus
Qt Serial Bus API는 CAN, ModBus 등 다양한 산업용 직렬 버스 및 프로토콜에 접근할 수 있는 클래스와 함수를 제공합니다.
시작하기
CMake에서 이 모듈을 사용하려면, ` find_package() ` 명령을 사용하여 ` Qt6 ` 패키지 내에서 필요한 모듈 구성 요소를 찾아야 합니다:
find_package(Qt6 COMPONENTS SerialBus REQUIRED)
target_link_libraries(mytarget PRIVATE Qt6::SerialBus)qmake를 사용하여 빌드할 때 이 모듈을 사용하려면, 프로젝트의 .pro 파일에서 QT 변수의 값으로 해당 모듈을 추가하십시오:
QT += serialbus지원되는 버스 및 프로토콜
API 참조
다음은 API 참조 자료에 대한 링크입니다.
로깅 카테고리
QtSerialBus 모듈은 다음과 같은 로깅 카테고리( logging categories)를 내보냅니다:
| 로깅 범주 | 설명 |
|---|---|
| qt.canbus | Qt CAN Bus 클래스 내에서 표준 로깅을 활성화합니다 |
| qt.canbus.plugins | Qt CAN Bus 플러그인 클래스 내에서 저수준 로깅을 활성화합니다. 특정 플러그인에 대한 로깅을 설정하려면 "qt.canbus.plugins.pluginname"을 사용하십시오. 예: "qt.canbus.plugins.socketcan". "qt.canbus.plugins*"는 모든 플러그인에 영향을 미칩니다. |
| qt.modbus | Qt Modbus 클래스 내부의 표준 로깅을 활성화합니다. |
| qt.modbus.lowlevel | Qt Modbus 클래스 내에서 개별 패킷 내용을 포함한 저수준 로깅을 활성화합니다. |
로깅 범주를 사용하면 ` QtSerialBus`에 대한 추가 경고 및 디버그 출력을 활성화할 수 있습니다. 로깅에 대한 더 자세한 정보는 QLoggingCategory 에서 확인할 수 있습니다.
모든 Qt Modbus 로깅을 활성화하는 빠른 방법은 main() 함수에 다음 줄을 추가하는 것입니다:
QLoggingCategory::setFilterRules(QStringLiteral("qt.modbus* = true"));예제
모듈의 발전
'Qt SerialBus의 변경 사항'에서는 Qt 6 시리즈를 위해 모듈 API 및 기능에 적용된 주요 변경 사항을 나열합니다.
라이선스
Qt SerialBus는 The Qt Company의 상용 라이선스에 따라 제공됩니다. 또한 GNU Lesser General Public License 버전 3 또는 GNU General Public License 버전 2에 따라 사용할 수 있습니다. 자세한 내용은 Qt 라이선싱을 참조하십시오.
© 2026 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.