Skip to content

Message List

The msglist widget stores an array of message objects. You control its contents by sending a new value for the widget in the data section of an app downlink message (see MQTT Topics).

{
"app": {
"<dvname>": {
"data": {
"<widgetname>": <VALUE>
}
}
}
}

The operation performed depends on the type and structure of the VALUE provided.


Send an object (or array containing an object) with an id that does not already exist, or omit the id entirely. The device automatically assigns ts (timestamp) and isRead: false.

Field Type Required Description
id string / number Yes Unique identifier for the message
subj string Yes Subject or originating user name
location string No Location string
resp number No Number of responders
fid string No Folder ID for grouping (defaults to "Urgent")
ts number No Epoch timestamp — auto-assigned if missing
isRead boolean No Read flag — auto-assigned false if missing
{
"app": {
"duress": {
"data": {
"alerts": [
{
"id": "5",
"subj": "Dr Tata",
"location": "A&E",
},
],
},
},
},
}

Include an actions array in the same message to switch UI focus immediately (e.g. gotoWidget):

{
"app": {
"duress": {
"data": {
"alerts": [
{
"id": "5",
"subj": "Dr Tata",
"location": "A&E",
},
],
},
"actions": [
{
"a": "gotoWidget",
"p": "duress.alerts",
},
],
},
},
}

Send an object with an id that already exists in the list. Fields present in the object are updated, new fields are added, and fields set to null are removed.

{
"app": {
"duress": {
"data": {
"alerts": {
"id": "5",
"resp": 2,
"location": null,
},
},
},
},
}

This example updates responder count to 2 and removes the location field.


Send an object containing only the id field:

{
"app": {
"duress": {
"data": {
"alerts": {
"id": "5",
},
},
},
},
}

Send a plain string matching the message id:

{
"app": {
"duress": {
"data": {
"alerts": "5",
},
},
},
}

Send an empty array [] to clear the entire message list feed:

{
"app": {
"duress": {
"data": {
"alerts": [],
},
},
},
}

When messages arrive over BLE using GATT service, they are binary encoded as TLV packets. Tag 0x05 is reserved for duress.alerts.

Offset Field Description
0x00 id Message ID (0–255)
0x01 resp Number of responders
0x02–0x03 location 2 ASCII characters
0x04–0x10 subj Subject name ASCII text
  • Add alert ({"id":1, "subj":"Brian", "resp":0, "location":"aa"}):

    05 09 01 00 61 61 42 72 69 61 6e 00 00
  • Update responder count ({"id":1, "resp":2}):

    05 02 01 02 00 00 00 00 00 00 00 00 00
  • Delete alert ({"id":1}):

    05 01 01 00 00 00 00 00 00 00 00 00 00

Firmware decodes BLE TLV packets directly into JSON structures and processes them identically to Wi-Fi MQTT messages.