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.
How a command changes the screen
Section titled “How a command changes the screen”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 |
How a user action sends data back
Section titled “How a user action sends data back”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 itThe two data sources for user identity
Section titled “The two data sources for user identity”| 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_namedoes not change the notification name the duress_appsends. The portal uses its ownassociatedUserfield.
Related
Section titled “Related”- MQTT downlink commands — what the backend can send
- MQTT uplink data — what the device reports
- Device Views — what the wearer sees
- duress_appdocs — how the duress_appmanages assignments