How phuonghoang2502/in_vehicle_infotainment works
Project type and purpose
• This is a full-stack, embedded In-Car Infotainment system built on Qt/QML for the UI and C++ for back-end “units,” communicating over CAN (SocketCAN/QtSerialBus) to an STM32 microcontroller and peripherals.
File structure
• Top-level “Infotainment-QT” holds the main QtQuick UI (QML + C++ CanController).
• “Infotainment” folder contains multiple C++ service modules (CANSender, HeadUnit, IPCManager, IVICompositor, InstrumentCluster, PDCUnit, PiracerController, PiracerSender, RemoteSpeaker) plus the top-level main.qml and main.cpp.
• Each service module pairs a QtClass (QML bridge) with a SenderClass (CAN or IPC publisher) and StubImpl (host-side test stub).
• Build files (.pro, qml.qrc) and scripts (enable_can.sh, vcan.sh) show deployment choices.
Extract additional insights from README
• UI uses QtQuick Controls and QtSerialBus for CAN.
• Virtual CAN (vcan0) for host simulation.
• STM32 firmware sits on the bus side (MCP2515 CAN, LDR, ADC, ultrasonic sensor).
• Qt UI Layer
– Infotainment-QT QML screens (Cluster, Home, Navigation, Settings)
– main.qml + CanController (Infotainment-QT/CanController.cpp)
• Application Logic Layer
– C++ Qt classes for each “unit”:
• HeadUnitQtClass
• IVICompositorQtClass
• InstrumentClusterQtClass
• PDCUnitQtClass
• IPCManagerSenderClass
• PiracerController & PiracerSender
• RemoteSpeaker
– Each publishes/subscribes on CAN via QtSerialBus
• CAN Communication Layer
– QtSerialBus / SocketCAN interface
– Virtual CAN adapter (vcan0) or MCP2515 hardware
• Embedded Firmware Layer
– STM32 CAN drivers for MCP2515, sensor drivers (LDR, ADC, HC-SR04)
• Physical Hardware Layer
– Actual CAN bus wiring, MCP2515 module, sensors, actuators
– UI events → C++ QtClass → SenderClass → QtSerialBus → CAN bus
– CAN bus ↔ StubImpl (for host simulation) / real STM32 firmware
– Firmware ↔ sensors/peripherals → CAN bus → back to Qt services → UI updates
c. Architectural patterns & design principles
– MVC/MVVM: QML view + C++ model/controllers
– Micro-service style: each “unit” (HeadUnit, IVICompositor, etc.) is an isolated publisher/subscriber on the CAN bus
– Abstraction for testing: StubImpl classes swap out real CAN endpoints
d. Key technologies/frameworks
– QtQuick Controls 2, QML
– QtSerialBus (CAN)
– SocketCAN (vcan0 or MCP2515 hardware)
– STM32 HAL libraries (for firmware)