Index: docs/SDD/Comms_Overview.puml =================================================================== diff -u -r6d2ef8c97f4bb34204e95811839b3995000c47c1 -r8b98ff34313ee5d3f5d49672d622162acfc755c9 --- docs/SDD/Comms_Overview.puml (.../Comms_Overview.puml) (revision 6d2ef8c97f4bb34204e95811839b3995000c47c1) +++ docs/SDD/Comms_Overview.puml (.../Comms_Overview.puml) (revision 8b98ff34313ee5d3f5d49672d622162acfc755c9) @@ -2,40 +2,49 @@ title Leahi Real-time CDT — Signal/Slot Wiring Overview -participant "Can::CanInterface" as CANI -participant "CloudConnectController" as LRC -participant "Can::MessageDispatcher" as MDISP -participant "CloudConnectServer" as RS -participant "Unix Domain\nSocket (app)" as UDS -participant "Luis application" as APP +participant "Can::CanInterface" as CAN +participant "Can::MessageDispatcher" as DISP +participant "CloudConnectController" as CC +participant "MqttClient" as MQTT +participant "AWS IoT Core" as AWS -== CAN frame → assembled message == +== CloudConnectController signals → slots == -CANI -> LRC : didFrameReceive(QCanBusFrame)\n→ onFrameReceive() -LRC -> MDISP : onFrameReceive(canId, payload) -MDISP -> LRC : didActionReceive(Can::Message)\n→ onMessageReceive() +note over CC + CanInterface::didFrameReceive → CloudConnectController::onCanFrameReceive + MessageDispatcher::didActionReceive → CloudConnectController::onCanMessageReceive + MqttClient::didStateChanged → CloudConnectController::onCloudStateChanged + MqttClient::didMessageStatusChanged → CloudConnectController::onCloudMessageStatusChanged + MqttClient::didMessageReceived → CloudConnectController::onCloudMessageReceived +end note -== Message handling & forwarding == +== CAN frame → Assembled CAN Message == -LRC -> LRC : look up policy in _msgHandling\n(Drop / SendAlways / SendDelta) -LRC -> RS : send(topic, sequence, protobuf payload) -RS -> UDS : write(CloudConnectFrame frame) -UDS -> APP : readyRead +CAN -> CC : didFrameReceive(QCanBusFrame)\n→ onCanFrameReceive() +CC -> DISP : onFrameReceive(canId, payload) +DISP -> CC : didActionReceive(Can::Message)\n→ onCanMessageReceive() -== Cloud delivery (planned — Phase 2/3) == +== CAN Message Routing & MQTT Publish == -note over LRC - The Connectivity Agent socket has been removed. - The spool/publish pipeline that replaces it - (MessageSpool → Router → MqttPublisher, with - SpoolDrain replaying on reconnect) is not yet - implemented — see docs/SDD/AgentMigrationPlan.md. -end note +CC -> CC : policy from LeahiCanRouting.ini\n(Drop / SendAlways / SendDelta) +CC -> CC : canMessageToProtobufByteArray()\n→ protobuf +CC -> MQTT : publish(mqttTopic(topic), payload, pubId, qos = 1) +MQTT -> AWS : PUBLISH (QoS 1, retain = false) -== Connection events == +== MQTT Publish ACK == -RS -> LRC : didConnect()\n→ (future) serial-number handshake -RS -> LRC : didDisconnect()\n→ (future) -RS -> LRC : didMessageReceive()\n→ (future inbound) +AWS -> MQTT : PUBACK +MQTT -> CC : didMessageStatusChanged(id, Acknowledged, props)\n→ onCloudMessageStatusChanged() +== MQTT Subscription == + +CC -> MQTT : subscribe(topic, QoS) +MQTT -> AWS : SUBSCRIBE (topic, requested QoS) +AWS -> MQTT : SUBACK + +== Inbound Subscription == + +AWS -> MQTT : PUBLISH on subscribed topic +MQTT -> CC : didMessageReceived(payload, topic)\n→ onCloudMessageReceived() + @enduml