A C++17 device-lab console for embedded bring-up, RS485/Modbus test benches, and factory validation workflows. The core library has no GUI dependency so it can run in CI, on Linux gateways, or inside a Qt/MFC desktop shell.
Many hardware and IoT clients need a reliable engineering tool before they need a polished product: scan serial devices, poll registers, detect abnormal values, and export repeatable test evidence. This repository demonstrates that workflow with a reproducible CMake build, tests, and a command-line runner that can be wrapped by Qt Widgets later.
- C++17 core for device profiles, register polling plans, and alarm evaluation.
- Modbus RTU request-frame encoder with CRC16.
- CSV-based profile loading for fast hardware-lab iteration.
- CLI report that summarizes polling workload and threshold violations.
- CTest regression tests for protocol encoding and alarm logic.
- Qt-ready architecture: the
device_lablibrary can be linked from a Qt Widgets front end without coupling the domain logic to UI code.
This is a tested desktop-side protocol core and CLI reference implementation. The current release uses simulated CSV device data. It has not been validated against a physical RS485 adapter, Modbus target, or factory line, and it does not include a completed Qt GUI.
cmake -S . -B build
cmake --build build
ctest --test-dir build --output-on-failure./build/device-lab-console samples/line-controller.csvExample output:
Profile: line-controller-a (3 registers)
Poll interval: 500 ms
Estimated wire time: 45 bytes/cycle
Alarm: motor_current value=18.4 above high limit 16.0
Alarm: ambient_temp value=64.0 above high limit 55.0
The core API is designed for a Qt Widgets app:
- bind
DeviceProfileto a table model, - run polling in a
QThread, - publish alarm state through signals,
- persist user profiles as CSV/JSON.
This keeps the testable device logic independent from the desktop UI.