45: Alarm
Trigger an alarm, using buzzer, haptics, strobe and optional prompt. Duration header field will control the time the alert is played for, unless legacy alarm action is used.
Payload
| Field | Name | Description | Type | Unit |
|---|---|---|---|---|
| 1 | Legacy alarm action | 4 bytes of encoded data relating to legacy alarm formats. Can not be used with other options. Note using this field will override Duration header field setting | uint32 | |
| 2 | Duration | Duration of alarm in seconds. Max 127s | uint8 | |
| 3 | Buzzer Pattern | uint8 | ||
| 4 | Buzzer Intensity | uint8 | ||
| 5 | Haptics Pattern | uint8 | ||
| 6 | Haptics Intensity | uint8 | ||
| 7 | Strobe Pattern | uint8 | ||
| 8 | Strobe Intensity | uint8 | ||
| 9 | Prompt message | Message to show on the device prompt If not set, no prompt will be shown Prompts can be dismissed by button presses, or automatically after the prompt timeout has expired | ascii | |
| 10 | Prompt timeout | Timeout for the prompt in seconds If not set, prompt will stay until dismissed with a button press | uint8 | |
| 11 | Prompt button 1 | ascii | ||
| 12 | Prompt button 2 | ascii |
Examples
Show an LB prompt on the screen for 1 second
📡 Real example from Generate tool on 2025-10-16This example is generated using the generate tool, and was tested against an RH2 device, sent from Toit.
Code
For convenience, the following constants can be used to reference this message type.