Skip to content

System Overview — MQTT & Device Views

The CC2 device is controlled by MQTT commands (downlink) and reports state via MQTT data (uplink). What the wearer sees on the screen is defined by Device Views (DVs) — JSON files stored in /dvs/.

These three layers are connected by shared key paths and widget names.


duress_app/ Backend
│
▼ MQTT downlink
┌──────────────────────────────────────────┐
│ {"app":{"duress":{"data":{"alerts":[ │
│ {"id":"1","subj":"Nurse A", │
│ "location":"ICU","resp":0} │
│ ]}}}} │
└──────────────────────────────────────────┘
│
▼ Device receives MQTT
┌──────────────────────────────────────────┐
│ duress DV -> alerts msglist │
│ Widgets updated: subj, location, resp │
│ DED skeleton shows alert detail │
└──────────────────────────────────────────┘

Key paths that link MQTT to DVs:

MQTT key DV widget bound to it Used in
app.duress.data.alerts alerts msglist duress
devcfg.ui.lang devcfg.ui.lang (editable) syscfg
devcfg.ui.enable_lock devcfg.ui.enable_lock (bool) syscfg
devcfg.alert.showFlash devcfg.alert.showFlash (bool) duress (page 2)
devdata.power.gauge devdata.power.gauge (dynamic) sysinfo, allocated_home
devdata.fw.device_id devdata.fw.device_id (dynamic) sysinfo, allocated_home, duresstest

Wearer taps "Acknowledge" button on alert
│
▼ DV action fires
┌──────────────────────────────────────────┐
│ {"a":"updateRemote","p":"yes"} │
└──────────────────────────────────────────┘
│
▼ Device sends MQTT uplink
┌──────────────────────────────────────────┐
│ {"app":{"duress":{"alerts":{ │
│ "id":"1","ackyes":"yes" │
│ }}}} │
└──────────────────────────────────────────┘
│
▼ duress_app/ Backend receives it

Source Widget Used for
Device config (allocdata) user_name, user_role Wearer sees their own name on duresshome, badge_lock
Portal (MQTT app.duress) subj, location Recipient sees the alert sender’s name on duress

They are completely independent. Changing the device’s user_name does not change the notification name the duress_appsends. The portal uses its own associatedUser field.