- Fix class diagram: use aggregation (o--) for BleakScanner and MQTTClient - Split sequence diagram into separate files for clarity - Add sequence_startup.puml for gateway initialization - Add sequence_data_collection.puml with error handling - Use collections for BLE broadcaster to reflect multiplicity - Remove loop construct — gateway reacts to packets, ignores intervals - Add discard of unknown UUID packets - Add handling of invalid sensor values
28 lines
718 B
Plaintext
28 lines
718 B
Plaintext
@startuml
|
|
skinparam sequenceMessageAlign center
|
|
|
|
collections "BLE broadcaster" as thingy
|
|
participant "Gateway\n(Raspberry Pi)" as gw
|
|
participant "MQTT Broker\n(RabbitMQ)" as broker
|
|
participant "Database\n(InfluxDB)" as db
|
|
|
|
== Data collection ==
|
|
thingy -> gw : BLE advertising packet
|
|
|
|
alt UUID does not match ef680100
|
|
gw -> gw : discard packet
|
|
else UUID matches
|
|
gw -> gw : extract raw payload
|
|
gw -> gw : decode_payload()
|
|
|
|
alt unknown key or value out of range
|
|
gw -> gw : discard invalid value\nlog warning
|
|
else valid payload
|
|
gw -> gw : add UTC timestamp
|
|
gw -> broker : publish JSON\n{gateway_id}/{mac}/update
|
|
broker -> db : store measurement
|
|
end
|
|
end
|
|
|
|
@enduml
|