Table of Contents

Class XDevice

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

The base device for all Geotab GO products. Additional properties can be seen in Device.

public class XDevice : Device, IEntity, IComparable, IIdentifiable, IVersion, IGroupLinked, ITimeZoneIdProvider, IDefaultable, ICustomizable<Device>, IMediaFiles, IInstanceSizeEstimate, IVehicleIdentificationNumber, ILicensable, IAutoGroupsProvider
Inheritance
XDevice
Implements
Derived
Inherited Members

Constructors

XDevice()

Initializes a new instance of the XDevice class.

protected XDevice()

XDevice(Id?, long?, string?, string?, string?, string?, bool?, string?, string?, int?, TimeSpan?, DateTime?, int?, string?, bool?, short?, short?, WorkTime?, float?, IList<Group>?, string?, DeviceFlags?, IList<Group>?, int?, uint?, bool?, IReadOnlyCollection<CustomParameter>?, DateTime?, DateTime?, IReadOnlyList<DevicePlanBillingInfo>?, uint?, List<PropertyValue<Device>>?)

Initializes a new instance of the XDevice class.Initializes a new instance of the XDevice class.

protected XDevice(Id? id, long? version, string? name, string? comment, string? vehicleIdentificationNumber, string? engineVehicleIdentificationNumber, bool? pinDevice, string? licensePlate, string? licenseState, int? productId, TimeSpan? timeToDownload, DateTime? ignoreDownloadsUntil, int? hardwareId, string? serialNumber, bool? enableMustReprogram, short? minor, short? major, WorkTime? workTime, float? maxSecondsBetweenLogs, IList<Group>? groups, string? timeZoneId, DeviceFlags? deviceFlags, IList<Group>? autoGroups, int? gpsOffDelay, uint? parameterVersion, bool? ensureHotStart, IReadOnlyCollection<CustomParameter>? customParameters, DateTime? activeTo, DateTime? activeFrom, IReadOnlyList<DevicePlanBillingInfo>? devicePlanBillingInfo, uint? parameterVersionOnDevice, List<PropertyValue<Device>>? customProperties)

Parameters

id Id

The Id.

version long?

The version.

name string

The name.

comment string

The comment.

vehicleIdentificationNumber string

The device identification number.

engineVehicleIdentificationNumber string

The device identification number reported by the engine.

pinDevice bool?

Disable automatic device moving.

licensePlate string

The license plate.

licenseState string

State of the license.

productId int?

The product id.

timeToDownload TimeSpan?

The time to download.

ignoreDownloadsUntil DateTime?

The ignore downloads until.

hardwareId int?

The hardware id.

serialNumber string

The serial number of the device.

enableMustReprogram bool?

If set to true, force the parameters to be updated on a device, the store will be updated with the parameter version of the go device +1.

minor short?

The minor.

major short?

The major.

workTime WorkTime

A WorkTime object.

maxSecondsBetweenLogs float?

The max number of seconds between receiving logs from the device. If exceeded, data is considered missing. Must be at least 200s.

groups IList<Group>

The collection of Group(s) this XDevice belongs to.

timeZoneId string

timeZoneId.

deviceFlags DeviceFlags

The DevicePlan this device is on.

autoGroups IList<Group>

The collection of auto Group(s) this Device belongs to.

gpsOffDelay int?

The gps off delay.

parameterVersion uint?

The parameter version.

ensureHotStart bool?

Enable hot start.

customParameters IReadOnlyCollection<CustomParameter>

The custom parameters.

activeTo DateTime?

Date after which device becomes archived.

activeFrom DateTime?

Date after which device becomes active.

devicePlanBillingInfo IReadOnlyList<DevicePlanBillingInfo>

The device plan billing information.

parameterVersionOnDevice uint?

The parameter version that is currently stored on the Device.

customProperties List<PropertyValue<Device>>

The custom properties and its associated PropertyValue<T>s for this device.

XDevice(XDevice)

Initializes a new instance of the XDevice class.

protected XDevice(XDevice xDevice)

Parameters

xDevice XDevice

The go device.

Properties

ActiveFrom

Gets or sets the date that the device is active from. Default [MinDate].

[ExcelColumnHeader(new ReportHeading[] { ReportHeading.DeviceActiveFrom })]
public override DateTime? ActiveFrom { get; set; }

Property Value

DateTime?

DateTime

Remarks

Old vehicles are designated as archived so their data is still available. A retired vehicle cannot be "un-retired".

ActiveTo

Gets or sets the date that the device is active to. Default [MaxDate].

[ExcelColumnHeader(new ReportHeading[] { ReportHeading.DeviceActiveTo })]
public override DateTime? ActiveTo { get; set; }

Property Value

DateTime?

DateTime

AutoGroups

Gets or sets the messaging status Group(s). Drivers with Garmin-equipped vehicles can update their working status by choosing one from a set of common statuses. This status update is shared with their team. For example, when drivers finish their work, they can set their statuses to 'Available'. Their dispatcher is notified of this and can begin to assign work based on both the location and availability of the drivers. Default [Empty].

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

Property Value

IList<Group>

IList<T>

CustomParameters

Gets or sets the set of CustomParameter(s) associated with this device. Custom parameters allow the activation of special features — limited to custom and beta firmware. Custom parameters are issued only when necessary. Default [Empty].

[DeviceParameter]
public List<CustomParameter>? CustomParameters { get; set; }

Property Value

List<CustomParameter>

The. List<T>

EnableMustReprogram

Gets or sets flag to force the parameters to be updated between the store and a go device, the store will be updated with the parameter version of the go device +1.

public bool? EnableMustReprogram { get; set; }

Property Value

bool?

bool

Remarks

This is to avoid the issue where: a device is added (store parameter v0, device parameter v0), parameter version has changed (store parameter v1, device parameter v1), device has been removed, device is re-added (store parameter v0, device parameter v1). Thus when the store is updated to v1 there would be no change.

EngineVehicleIdentificationNumber

Gets or sets the Vehicles Identity Number reported by the engine.

[ExcelColumnHeader(new ReportHeading[] { ReportHeading.DeviceEngineVIN })]
public string? EngineVehicleIdentificationNumber { get; set; }

Property Value

string

string

EnsureHotStart

Gets or sets a value indicating whether to wake up the GPS while the vehicle is parked: this will allow for a faster GPS latch when the vehicle begins its trip. Note: This will drain the vehicle's battery at a faster rate and should not be used with newer devices. Default [false].

[DeviceParameter]
public bool? EnsureHotStart { get; set; }

Property Value

bool?

bool

GpsOffDelay

Gets or sets the GPS off delay in minutes. When enabled this allows the device to keep the GPS on for a period after the vehicle has been turned off. Normally, the GPS turns off immediately. Keeping the GPS on can improve tracking on older devices when many stops are made. Default [0].

[DeviceParameter]
public int? GpsOffDelay { get; set; }

Property Value

int?

int

LicensePlate

Gets or sets the vehicle license plate details of the vehicle associated with the device. Maximum length [50] Default [""].

[ExcelColumnHeader(new ReportHeading[] { ReportHeading.DeviceLicensePlate })]
public string? LicensePlate { get; set; }

Property Value

string

string

LicenseState

Gets or sets the state or province of the vehicle associated with the device. Maximum length [50] Default [""].

[ExcelColumnHeader(new ReportHeading[] { ReportHeading.DeviceLicenseState })]
public string? LicenseState { get; set; }

Property Value

string

string

Major

Gets or sets the device major firmware version. Newer versions have more functionality. Live device firmware versions are managed automatically. Default [0].

[ExcelColumnHeader(new ReportHeading[] { ReportHeading.DeviceMajor })]
public short? Major { get; set; }

Property Value

short?

int

MinSecondsBetweenLogs

Gets the minimum allowable value for MaxSecondsBetweenLogs. For XDevices, this is the same as the default value of 200.0f.

[DeviceParameter]
protected override float MinSecondsBetweenLogs { get; }

Property Value

float

The minimum allowable value for MaxSecondsBetweenLogs. For XDevices, this is the same as the default value of 200.0f.

Minor

Gets or sets the device minor firmware version. Newer versions have more functionality. Live device firmware versions are managed automatically. Default [0].

[ExcelColumnHeader(new ReportHeading[] { ReportHeading.DeviceMinor })]
public short? Minor { get; set; }

Property Value

short?

int

ParameterVersion

Gets or sets the parameter version that is stored in MyGeotab. The parameter version should be increased by one when the parameters have been modified and need to be synced with the physical device. Default [2].

[DeviceParameter]
public uint? ParameterVersion { get; set; }

Property Value

uint?

int

ParameterVersionOnDevice

Gets or sets the parameter version that is on the device. Can be used to track the parameter version currently on the device by comparing to ParameterVersion. Default [0].

public uint? ParameterVersionOnDevice { get; set; }

Property Value

uint?

int

PinDevice

Gets or sets a toggle that determines whether or not a device is under automatic vehicle management. Default [true]. This value is the inverse of whether automatic vehicle management is enabled. A value of false means that automatic vehicle management is enabled in the UI.

public bool? PinDevice { get; set; }

Property Value

bool?

bool

VehicleIdentificationNumber

Gets or sets the Vehicle Identification Number (VIN) of the vehicle associated with the device. Maximum length [50] Default [""].

[ExcelColumnHeader(new ReportHeading[] { ReportHeading.DeviceVIN })]
public string? VehicleIdentificationNumber { get; set; }

Property Value

string

string

Methods

ByteToDegrees(short)

Converts bytes to degrees.

public static int ByteToDegrees(short value)

Parameters

value short

The value.

Returns

int

The angle.

ByteToSpeed(short)

Converts byte to speed.

public static double ByteToSpeed(short value)

Parameters

value short

The value.

Returns

double

The speed in km/h.

CheckAndPadAuxArray(bool[]?)

Checks the provided array is the correct length and pads it to the correct length if it is not.

public static bool[] CheckAndPadAuxArray(bool[]? boolArray)

Parameters

boolArray bool[]

The bool array.

Returns

bool[]

array of bool.

Exceptions

ArgumentOutOfRangeException

boolArray;boolArray.Length cannot be more then 8.

CheckAndPadAuxArray(double[]?)

Checks the provided array is the correct length and pads it to the correct length if it is not.

public static double[] CheckAndPadAuxArray(double[]? doubleArray)

Parameters

doubleArray double[]

The double array.

Returns

double[]

array of double.

Exceptions

ArgumentOutOfRangeException

doubleArray;doubleArray.Length cannot be more then 8.

CheckAndPadAuxIgnArray(bool[]?)

Checks the provided array is the correct length and pads it to the correct length if it is not.

public static bool[] CheckAndPadAuxIgnArray(bool[]? booleanArray)

Parameters

booleanArray bool[]

The boolean array.

Returns

bool[]

array of bool.

Exceptions

ArgumentOutOfRangeException

booleanArray;booleanArray.Length cannot be more then 4.

CheckAndPadChannelArray(short[]?)

Checks the provided array is the correct length and pads it to the correct length if it is not.

public static short[] CheckAndPadChannelArray(short[]? shortArray)

Parameters

shortArray short[]

The short array.

Returns

short[]

array of short.

Exceptions

ArgumentOutOfRangeException

shortArray;shortArray.Length cannot be more then 20.

DegreesToByte(int)

Converts Degrees to byte.

public static short DegreesToByte(int value)

Parameters

value int

The value.

Returns

short

The byte representation of the direction.

PopulateDefaults()

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

public override void PopulateDefaults()

SpeedToByte(double)

Converts speed to byte.

public static short SpeedToByte(double value)

Parameters

value double

The value.

Returns

short

The byte encoded representation of the speed.