Crash

getState([, propertyNames])

Declaration

hmkit.commands.Crash.getState()

Parameters

propertyNames

(optional) Array of names of the properties you want returned.

Returns

CrashResponse

Example

hmkit.telematics.sendCommand(
  hmkit.commands.Crash.getState(),
  accessCertificate
);

CrashResponse

Parameters

incidents(Object)
data.value

(Array)

timestamp

(Date)

type(Object)
data.value

(String) (enum)

timestamp

(Date)

tippedState(Object)
data.value

(String) (enum)

timestamp

(Date)

automaticECall(Object)
data.value

(String) (enum) Automatic emergency call enabled state

timestamp

(Date)

severity(Object)
data.value

(Number) (uinteger) Severity of the crash (from 0 to 7 - very high severity)

timestamp

(Date)

impactZone(Object)
data.value

(String) (enum) Impact zone of the crash

timestamp

(Date)

Example

{
  "incidents": [
    {
      "timestamp": "2021-06-01T15:48:04.887Z",
      "data": {
        "location": {
          "value": "front"
        },
        "severity": {
          "value": "high"
        },
        "repairs": {
          "value": "needed"
        }
      }
    },
    {
      "timestamp": "2021-06-01T15:48:04.887Z",
      "data": {
        "location": {
          "value": "lateral"
        },
        "severity": {
          "value": "medium"
        },
        "repairs": {
          "value": "needed"
        }
      }
    },
    {
      "timestamp": "2021-06-01T15:48:04.887Z",
      "data": {
        "location": {
          "value": "rear"
        },
        "severity": {
          "value": "low"
        },
        "repairs": {
          "value": "not_needed"
        }
      }
    }
  ],
  "type": {
    "timestamp": "2021-06-01T15:48:04.887Z",
    "data": {
      "value": "non_pedestrian"
    }
  },
  "tippedState": {
    "timestamp": "2021-06-01T15:48:04.887Z",
    "data": {
      "value": "not_tipped"
    }
  },
  "automaticECall": {
    "timestamp": "2021-06-01T15:48:04.887Z",
    "data": {
      "value": "enabled"
    }
  },
  "severity": {
    "timestamp": "2021-06-01T15:48:04.887Z",
    "data": {
      "value": 2
    }
  },
  "impactZone": {
    "timestamp": "2021-06-01T15:48:04.887Z",
    "data": {
      "value": "front_driver_side"
    }
  }
}

getAvailability([, propertyNames])

Declaration

hmkit.commands.Crash.getAvailability()

Parameters

propertyNames

(optional) Array of names of the properties you want returned.

Example

// Get availability for all properties
hmkit.telematics.sendCommand(
  hmkit.commands.Crash.getAvailability(),
  accessCertificate
);
// Get availability for specific properties
hmkit.telematics.sendCommand(
  hmkit.commands.Crash.getAvailability(['incidents']),
  accessCertificate
);

Response

Parameters

availability(Object)
updateRate.value

(String) enum

rateLimit.value

(Number)

rateLimit.unit

(String)

appliesPer.value

(String)

Discussion

The response contains an availability object for each property, as shown in the example

Example

{
  "incidents": {
    "availability": {
      "updateRate": {
        "value": "trip_high"
      },
      "rateLimit": {
        "value": 64,
        "unit": "hertz"
      },
      "appliesPer": {
        "value": "vehicle"
      }
    }
  }
}