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 버스 클래스 내에서 표준 로깅을 활성화합니다. |
qt.canbus.plugins | Qt CAN Bus 플러그인 클래스 내에서 로우 레벨 로깅을 활성화합니다. 특정 플러그인에 대한 로깅을 설정하려면 "qt.canbus.plugins.pluginname"(예: "qt.canbus.plugins.socketcan")을 사용합니다. "qt.canbus.plugins*"는 모든 플러그인에 영향을 줍니다. |
qt.modbus | Qt 모드 버스 클래스 내에서 표준 로깅을 활성화합니다. |
qt.modbus.lowlevel | Qt 모드버스 클래스 내에서 개별 패킷 내용을 포함한 로우 레벨 로깅을 활성화합니다. |
로깅 카테고리는 QtSerialBus 에 대한 추가 경고 및 디버그 출력을 활성화하는 데 사용할 수 있습니다. 로깅에 대한 자세한 정보는 QLoggingCategory 에서 확인할 수 있습니다.
모든 Qt 모드버스 로깅을 활성화하는 빠른 방법은 main() 함수에 다음 줄을 추가하는 것입니다:
QLoggingCategory::setFilterRules(QStringLiteral("qt.modbus* = true"));
예제
모듈 진화
QtSerialBus의 변경 사항에는 Qt 6 시리즈에 적용된 모듈 API와 기능의 중요한 변경 사항이 나열되어 있습니다.
© 2025 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.