@startuml SoftwareArchitecture skinparam componentStyle rectangle skinparam defaultTextAlignment center skinparam component { BackgroundColor<> LightYellow BackgroundColor<> LightGray BackgroundColor<> #E8E8F8 BorderStyle<> dashed } title Leahi Real-time CDT — Component Architecture note as N1 The Connectivity Agent process and its Unix domain socket have been removed; CloudConnect is becoming the single conduit to the cloud (docs/SDD/AgentMigrationPlan.md). Dashed = planned, not yet implemented. end note node "Leahi Device" { node "CloudConnect (process)" { component "CloudConnectController" as LRC component "Can::CanInterface" as CAN component "Cloud pipeline\n(MessageSpool, Router,\nMqttPublisher, SpoolDrain)" as PIPE <> } node "Comms (lib)" { component "CloudConnectServer\n(local-socket server)" as RS component "Can::MessageDispatcher\n(per-CAN-id reassembly)" as MDISP component "Can::MessageBuilder\n(frame ↔ message)" as MB component "CloudConnectFrame\n(framing + CRC)" as AM } node "MsgUtils (lib)" { component "LeahiMsgDefs\n(generated C++)" as MD <> } interface "CAN Bus\n(SocketCAN)" as CANBUS interface "Unix Domain Socket\n(/tmp/cloudconnect.sock)" as APPUDS } node "Luis application" { component "Application client" as APP } node "CANDumpPlayer (tool)" { component "CAN dump replay\n(writeFrame → SocketCAN)" as CDP } cloud "AWS Cloud" as CLOUD <> { component "AWS IoT Core\n(MQTT broker)" as IOTCORE <> component "Amazon S3\n(log bundles)" as S3 <> } node "Build-time (scripts)" { component "MsgUtils Python\n(msgutils)" as PYUTILS <> component "Jinja2 Templates\n(MsgDefs_*.jinja)" as JINJA <> component "protoc" as PROTOC <> component "LeahiMsgDefs.proto\n(generated)" as PROTO <> component "LeahiMsgDefs.h/.cpp\n(generated)" as GENCPP <> component "Protobuf stubs\n(.pb.h/.pb.cc)" as PBSTUBS <> } CDP --> CANBUS : writeFrame (replay) CANBUS --> CAN CAN --> LRC : didFrameReceive LRC --> MDISP : onFrameReceive(canId, payload) MDISP --> MB : buildMessage() MB --> MDISP : Can::Message MDISP --> LRC : didActionReceive(Can::Message) LRC --> MD : canMessageToProtobufByteArray() MD --> AM : protobuf bytes LRC --> RS : send(Type, seq, payload) RS --> AM : build() RS --> APPUDS : write frame APPUDS --> APP : readyRead LRC ..> PIPE : route + spool (planned) PIPE ..> IOTCORE : PUBLISH QoS 1 (mTLS 8883) PIPE ..> S3 : multipart upload (HTTPS) PYUTILS --> JINJA : renders JINJA --> PROTO : generates JINJA --> GENCPP : generates PROTO --> PROTOC : input PROTOC --> PBSTUBS : generates GENCPP ..> MD : compiled into PBSTUBS ..> MD : compiled into @enduml