דלגו לתוכן

Device contract

תוכן זה אינו זמין עדיין בשפה שלך.

Every sensor speaks the same small contract over MQTT (QoS 1, JSON). The full specification is docs/event-schema.md, with a JSON Schema in docs/event.schema.json.

Topic When Example
adi/registration On start, then at least every 60 s {"v":1,"device_id":"radar-001","sensor_type":"radar","metrics":["breathing_rate","movement"],"room":"room11","ward":"ward3"}
adi/<ward>/<room>/<device>/event Each reading {"v":1,"device_id":"radar-001","metric":"breathing_rate","value":14.2,"unit":"bpm","ts":"…"}
adi/<ward>/<room>/<device>/heartbeat Every 5 s {"v":1,"device_id":"radar-001","ts":"…"}
adi/<ward>/<room>/<device>/status Retained; the Last Will says offline {"v":1,"device_id":"radar-001","status":"online"}
adi/<ward>/<room>/<device>/cmd From the server {"command":"identify"}: beep or blink

A device reports its room only, never a bed or a resident: the operator decides what it watches when approving it. Events from a device that is not approved are ignored.

An adapter turns one sensor model’s output into these messages: register, send readings, send a heartbeat every 5 seconds, set a Last Will, and answer identify. The simulator (edge/simulator/adisim/devices) and the laptop microphone (edge/micsensor) are two working examples.