Crash

State

Incidents

Declaration

getIncidents()

Example

val state:Crash.State
assertTrue(state.incidents[0].value?.location == CrashIncident.Location.FRONT)
assertTrue(state.incidents[0].value?.severity == CrashIncident.Severity.HIGH)
assertTrue(state.incidents[0].value?.repairs == CrashIncident.Repairs.NEEDED)
// High severity front crash incident needs repairs

Type

Declaration

getType()

Example

val state:Crash.State
assertTrue(state.type.value == Crash.Type.NON_PEDESTRIAN)
// Crash type is non-pedestrian (i.e. a another vehicle)

Tipped state

Declaration

getTippedState()

Example

val state:Crash.State
assertTrue(state.tippedState.value == Crash.TippedState.NOT_TIPPED)
// Crash did not tip over the vehicle

Automatic ecall

Declaration

getAutomaticECall()

Discussion

Automatic emergency call enabled state

Example

val state:Crash.State
assertTrue(state.automaticECall.value == EnabledState.ENABLED)
// Automatic eCall is enabled

Severity

Declaration

getSeverity()

Discussion

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

Example

val state:Crash.State
assertTrue(state.severity.value == 2)
// Crash severity is 2

Impact zone

Declaration

getImpactZone()

Discussion

Impact zone of the crash

Example

val state:Crash.State
assertTrue(state.impactZone.value == Crash.ImpactZone.FRONT_DRIVER_SIDE)
// Impact zone is front driver side

Getters

Get Crash property availability information

Declaration

public GetStateAvailability()
public GetStateAvailability(byte... propertyIdentifiers)

Example

// get all property availabilities
val getAvailability = GetStateAvailability()
// get incident and type property availabilities
val getAvailabilityProperties = GetStateAvailability(0x01, 0x02)

Get Crash properties

Declaration

public GetState()
public GetState(byte... propertyIdentifiers)            

Example

// get all properties
val getState = GetState()
// get incident and type properties
val getStateProperties = GetState(0x01, 0x02)