ZendriveMockDrive
@interface ZendriveMockDrive : NSObject
Information of the drive to be simulated. This information will be used in the ZendriveDriveInfo and AccidentInfo objects returned by the ZendriveSDK callbacks via ZendriveDelegateProtocol.
Currently only processStartOfDrive, processEndOfDrive, processAnalysisOfDrive and processAccidentDetected ZendriveSDK callbacks will be received by the application.
Use ZendriveMockDriveBuilder
to construct ZendriveMockDrive
instances.
To build a predefined mock drive, use +[ZendriveMockDriveBuilder presetMockDrive:]
.
To build a custom mock drive, use +[ZendriveMockDriveBuilder newAutoDriveBuilderWithStartTimestamp:endTimestamp:]
.
-
The unique Id for this drive
Declaration
Objective-C
@property (nonatomic, readonly, nonnull) NSString *driveId;
-
The type of the drive. This decides what other info parameters will be populated. See here.
A drive callback will be sent even for falsely detected drives or for non-automobile trips (Eg. biking, public transport).
Declaration
Objective-C
@property (nonatomic, readonly) ZendriveDriveType driveType;
-
Whether the user was a driver or a passenger. See here.
Declaration
Objective-C
@property (nonatomic, readonly) ZendriveUserMode userMode;
-
The start timestamp of trip in milliseconds since epoch.
Declaration
Objective-C
@property (nonatomic, readonly) long long startTimestamp;
-
The end timestamp of trip in milliseconds since epoch.
Declaration
Objective-C
@property (nonatomic, readonly) long long endTimestamp;
-
The average speed of trip in metres/second.
Declaration
Objective-C
@property (nonatomic, readonly) double averageSpeed;
-
Declaration
Objective-C
@property (nonatomic, strong, readonly, nullable) ZendriveVehicleTaggingDetails *vehicleTaggingDetails;
-
The maximum speed of trip in metres/second.
Declaration
Objective-C
@property (nonatomic, readonly) double maxSpeed;
-
The distance of the trip in metres.
Declaration
Objective-C
@property (nonatomic, readonly) double distance;
-
The vehicleType of the trip.
Declaration
Objective-C
@property (nonatomic, readonly) ZendriveVehicleType vehicleType;
-
A list of ZendriveLocationPoint objects corresponding to this trip in increasing order of timestamp. The first point corresponds to trip start location and last to trip end location.
This is a sampled approximation of the drive which gives an indication of the path taken by the driver. It is not the full detailed location data of the drive. If no waypoints are recorded during the drive, this is an empty array.
Declaration
Objective-C
@property (nonatomic, strong, readonly, nonnull) NSArray<ZendriveLocationPoint *> *waypoints;
-
List of ZendriveEvent objects. This array is populated using
ZendriveMockEventBuilder
. See-[ZendriveMockDriveBuilder addEventBuilder:]
Declaration
Objective-C
@property (nonatomic, strong, readonly, nonnull) NSArray<ZendriveEvent *> *events;
-
The event ratings for this trip. See here
Declaration
Objective-C
@property (nonatomic, strong, readonly, nonnull) ZendriveEventRatings *eventRatings;
-
List of
ZendriveMockAccidentInfo
objects. This array is populated usingZendriveMockEventBuilder
(only forZendriveMockAccidentEventBuilder
events). See-[ZendriveMockDriveBuilder addEventBuilder:]
Declaration
Objective-C
@property (nonatomic, strong, readonly, nonnull) NSArray<ZendriveMockAccidentInfo *> *accidentInfos;
-
The driving behaviour score for this trip. See here
Declaration
Objective-C
@property (nonatomic, strong, readonly, nonnull) ZendriveDriveScore *score;
-
The position of the phone during this trip. See this.
Declaration
Objective-C
@property (nonatomic, readonly) ZendrivePhonePosition phonePosition;
-
Delay (from trip start), in milliseconds, with which trip analysis callback should arrive.
Declaration
Objective-C
@property (nonatomic, readonly) int tripStartDelayMillis;
-
Delay (from trip end), in milliseconds, with which trip end callback should arrive.
Declaration
Objective-C
@property (nonatomic, readonly) int tripEndDelayMillis;
-
Delay (from trip end callback), in milliseconds, with which trip analysis callback should arrive.
Declaration
Objective-C
@property (nonatomic, readonly) int tripAnalysisDelayMillis;
-
Start simulation of this mock drive. SDK callbacks will be received at configured times. Some conditions are required to be met before a drive can be simulated. For example:
- Must be a mock drive build. See
ZendriveMockError
- SDK must be setup. See [Zendrive setupWithConfiguration:delegate:completionHandler:]
- AutoDetection mode must be ON.
Only one drive can be simulated at any time. Calling this when another simulation is going on will result in error.
Declaration
Objective-C
- (void)simulateDrive:(long long)runTimeInMillis error:(NSError *_Nullable *_Nullable)error;
Parameters
runTimeInMillis
Duration of this simulation. The configured trip might be very long. But the simulation (trip start to trip analysis) will happen in timeframe of duration runTimeInMillis.
error
A valid error of
kZendriveMockErrorDomain
is returned in case of a failure. Refer toZendriveMockError
for more details on the errors. - Must be a mock drive build. See