Webportal v2

embedded apps

API Reference - HMI.driverDistractionText

Required Privacy: Data & Location
Operation:

This API return the text message send to the user in order to notify driver distraction.

Note: All text returned (title, text and buttons) are displayed according to the HMI current language.

Note 2: The message is returned no matter the driver distraction status. Look at driving.drivingState if you want to retrieve current driving distraction.

Input Parameter
No input params
Output Data
Data name Description Type Unit/Values Example
title

Driver distraction message title.

string

n/a

For your security
text

Driver distraction message content.

string

n/a

This function is disabled while driving.
okButtonText

Text of the 1st button: the driver approve the message. In this case the driver the restriction using infotainment system.

string

n/a

OK
passengerButtonText

Text of the 2nd button: a passenger is using the infotainment system. In this case the passenger can use the infotainment system without restriction.

string

n/a

PASSENGER
Code Example
1
2
3
4
5
6
7
8
9
10
11
12
13
webportal.get(
    /* api name */
    "HMI.driverDistractionText",
    /* parameters */
     null
  )
  /* callback for `REPLY` messages */
  .then((message) => {
    if (message.status === 200) {
      /* handle `REPLY` success */
    }
    else { /* handle `REPLY` error */ }
  })
1
2
3
4
5
6
{
  "id": "7372c16f-5f2f-42c9-84a7-5490e35f1be0", 
  "type": "GET", 
  "api": "HMI.driverDistractionText",
  "params":  null
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
// --- format of the `REPLY` message ---

{
  "id": "7372c16f-5f2f-42c9-84a7-5490e35f1be0",
  "type": "REPLY",
  "api": "HMI.driverDistractionText",
  "status": 200,
  "statusText": "OK", 
  "data":  { 
    "title": "For your security",
    "text": "This function is disabled while driving.",
    "okButtonText": "OK",
    "passengerButtonText": "PASSENGER"
  } 
}

false