Class diagram shows Gateway structure with attributes, constants and methods, and its dependencies on BleakScanner and MQTTClient. Sequence diagram shows the full data flow from BLE advertising to MQTT publication, including startup, data collection and node failure scenarios. Assisted-by: Claude:claude-sonnet-4-6 — PlantUML syntax
38 lines
617 B
Plaintext
38 lines
617 B
Plaintext
@startuml
|
|
skinparam linestyle ortho
|
|
|
|
class Gateway {
|
|
- gateway_id: str
|
|
- mqtt_broker: str
|
|
- mqtt_port: int
|
|
- service_uuid: str
|
|
- mqttc: MQTTClient
|
|
--
|
|
+ KEY_WINDOW: 0x01
|
|
+ KEY_HUMIDITY: 0x02
|
|
+ KEY_TEMP: 0x03
|
|
+ KEY_CO2: 0x04
|
|
--
|
|
+ decode_payload(data: bytes): dict
|
|
+ publish(mac: str, data: dict)
|
|
+ on_device_found(device, adv_data)
|
|
+ run()
|
|
}
|
|
|
|
class BleakScanner {
|
|
+ start()
|
|
+ stop()
|
|
}
|
|
|
|
class MQTTClient {
|
|
+ connect()
|
|
+ publish()
|
|
+ tls_set()
|
|
+ username_pw_set()
|
|
}
|
|
|
|
Gateway --> BleakScanner : uses
|
|
Gateway --> MQTTClient : uses
|
|
|
|
@enduml
|