Table of Contents

Class DeviceStatusInfo

Namespace
Geotab.Checkmate.ObjectModel
Assembly
Geotab.Checkmate.ObjectModel.dll

Represents the current state of a vehicle by providing information such as the vehicle bearing location and speed, active exception events and whether the device is currently communicating.

public class DeviceStatusInfo : EntityWithVersion, IEntity, IComparable, IIdentifiable, IVersion, IDateTimeProvider, IDeviceProvider, IDriverProvider, IGroupLinked, IDefaultable
Inheritance
DeviceStatusInfo
Implements
Inherited Members

Constructors

DeviceStatusInfo()

Initializes a new instance of the DeviceStatusInfo class.Constructor.

public DeviceStatusInfo()

DeviceStatusInfo(Id, long, Device, Driver, IList<ExceptionEvent>, int?, bool, in TimeSpan, double?, double?, float?, DateTime?, bool, Dictionary<Id, IDeviceStatusInfoDiagnostic>?)

Initializes a new instance of the DeviceStatusInfo class.Constructor.

public DeviceStatusInfo(Id id, long version, Device device, Driver driver, IList<ExceptionEvent> exceptionEvents, int? bearing, bool isDriving, in TimeSpan currentStateDuration, double? latitude, double? longitude, float? speed, DateTime? dateTime, bool isHistoricLastDriver, Dictionary<Id, IDeviceStatusInfoDiagnostic>? diagnostics)

Parameters

id Id

id.

version long

The version.

device Device

The Device that received the message.

driver Driver

The Driver of the vehicle.

exceptionEvents IList<ExceptionEvent>

Exception events which occured during most recent status update.

bearing int?

Device bearing.

isDriving bool

Vehicle is being operated by a Driver.

currentStateDuration TimeSpan

Amount of time in current state.

latitude double?

Latitude.

longitude double?

Longitude.

speed float?

Speed of the vehicle.

dateTime DateTime?

Date of the status.

isHistoricLastDriver bool

Driver is last operator of vehicle.

diagnostics Dictionary<Id, IDeviceStatusInfoDiagnostic>

Dictionary of all latest diagnostics

Properties

Bearing

Gets or sets the bearing (heading) in integer degrees. Valued between 0 and 359 inclusive. 0 represents North, 90 represents East, and so on. -1 represents unknown bearing.

public int? Bearing { get; set; }

Property Value

int?

int.

CurrentStateDuration

Gets or sets the duration between the last Trip state change (i.e. driving or stop), and the most recent date of location information.

public TimeSpan? CurrentStateDuration { get; set; }

Property Value

TimeSpan?

TimeSpan

DateTime

Gets or sets the most recent DateTime of the latest piece of status, gps or fault data.

public DateTime? DateTime { get; set; }

Property Value

DateTime?

DateTime.

Device

Gets or sets the Device this DeviceStatusInfo belongs to.

public Device? Device { get; set; }

Property Value

Device

Device.

Diagnostics

Gets or sets a dictionary for latest IDeviceStatusInfoDiagnostic(s) of current Device.

public Dictionary<Id, IDeviceStatusInfoDiagnostic>? Diagnostics { get; set; }

Property Value

Dictionary<Id, IDeviceStatusInfoDiagnostic>

dictionary for IDeviceStatusInfoDiagnostic

Driver

Gets or sets the Driver associated to the current Device.

public Driver? Driver { get; set; }

Property Value

Driver

Driver.

ExceptionEvents

Gets or sets the ExceptionEvent(s) that are currently active.

public IList<ExceptionEvent>? ExceptionEvents { get; set; }

Property Value

IList<ExceptionEvent>

List<T>.

Groups

Gets or sets the Group(s) that the Device currently belongs to.

public IList<Group>? Groups { get; set; }

Property Value

IList<Group>

List<T>.

IsDeviceCommunicating

Gets or sets a value indicating whether the Device is communicating.

public bool? IsDeviceCommunicating { get; set; }

Property Value

bool?

bool.

IsDriving

Gets or sets a value indicating whether the current Device state. If set true, is driving. Otherwise, it is stopped.

public bool? IsDriving { get; set; }

Property Value

bool?

bool.

IsHistoricLastDriver

Gets or sets a value indicating whether the Device has been assigned to "UnknownDriver" and the last TripDriver is returned.

public bool? IsHistoricLastDriver { get; set; }

Property Value

bool?

bool.

Remarks

[true] while the Device is assigned to "UnknownDriver" and no other trip had been made in the vehicle and/or the last TripDriver has not made a trip in another vehicle, otherwise [false].

Latitude

Gets or sets the current latitude of the Device.

public double? Latitude { get; set; }

Property Value

double?

double.

Longitude

Gets or sets the current longitude of the Device.

public double? Longitude { get; set; }

Property Value

double?

double.

Speed

Gets or sets the current vehicle speed.

public float? Speed { get; set; }

Property Value

float?

float.

Remarks

NaN represents an invalid speed.

Methods

Clone()

Creates a new object that is a copy of the current instance.

public override IEntity Clone()

Returns

IEntity

A new object that is a copy of this instance.

Exceptions

NotSupportedException

We should not clone DeviceStatusInfo.

PopulateDefaults()

Populate non-required empty (null) properties with default values.

public void PopulateDefaults()