# References (iOS)

## TripResponseStatus

`TripResponseStatus` indicates if the analyzed trip by the DriveQuant servers is valid or not (see `status` property) and provides information on the analysis result:

```swift
public class TripResponseStatus: NSObject {
    public let status: TripResponseStatusType
    public let itinId: String?
    public let localTripId: String?
    public let hasSafetyAndEcoDrivingScore: Bool
    public let info: [TripResponseInfo]
    public let error: TripResponseError?
    
    public func getTrip() -> DKTrip?
}
```

<table><thead><tr><th width="232">Attribute</th><th width="253">Type</th><th>Description</th></tr></thead><tbody><tr><td>status</td><td><code>TripResponseStatusType</code></td><td>Can be <code>tripValid</code> or <code>tripError.</code><br>- <code>tripValid</code> means that the analyzed trip is valid. <br>- <code>tripError</code> means that the trip has been analyzed but an error occurred and data is not valid.</td></tr><tr><td>itinId</td><td><code>String?</code></td><td>The id of the trip if <code>status</code> equals <code>tripValid</code>, otherwise <code>nil</code>.</td></tr><tr><td>localTripId</td><td><code>String?</code></td><td><p>Local and unique trip identifier generated by DriveKit SDK</p><p>⚠️ It is different from the <code>itinId</code> property returned in the <a href="#trip">Trip</a> object.</p></td></tr><tr><td>hasSafetyAndEcoDrivingScore</td><td><code>Bool</code></td><td>If <code>false</code>, it means that the trip is valid but too short to be analyzed.<br>In this case, there is no safety or eco-driving score.<br>It cannot be equals to <code>true</code> if status is not <code>tripValid</code>.</td></tr><tr><td>info</td><td><code>[</code><a href="#tripresponseinfo"><code>TripResponseInfo</code></a><code>]</code></td><td>If <code>status</code> equals <code>tripValid</code>, the DriveQuant servers returns a list of information codes. These are not errors.</td></tr><tr><td>error</td><td><a href="#tripresponseerror"><code>TripResponseError</code></a><code>?</code></td><td>If <code>status</code> equals <code>tripError</code>, error gives you more information about the error that occurred.</td></tr></tbody></table>

This object also provides a method, `getTrip()`, to retrieve from the local database the saved [DKTrip](#trip) if `status` is equal to `tripValid`. In case of error, this method returns `nil`.

### TripResponseInfo

| Value                         | Description                                                                                                                                      |
| ----------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------ |
| engineSpeedNotAvailable       | The engine speed is not available. The trip analysis is performed with an estimated value of the engine speed.                                   |
| engineSpeedIsNull             | The engine speed is always at 0 rpm while the vehicle is moving. The trip analysis is performed but with an estimated value of the engine speed. |
| noVehicleCharacteristics      | The vehicle characteristics are not set or some values are missing. The trip analysis is performed with generic vehicle model parameters.        |
| dataLoss                      | More than 25% of data loss is detected during the trip.                                                                                          |
| distanceTooShort              | The trip was analysed but the distance is not sufficient to provide an accurate energy analysis.                                                 |
| invalidVehicleCharacteristics | The vehicle characteristics are not in the range of available values. See vehicle characteristics for range limits.                              |
| invalidVehicleId              | No vehicle found for the `vehicleId` provided to the API request.                                                                                |

### TripResponseError

| Value                        | Description                                                                                                             |
| ---------------------------- | ----------------------------------------------------------------------------------------------------------------------- |
| noAccountSet                 | The `account` block is not set in the trip data.                                                                        |
| noRouteObjectFound           | The `route` block is not available in the trip data.                                                                    |
| invalidRouteDefinition       | Error when parsing the `route` block                                                                                    |
| noVelocityData               | The vehicle or GPS velocity is not available                                                                            |
| invalidSamplingPeriod        | The input variables have an invalid acquisition period.                                                                 |
| invalidCustomerId            | Unknown `account` value. Unauthorised access.                                                                           |
| noDateFound                  | The field `vehicleDate` or `gpsDate` is not available.                                                                  |
| maxDailyRequestNumberReached | The trip could not be analyzed because you exceeded your daily request quota.                                           |
| dataError                    | The service failed to process your data. There is a need to diagnose your data to determine the origin of this problem. |
| invalidRouteVectors          | The `route` vectors are not of the same size, the service cannot perform the analysis                                   |
| missingBeacon                | The beacon has not been detected and it is required to validate the trip analysis.                                      |
| invalidBeacon                | A beacon was detected during the trip but it does not have the correct identifiers                                      |
| duplicateTrip                | The duplicate trip feature is enabled and the trip has already been analysed                                            |
| `insufficientGpsData`        | The number of GPS points is too low                                                                                     |
| userDisabled                 | The driver is disabled, the service cannot perform the analysis                                                         |
| invalidUser                  | The user identifier is not valid.                                                                                       |
| invalidGpsData               | The dates are inconstistent, the service cannot perform the analysis                                                    |
| invalidTrip                  | The trip has already been analysed by the service and considered as invalid                                             |
| accountLimitReached          | The maximum number of user account reached for the customer                                                             |

## DKTrip

<table><thead><tr><th width="261.66666666666663">Field</th><th width="351">Type</th><th>Description</th></tr></thead><tbody><tr><td>itinId</td><td><code>String</code></td><td>Trip unique identifier.</td></tr><tr><td>endDate</td><td><code>Date?</code></td><td>The end date of the trip.</td></tr><tr><td>startDate</td><td><code>Date?</code></td><td>The start date of the trip.</td></tr><tr><td>vehicleId</td><td><code>String?</code></td><td>The identifier of the vehicle used for this trip, if known.</td></tr><tr><td>transportationMode</td><td><code>TransportationMode</code></td><td>The transportation mode used for this trip, see <a href="../../rest-services/references#transportation-mode">Transportation Mode</a> for the description of the possible values.</td></tr><tr><td>declaredTransportationMode</td><td><code>DKDeclaredTransportationMode?</code></td><td>The transportation mode declared by the user. See <a href="#declaredtransportationmode">DeclaredTransportationMode</a>.</td></tr><tr><td>departureAddress</td><td><code>String?</code></td><td>The full address of the departure of the trip.</td></tr><tr><td>departureCity</td><td><code>String?</code></td><td>The city of the departure of the trip.</td></tr><tr><td>departurePostalCode</td><td><code>String?</code></td><td>The postal code of the trip departure.</td></tr><tr><td>departureState</td><td><code>String?</code></td><td>The state of the trip departure.</td></tr><tr><td>departureCountry</td><td><code>String?</code></td><td>The country of the trip departure.</td></tr><tr><td>arrivalAddress</td><td><code>String?</code></td><td>The full address of the arrival of the trip.</td></tr><tr><td>arrivalCity</td><td><code>String?</code></td><td>The city of the arrival of the trip.</td></tr><tr><td>arrivalPostalCode</td><td><code>String?</code></td><td>The postal code of the trip arrival.</td></tr><tr><td>arrivalState</td><td><code>String?</code></td><td>The state of the trip arrival.</td></tr><tr><td>arrivalCountry</td><td><code>String?</code></td><td>The country of the trip arrival.</td></tr><tr><td>unscored</td><td><code>Bool</code></td><td><code>true</code> if has no safety and eco-driving score.</td></tr><tr><td>occupantInfo</td><td><code>DKOccupantInfo?</code></td><td><p>Indicating whether the occupant was the driver or a passenger. </p><p>See <a href="#dkoccupantinfo">DKOccupantInfo</a></p></td></tr><tr><td>metadata</td><td><code>Dictionary&#x3C;String, String>?</code></td><td>Your specific data attached to the trip.  See <a href="../android/custom-metadata">Custom metadata</a>.</td></tr><tr><td>tripStatistics</td><td><code>DKTripStatistics?</code></td><td>Indicators that characterize the trip conditions. See <a href="../../rest-services/trip#itinerarystatistics">ItineraryStatistics</a>.</td></tr><tr><td>brakeWear</td><td><code>DKBrakeWear?</code></td><td>See <a href="../../rest-services/trip#tire-and-brake-wear-estimates">BrakeWear</a>.</td></tr><tr><td>tireWear</td><td><code>DKTireWear?</code></td><td>See <a href="../../rest-services/trip#tire-and-brake-wear-estimates">TireWear</a>.</td></tr><tr><td>ecoDriving</td><td><code>DKEcoDriving?</code></td><td>See <a href="../../rest-services/trip#eco-driving">EcoDriving</a>.</td></tr><tr><td>ecoDrivingContexts</td><td><code>[DKEcoDrivingContext]?</code></td><td>See <a href="../../rest-services/trip#advanced-eco-driving">AdvancedEcoDriving</a>.</td></tr><tr><td>fuelEstimation</td><td><code>DKFuelEstimation?</code></td><td>See <a href="../../rest-services/trip#fuel-estimation">FuelEstimation</a>.</td></tr><tr><td>fuelEstimationContexts</td><td><code>[DKFuelEstimationContext]?</code></td><td>See <a href="../../rest-services/trip#advanced-fuel-estimation">Advanced fuel estimation</a>.</td></tr><tr><td>safety</td><td><code>DKSafety?</code></td><td>See <a href="../../rest-services/trip#safety">Safety</a>.</td></tr><tr><td>safetyContexts</td><td><code>[DKSafetyContext]?</code></td><td>See <a href="../../rest-services/trip#advanced-safety">AdvancedSafety</a>.</td></tr><tr><td>safetyEvents</td><td><code>[DKSafetyEvents]?</code></td><td>See <a href="../../rest-services/trip#safetyevents">SafetyEvents</a>.</td></tr><tr><td>driverDistraction</td><td><code>DKDriverDistraction?</code></td><td>See <a href="../../rest-services/trip#driver-distraction-score">DriverDistraction</a>.</td></tr><tr><td>pollutants</td><td><code>DKPollutants?</code></td><td>See <a href="../../rest-services/trip#pollutants">Pollutants</a>.</td></tr><tr><td>speedingStatistics</td><td><code>DKSpeedingStatistics?</code></td><td>See <a href="../../rest-services/trip#speed-limit">Speed Limit</a>.</td></tr><tr><td>speedLimitContexts</td><td><code>[DKSpeedLimitContext]?</code></td><td>See <a href="../../rest-services/trip#speedlimitcontexts">SpeedLimitContexts</a>.</td></tr><tr><td>calls</td><td><code>[DKCall]?</code></td><td>See <a href="../../rest-services/trip#call">CallEvent</a>.</td></tr><tr><td>energyEstimation</td><td><code>DKEnergyEstimation?</code></td><td>See <a href="../../rest-services/trip#energyestimation">EnergyEstimation</a>.</td></tr><tr><td>advancedEnergyEstimation</td><td><code>[DKAdvancedEnergyEstimation]?</code></td><td>See <a href="../../rest-services/trip#advancedenergyestimation">AdvancedEnergyEstimation</a>.</td></tr></tbody></table>

### DKOccupantInfo

<table><thead><tr><th width="188">Field</th><th width="159">Type</th><th>Description</th></tr></thead><tbody><tr><td>role</td><td><code>DKOccupantRole</code></td><td><p>Indicates the role of the occupant.</p><p>See <a href="#dkoccupantrole">DKOccupantRole</a>.</p></td></tr><tr><td>passengerProbability</td><td>Int</td><td>Probability, expressed as a percentage, that the vehicle occupant is a passenger.</td></tr></tbody></table>

### DKOccupantRole

<table><thead><tr><th width="206">Value</th><th>Description</th></tr></thead><tbody><tr><td>driver</td><td>The vehicle occupant is very likely to be a driver.</td></tr><tr><td>passenger</td><td>The vehicle occupant is very likely to be a passenger.</td></tr><tr><td>unavailable</td><td>The trip data and historical information about the user's habits do not allow determining whether the occupant is a driver or a passenger. In this case, we recommend considering the occupant as the driver for this trip.</td></tr><tr><td>notApplicable</td><td>The trip was made using public transportation (such as train or bus) or by a mode of transport other than a car (e.g., bicycle, boat, plane). In these cases, driver/passenger detection is not performed.</td></tr></tbody></table>

### DKDeclaredTransportationMode

The user has the possibility to declare the transportation mode that was used during a trip to confirm the one detected or to change it, and to declare whether the trip was made as a passenger or as the driver.

Here is the description of the corresponding object:

<table><thead><tr><th width="197">Field</th><th width="214">Type</th><th>Description</th></tr></thead><tbody><tr><td>transportationMode</td><td>TransportationMode</td><td>The transportation mode declared by the user for this trip. See <a href="../../rest-services/references#transportation-mode">Transportation Mode</a> for the description of the possible values.</td></tr><tr><td>passenger</td><td><code>Boolean?</code></td><td><code>true</code> if the trip was made as a passenger, <code>false</code> if the trip was made as the driver.</td></tr><tr><td>comment</td><td><code>String?</code></td><td>The comment associated to this declaration.</td></tr></tbody></table>

## DKTripRecordingStartedState

This object is returned in the [`TripListener`](https://docs.drivequant.com/trip-analysis/ios/triplistener)'s `tripRecordingStarted()` callback.

<table><thead><tr><th width="205">Field</th><th width="137">Type</th><th>Description</th></tr></thead><tbody><tr><td>localTripId</td><td>String</td><td><p>Local and unique trip identifier generated by DriveKit SDK</p><p>⚠️ It is different from the <code>itinId</code> property returned in the <a href="#trip">Trip</a> object, which corresponds to the unique trip identifier generated after the data analysis.</p></td></tr><tr><td>startMode</td><td>StartMode</td><td>Indicates how the trip started. Possible values are describe <a href="#startmode">here</a>.</td></tr><tr><td>recordingStartDate</td><td>Date</td><td>Date when DriveKit has started the trip recording.<br>⚠️  It is not the recalculated trip start date returned in <a href="#tripresponsestatus">TripResponseStatus</a> after DriveQuant platform's analysis.</td></tr></tbody></table>

## DKTripRecordingConfirmedState

This object is returned in the [`TripListener`](https://docs.drivequant.com/trip-analysis/ios/triplistener)'s `tripRecordingConfirmed()` callback.

<table><thead><tr><th width="205">Field</th><th width="137">Type</th><th>Description</th></tr></thead><tbody><tr><td>localTripId</td><td>String</td><td><p>Local and unique trip identifier generated by DriveKit SDK</p><p>⚠️ It is different from the <code>itinId</code> property returned in the <a href="#trip">Trip</a> object, which corresponds to the unique trip identifier generated after the data analysis.</p></td></tr><tr><td>startMode</td><td>StartMode</td><td>Indicates how the trip started. Possible values are describe <a href="#startmode">here</a>.</td></tr><tr><td>recordingStartDate</td><td>Date</td><td>Date when DriveKit has started the trip recording.<br>⚠️  It is not the recalculated trip start date returned in <a href="#tripresponsestatus">TripResponseStatus</a> after DriveQuant platform's analysis.</td></tr><tr><td>recordingConfirmationDate</td><td>Date</td><td>Date when the trip entered into the confirmation state.</td></tr></tbody></table>

## DKTripRecordingCanceledState

This object is returned in the [`TripListener`](https://docs.drivequant.com/trip-analysis/ios/triplistener)'s `tripRecordingCanceled()` callback.

<table><thead><tr><th width="205">Field</th><th width="137">Type</th><th>Description</th></tr></thead><tbody><tr><td>localTripId</td><td>String</td><td><p>Local and unique trip identifier generated by DriveKit SDK</p><p>⚠️ It is different from the <code>itinId</code> property returned in the <a href="#trip">Trip</a> object, which corresponds to the unique trip identifier generated after the data analysis.</p></td></tr><tr><td>startMode</td><td>StartMode</td><td>Indicates how the trip started. Possible values are describe <a href="#startmode">here</a>.</td></tr><tr><td>recordingStartDate</td><td>Date</td><td>Date when DriveKit has started the trip recording.<br>⚠️  It is not the recalculated trip start date returned in <a href="#tripresponsestatus">TripResponseStatus</a> after DriveQuant platform's analysis.</td></tr><tr><td>recordingConfirmationDate</td><td>Date?</td><td>Date when the trip was confirmed if the trip entered into the confirmation state.</td></tr><tr><td>cancelationReason</td><td>DKTripCancelationReason</td><td><p>Indicates how the trip was canceled.</p><p>Possible values are described <a href="#dktripcancelationreason">here</a>.</p></td></tr></tbody></table>

## DKTripRecordingFinishedState

This object is returned in the [`TripListener`](https://docs.drivequant.com/trip-analysis/ios/triplistener)'s `tripRecordingFinished()` callback.

<table><thead><tr><th width="205">Field</th><th width="137">Type</th><th>Description</th></tr></thead><tbody><tr><td>localTripId</td><td>String</td><td><p>Local and unique trip identifier generated by DriveKit SDK</p><p>⚠️ It is different from the <code>itinId</code> property returned in the <a href="#trip">Trip</a> object, which corresponds to the unique trip identifier generated after the data analysis.</p></td></tr><tr><td>startMode</td><td>StartMode</td><td>Indicates how the trip started. Possible values are describe <a href="#startmode">here</a>.</td></tr><tr><td>recordingStartDate</td><td>Date</td><td>Date when DriveKit has started the trip recording.<br>⚠️  It is not the recalculated trip start date returned in <a href="#tripresponsestatus">TripResponseStatus</a> after DriveQuant platform's analysis.</td></tr><tr><td>recordingConfirmationDate</td><td>Date</td><td>Date when the trip was confirmed if the trip entered into the confirmation state.</td></tr><tr><td>recordingEndDate</td><td>Date</td><td>Date when DriveKit has terminated the trip recording.<br>⚠️  It is not the trip end date returned in <a href="#tripresponsestatus">TripResponseStatus</a> after DriveQuant platform's analysis..</td></tr></tbody></table>

## StartMode

StartMode indicates how the trip is started. It is an enum with the following values:

| Value              | Description                                                                                                                               |
| ------------------ | ----------------------------------------------------------------------------------------------------------------------------------------- |
| gps                | Automatic start when the SDK detects a change in user's position                                                                          |
| beacon             | Automatic start due to the presence of a beacon                                                                                           |
| manual             | Trip started manually by calling the method [`startTrip`](https://docs.drivequant.com/trip-analysis/tripmanagement#manually-start-a-trip) |
| geozone            | Automatic start when the SDK detects that you exit the zone where your vehicle may be parked                                              |
| bluetooth          | Automatic start by detecting a connection to a known vehicle's Bluetooth system                                                           |
| unknown\_bluetooth | Automatic start by detecting a connection to an unknown vehicle's Bluetooth system                                                        |

## DKTripCancelationReason

| Value                  | Description                                                                                                                                                                                                                                                        |
| ---------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| user                   | Trip canceled by calling the method [`cancelTrip`](https://docs.drivequant.com/trip-analysis/tripmanagement#cancel-a-trip)                                                                                                                                         |
| highSpeed              | Trip canceled because speed was too high (train, airplane)                                                                                                                                                                                                         |
| noSpeed                | Trip canceled because speed was too slow to be made in a vehicle                                                                                                                                                                                                   |
| noBeacon               | Trip canceled because the beacon was not detected while it was [required](https://docs.drivequant.com/trip-analysis/beacon-usage#beacon-required)                                                                                                                  |
| noBluetoothDevice      | Trip canceled because the Bluetooth device was not detected while it was [required](https://docs.drivequant.com/trip-analysis/bluetooth-usage#bluetooth-device-required).                                                                                          |
| missingConfiguration   | Trip canceled because DriveKit was not configured                                                                                                                                                                                                                  |
| noLocationData         | Trip canceled because no location data was recorded                                                                                                                                                                                                                |
| reset                  | Trip canceled because SDK configuration has been [reset](https://docs.drivequant.com/get-started-drivekit/ios/advanced-configurations#reset).                                                                                                                      |
| beaconNoSpeed          | Trip canceled because the beacon is near the smartphone but there was no movement (zero or low speed)                                                                                                                                                              |
| bluetoothDeviceNoSpeed | Trip canceled because the Bluetooth device is connected to the smartphone but there was no movement (zero or low speed)                                                                                                                                            |
| appKilled              | <p>The trip recording has been canceled due to an app termination.<br>The trip is not sent to the DriveQuant's platform for analysis because it has never entered in confirmation state, or the Bluetooth device/Beacon is required but has not been detected.</p> |

## TripPoint

TripPoint is an object that contains data for each location registered by the SDK.

| Attribute | Type   | Description                                        |
| --------- | ------ | -------------------------------------------------- |
| latitude  | Double | Latitude                                           |
| longitude | Double | Longitude                                          |
| speed     | Double | Speed in km/h                                      |
| accuracy  | Double | Accuracy of the GPS data in meter                  |
| elevation | Double | Elevation in meter                                 |
| distance  | Double | Distance since the beginning of the trip in meter  |
| heading   | Double | Heading                                            |
| duration  | Double | Duration since the beginning of the trip in second |

## TripVehicle

TripVehicle is an object that contains vehicle detailed characteristics.

```swift
public class TripVehicle {
    public var carTypeIndex: Int = 1
    public var carEngineIndex: Int = 1
    public var carPower: Double = 150.0
    public var carMass: Double = 1400.0
    public var carGearboxIndex: Int = 2
    public var carConsumption: Double = 4.5
    public var carAutoGearboxNumber: Int = 0
    public var engineDisplacement: Double = 1_200.0
    public var frontTireSize: String?
    public var rearTireSize: String?
    public var length: Double
    public var width: Double
    public var height: Double
    public var engineCylinderNb: Int
    public var driveWheels: Int
}
```

| Attribute            | Type   | Description                                                                                                                                                                                              | Default value, if not specified |
| -------------------- | ------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------- |
| carTypeIndex         | Int    | [Vehicle body type](https://docs.drivequant.com/rest-services/references#vehicle-body-type)                                                                                                              | 1                               |
| carEngineIndex       | Int    | [Engine type](https://docs.drivequant.com/rest-services/references#engine-type)                                                                                                                          | 1                               |
| carPower             | Double | Vehicle power in hp. This value must be entered in horsepower. In case you only have the engine power in kW you can apply the following formula: $$P \[hp] = P \[kW] / 0.7355$$ (min: 40 hp, max 450 hp) | 150                             |
| carMass              | Double | Vehicle mass in kg (min: 700 kg, max: 3500 kg)                                                                                                                                                           | 1400                            |
| carGearboxIndex      | Int    | [Gearbox type](https://docs.drivequant.com/rest-services/references#gearbox-type)                                                                                                                        | 2                               |
| carConsumption       | Double | Combined fuel consumption \[l/100km] measured during the New European Driving Cycle (NEDC). (min: 3 l/100km, max: 20 l/100km)                                                                            | 4.5                             |
| carAutoGearboxNumber | Int    | Number of gear ratios for the automatic gearbox. This parameter is taken into account only if `carGearboxIndex` is set to 1.                                                                             | 6                               |
| engineDisplacement   | double | Engine displacement in liters                                                                                                                                                                            | 1200                            |
| frontTireSize        | string | Front tire size                                                                                                                                                                                          | "205/55/16"                     |
| rearTireSize         | string | Rear tire size                                                                                                                                                                                           | "205/55/16"                     |
| length               | double | Vehicle length in meter                                                                                                                                                                                  | 4.5                             |
| width                | double | Vehicle width in meter                                                                                                                                                                                   | 1.8                             |
| height               | double | Vehicle height in meter                                                                                                                                                                                  | 1.45                            |
| driveWheels          | Int    | [​Drive wheels type​](https://docs.drivequant.com/trip-analysis/rest-services/references#drive-wheels-type)                                                                                              | 0                               |
| engineCylinderNb     | Int    | Number of cylinders                                                                                                                                                                                      | 4                               |

## BeaconData

BeaconData is an object that contains beacon characteristics.

| Attribute     | Type   | Description                   |
| ------------- | ------ | ----------------------------- |
| proximityUuid | String | Beacon proximity UUID         |
| major         | Int    | Beacon major value (optional) |
| minor         | Int    | Beacon minor value (optional) |

## BluetoothData

BluetoothData is an object that contains the Bluetooth device characteristics.

| Attribute  | Type   | Description                         |
| ---------- | ------ | ----------------------------------- |
| macAddress | String | Required MAC address of the device  |
| name       | String | Optional display name of the device |

## DKCrashInfo

Crash information object have the following structure:

```swift
public class DKCrashInfo {
    public let crashId: String
    public let date: Date
    public let probability: Int
    public let latitude: Double
    public let longitude: Double
    public let velocity: Double
    public let crashStatus: DKCrashStatus
    public let userLocationUrl: String?
}
```

with the following enumeration for crash status

```swift
public enum DKCrashStatus {
    case unconfirmed
    case confirmed
}
```

| Attribute       | Type            | Description                                                                                                                                                                                                                      |
| --------------- | --------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| crashId         | String          | Crash unique identifier                                                                                                                                                                                                          |
| date            | Date            | <p>Crash date </p><p>Example: <code>2023-03-07T09:13:22.461+0200</code></p>                                                                                                                                                      |
| probability     | Int             | Crash probability (in %)                                                                                                                                                                                                         |
| latitude        | Double          | Coordinates (latitude) of the crash                                                                                                                                                                                              |
| longitude       | Double          | Coordinates (longitude) of the crash                                                                                                                                                                                             |
| velocity        | Double          | Velocity at time of crash                                                                                                                                                                                                        |
| crashStatus     | `DKCrashStatus` | Crash status enum. Two possible values: `confirmed` or `unconfirmed`                                                                                                                                                             |
| userLocationUrl | String?         | <p>When a crash is confirmed and <a href="../../push-services/push-crash-data">push crash data</a> is activated, an URL of the map that will display the location data is returned.</p><p>Otherwise, it is <code>nil</code>.</p> |

## DKCrashFeedbackConfig

`DKCrashFeedbackConfig` is an object used to configure the Crash Detection feedback feature.

| Attribute              | Type                        | Description                                                                                                                                                                                                                                       |
| ---------------------- | --------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| notification           | DKCrashFeedbackNotification | Configuration of the notification                                                                                                                                                                                                                 |
| crashVelocityThreshold | Double                      | <p>Minimal speed when the crash occurred.</p><p>For example, if <code>crashVelocityThreshold</code> is set at 20 km/h and a crash occurred at 10 km/h, feedback will not be sent to the user. </p><p><strong>Default value</strong>: 0.0 km/h</p> |

## DKCrashFeedbackNotification

| Attribute  | Type         | Description                                                                                                                                       |
| ---------- | ------------ | ------------------------------------------------------------------------------------------------------------------------------------------------- |
| title      | String       | Title that appears on the notification                                                                                                            |
| message    | String       | Message that appears on the notification                                                                                                          |
| crashAlert | DKCrashAlert | <p>Enum value that describes how the user will be noticed when a feedback is asked</p><p><strong>Default value</strong>: <code>silence</code></p> |

## DKCrashAlert

| Enum value        | Description                      |
| ----------------- | -------------------------------- |
| silence           | Device will not vibrate nor ring |
| vibration         | Device will vibrate              |
| soundAndVibration | Device will ring and vibrate     |

## CrashFeedbackType

| Enum value | Description                       |
| ---------- | --------------------------------- |
| noCrash    | User said that no crash occurred  |
| confirmed  | User confirmed a crash            |
| noFeedback | User did not provide any feedback |

## CrashFeedbackSeverity

| Enum value | Description                      |
| ---------- | -------------------------------- |
| none       | User said that no crash occurred |
| minor      | User confirmed a minor crash     |
| critical   | User confirmed a critical crash  |

### DKTripLocation

<table data-full-width="false"><thead><tr><th>Property/Method</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td>date</td><td>Date</td><td>Date of the end of trip.</td></tr><tr><td>latitude</td><td>Double</td><td>Latitude of the end of the trip.</td></tr><tr><td>longitude</td><td>Double</td><td>Longitude of the end of the trip.</td></tr><tr><td>accuracyMeter</td><td>Double</td><td>GPS data accuracy value in meters.</td></tr><tr><td>func getAccuracyLevel()</td><td>DKCoordinateAccuracy</td><td>GPS data accuracy level. Possible values are described below.</td></tr></tbody></table>

### DKCoordinateAccuracy

For ease of use, this function provides a position accuracy indicator with a 3-level scale.

| Name | Description                                   |
| ---- | --------------------------------------------- |
| good | The GPS accuracy is strictly below 10 meters. |
| fair | The GPS accuracy is between 10 and 30 meters. |
| poor | The GPS accuracy is strictly above 30 meters. |

## CancelTrip (Deprecated)

CancelTrip indicates how the trip was cancelled. It is an enum with the following values:

<table><thead><tr><th width="343">Value</th><th>Description</th></tr></thead><tbody><tr><td>user</td><td>Trip cancelled by calling the method <a href="../tripmanagement#cancel-a-trip"><code>cancelTrip</code></a></td></tr><tr><td>highspeed</td><td>Trip cancelled because speed was too high (train, airplane)</td></tr><tr><td>noSpeed</td><td>Trip cancelled because speed was too slow to be in a vehicle</td></tr><tr><td>noBeacon</td><td>Trip cancelled because the beacon was not detected while it was  <a href="../beacon-usage#beacon-required">required</a></td></tr><tr><td>missingConfiguration</td><td>Trip cancelled because DriveKit was not configured</td></tr><tr><td>noGPSData</td><td>Trip cancelled because no GPS data was recorded</td></tr><tr><td>reset</td><td>Trip cancelled because SDK configuration has been <a href="../../../get-started-drivekit/ios/advanced-configurations#reset-the-module">reset</a></td></tr><tr><td>beaconNoSpeed</td><td>Trip cancelled because the beacon is near the smartphone but there is no movement (zero or low speed)</td></tr><tr><td>bluetoothDeviceNoSpeed</td><td>Trip cancelled because the Bluetooth device is connected to the smartphone but there was no movement (zero or low speed)</td></tr></tbody></table>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.drivequant.com/trip-analysis/ios/references.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
