Back to Serial Studio

Architecture — IO & Drivers

doc/claude/architecture/io.md

4.0.31.4 KB
Original Source

Architecture — IO & Drivers

Part of the architecture corpus (index). Read this file in full before touching app/src/IO/ driver, manager, or protocol code. New drivers go through the ss-new-driver skill (BluetoothLE is the canonical reference).

IO Architecture — No Singleton Drivers

  • 10 drivers, public ctors, no static instance().
  • ConnectionManager (singleton, Cpp_IO_Manager) owns one UI-config instance per type: instance().uart(), .network(), .bluetoothLE(), etc. QML context properties (Cpp_IO_Serial, etc.) point at these.
  • createDriver() makes fresh instances for live connections, owned by DeviceManager.
  • configurationOk() checks the UI driver, not the live one. UI driver's configurationChanged forwards to ConnectionManager::configurationChanged. All drivers must Q_EMIT configurationChanged() from their ctor.
  • Live drivers may have empty device lists. UART/Modbus call refreshSerialDevices() / refreshSerialPorts() in open() if empty.

File Transmission (Pro)

IO::FileTransmission + IO::Protocols::*: controller + XMODEM/YMODEM/ZMODEM. Incoming data routes from ConnectionManager::onRawDataReceivedFileTransmission::onRawDataReceived (guarded by active()). Protocols emit writeRequested(QByteArray); controller calls ConnectionManager::writeData().