Expand Minimize Picture-in-picture Power Device Status Voice Recognition Skip Back Skip Forward Minus Plus Play Search
Documentation
Sidebar

Alert

Type
Function
Sender
SDL
Purpose
Display an alert message on the HMI

SDL sends the UI.Alert RPC when some information needs to be displayed to the user on a display. The Alert has a softButtons array of buttons which the user can use to take action on the alert.

Must
  1. If the alert includes a soft button of type STEAL_FOCUS and the user presses the button, the HMI must bring the app associated with the Alert into full screen mode.
  2. The HMI must send UI.OnSystemContext with type ALERT for the application which is in FULL mode.
  3. Respond to the Alert earlier than SDL's default timeout of 10 seconds - applicable only to alerts without softButtons.
  4. Display the alert dialog with the text information in the alertFields array and optional softButtons and optional displayIndicator indicating a timeout for the alert
  5. Send Buttons.OnButtonPress and/or Buttons.OnButtonEvent notifications if soft buttons associated with the alert are pressed by the user
  6. Dismiss the alert after the duration has passed since receipt of the request
May

The HMI may provide the user with a system defined "close" button providing the user with the possibility to dismiss the alert. In this case the HMI must still respond to the alert request

Note

An alert may be sent to the HMI for an application which is not currently active. If the alert contains softButtons then the duration will be set to 0

Request

Parameters

Name Type Mandatory Additional
alertStrings Common.TextFieldStruct true array: true
minsize: 0
maxsize: 3
duration Integer true minvalue: 3000
maxvalue: 10000
softButtons Common.SoftButton false array: true
minsize: 0
maxsize: 4
progressIndicator Boolean false
alertType Common.AlertType true
appID Integer true

Response

Parameters

Name Type Mandatory Additional
tryAgainTime Integer false minvalue: 0
maxvalue: 2000000000

Sequence Diagrams

Example Request

{
  "id" : 92,
  "jsonrpc" : "2.0",
  "method" : "UI. Alert",
  "params" :
  {
    "alertStrings" :
    [
      {
         "fieldName" : alertText1,
         "fieldText" : "WARNING"
      },
      {
         "fieldName" : alertText2,
         "fieldText" : "Hard weather conditions"
      }
    ],
    "duration" : 5000,
    "softButtons" :
    {
      "type" : TEXT,
      "text" : "OK",
      "softButtonID" : 697,
      "systemAction" : DEFAULT_ACTION
    },
      "alertType": "BOTH",
    "appID" : 65539
  }
}

Example Response

{
  "id" : 92,
  "jsonrpc" : "2.0",
  "result" :
  {
    "code" : 0,
    "method" : "UI.Alert"
  }
}

Example Error

{
  "id" : 92,
  "jsonrpc" : "2.0",
  "error" :
  {
    "code" : 4,
    "message" : "The requested command was rejected.",
    "data" :
    {
      "tryAgainTime" : 10000,
      "method" : "UI.Alert"
    }
  }
}
View on GitHub.com
Previous Section Next Section