42 lines
794 B
Plaintext
42 lines
794 B
Plaintext
@startuml
|
|
skinparam linestyle ortho
|
|
|
|
class Gateway {
|
|
- gateway_id: str
|
|
- mqtt_broker: str
|
|
- mqtt_port: int
|
|
- mqttc: MQTTClient
|
|
--
|
|
+ KEY_WINDOW: 0x01
|
|
+ KEY_HUMIDITY: 0x02
|
|
+ KEY_TEMP: 0x03
|
|
+ KEY_CO2: 0x04
|
|
+ INVALID_VALUE: 0xFFFFFFFF
|
|
+ EXPECTED_PAYLOAD_SIZE: 12
|
|
--
|
|
+ decode_payload(data: bytes): dict
|
|
+ publish(mac: str, data: dict)
|
|
+ on_device_found(device, adv_data)
|
|
+ on_connect(client, userdata, flags, reason_code, properties)
|
|
+ on_publish(client, userdata, mid, reason_code, properties)
|
|
+ run()
|
|
}
|
|
|
|
class BleakScanner {
|
|
+ start()
|
|
+ stop()
|
|
}
|
|
|
|
class MQTTClient {
|
|
+ connect()
|
|
+ publish()
|
|
+ tls_set()
|
|
+ username_pw_set()
|
|
+ loop_start()
|
|
}
|
|
|
|
Gateway o-- BleakScanner
|
|
Gateway o-- MQTTClient
|
|
|
|
@enduml
|