Table of Contents

Class Device

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

A Device represents the physical tracking device installed in the vehicle. A device and vehicle is typically synonymous since the GO tracking device is installed in a vehicle. In the case where there is no device; this is represented by "NoDeviceId". The device types that are supported are:

[ReportClass]
public class Device : NameEntityWithVersion, IEntity, IComparable, IIdentifiable, IVersion, IGroupLinked, ITimeZoneIdProvider, IDefaultable, ICustomizable<Device>, IMediaFiles, IInstanceSizeEstimate
Inheritance
Device
Implements
Derived
Inherited Members

Constructors

Device()

Initializes a new instance of the Device class.

public Device()

Device(Device)

Initializes a new instance of the Device class.

protected Device(Device device)

Parameters

device Device

The vehicle.

Device(Id?)

Initializes a new instance of the Device class.

public Device(Id? id)

Parameters

id Id

The Id.

Device(Id?, long?, string?, string?, int?, string?, int?, TimeSpan?, DateTime?, WorkTime?, float?, IList<Group>?, string?, DeviceFlags?, DateTime?, DateTime?, IReadOnlyList<DevicePlanBillingInfo>?, List<PropertyValue<Device>>?, IList<MediaFile>?)

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

public Device(Id? id, long? version, string? name, string? comment, int? hardwareId, string? serialNumber, int? productId, TimeSpan? timeToDownload, DateTime? ignoreDownloadsUntil, WorkTime? workTime, float? maxSecondsBetweenLogs, IList<Group>? groups, string? timeZoneId, DeviceFlags? deviceFlags, DateTime? activeTo, DateTime? activeFrom, IReadOnlyList<DevicePlanBillingInfo>? devicePlanBillingInfo, List<PropertyValue<Device>>? customProperties, IList<MediaFile>? mediaFiles = null)

Parameters

id Id

The unique identifier for each Device. In the case of a database, this would be the autonumber Id field.

version long?

The version.

name string

The Device name.

comment string

The comment.

hardwareId int?

The hardwareId. If the id is not known, set as null.

serialNumber string

The serial number of the device.

productId int?

The firmware product id.

timeToDownload TimeSpan?

The time to download, i.e. how frequently the device should produce new data and that data to be visible on the Checkmate end. This is used to check if the device is in good state.

ignoreDownloadsUntil DateTime?

The DateTime that tells the Checkmate at what moment should it start checking the device status and warn if there is no new data. Used when a new device is just installed or the vehicle undergoes a lengthy service.

workTime WorkTime

The WorkTime object.

maxSecondsBetweenLogs float?

Max number of seconds after which a device must produce a log when the ignition is on. When exceeded, data will be considered missing. Must be a positive value.

groups IList<Group>

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

timeZoneId string

The Timezone Id of the device.

deviceFlags DeviceFlags

The DeviceFlagsfor this device.

activeTo DateTime?

Date after which device becomes archived.

activeFrom DateTime?

Date after which device becomes active.

devicePlanBillingInfo IReadOnlyList<DevicePlanBillingInfo>

The device plan billing information.

customProperties List<PropertyValue<Device>>

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

mediaFiles IList<MediaFile>

The collection of MediaFile of MediaType Image for the pictures of this asset.

Fields

A1Prefix

false The default serial number prefix for aptiv A1 devices.

public const string A1Prefix = "A1"

Field Value

string

A1ProductId

false The default Product Id for aptiv A1 devices.

public const int A1ProductId = 255

Field Value

int

CustomDeviceProductId

false The default product Id for third-party devices.

public const int CustomDeviceProductId = 10000

Field Value

int

DefaultMaxNoLogSeconds

Gets the default value for MaxSecondsBetweenLogs.

protected const float DefaultMaxNoLogSeconds = 200

Field Value

float

Go10Prefix

false The default serial number prefix for Go10 devices.

public const string Go10Prefix = "X1"

Field Value

string

Go10ProductId

false The default Product Id for Go10 devices.

public const int Go10ProductId = 133

Field Value

int

Go2Prefix

false The default serial number prefix for Go2 devices.

public const string Go2Prefix = "GT"

Field Value

string

Go2ProductId

false The default product Id for Go2 devices.

public const int Go2ProductId = 1

Field Value

int

Go3Prefix

false The default serial number prefix for Go3 devices.

public const string Go3Prefix = "G3"

Field Value

string

Go3ProductId

false The default product Id for Go3 devices.

public const int Go3ProductId = 64

Field Value

int

Go4Prefix

false The default serial number prefix for Go4 devices (pre Go4v3).

public const string Go4Prefix = "G4"

Field Value

string

Go4ProductId

false The default product Id for Go4 devices (pre Go4v3).

public const int Go4ProductId = 65

Field Value

int

Go4V3Prefix

false The default serial number prefix for Go4v3 devices.

public const string Go4V3Prefix = "GV"

Field Value

string

Go4V3ProductId

false The default product Id for Go4v3 devices.

public const int Go4V3ProductId = 81

Field Value

int

Go5Prefix

false The default serial number prefix for Go5 devices.

public const string Go5Prefix = "G5"

Field Value

string

Go5ProductId

false The default product Id for Go5 devices.

public const int Go5ProductId = 90

Field Value

int

Go6Prefix

false The default serial number prefix for Go6 devices.

public const string Go6Prefix = "G6"

Field Value

string

Go6ProductId

false The default Product Id for Go6 devices.

public const int Go6ProductId = 101

Field Value

int

Go7Prefix

false The default serial number prefix for Go7 devices.

public const string Go7Prefix = "G7"

Field Value

string

Go7ProductId

false The default Product Id for Go7 devices.

public const int Go7ProductId = 105

Field Value

int

Go8Prefix

false The default serial number prefix for Go8 devices.

public const string Go8Prefix = "G8"

Field Value

string

Go8ProductId

false The default Product Id for Go8 devices.

public const int Go8ProductId = 114

Field Value

int

Go8ProductIdNoGps

false The default Product Id for Go8 devices without a gps.

public const int Go8ProductIdNoGps = 116

Field Value

int

Go9BPlusProductId

false The default Product Id for Go9B+ devices.

public const int Go9BPlusProductId = 127

Field Value

int

Go9BPrefix

false The default serial number prefix for Go9B devices.

public const string Go9BPrefix = "GA"

Field Value

string

Go9BProductId

false The default Product Id for Go9B devices.

public const int Go9BProductId = 124

Field Value

int

Go9BProductIdNoGps

false The default Product Id for Go9B devices without a gps.

public const int Go9BProductIdNoGps = 125

Field Value

int

Go9Prefix

false The default serial number prefix for Go9 devices.

public const string Go9Prefix = "G9"

Field Value

string

Go9ProductId

false The default Product Id for Go9 devices.

public const int Go9ProductId = 120

Field Value

int

Go9ProductIdNoGps

false The default Product Id for Go9 devices without a gps.

public const int Go9ProductIdNoGps = 121

Field Value

int

GoAnywherePrefix

false The default serial number prefix for Go Anywhere (EOS Battery B1) devices.

public const string GoAnywherePrefix = "B1"

Field Value

string

GoAnywhereProductId

false The default Product Id for Go Anywhere (EOS Battery B1) devices.

public const int GoAnywhereProductId = 131

Field Value

int

GoDrivePrefix

false The default serial number prefix for GoDrive mobile devices.

public const string GoDrivePrefix = "GD"

Field Value

string

GoDriveProductId

false The default product Id for GoDrive mobile devices.

public const int GoDriveProductId = 256

Field Value

int

GoMaxProductId

false The maximum Product Id for Go devices.

public const int GoMaxProductId = 254

Field Value

int

HistoricMax

false The maximum id value for devices that are archived.

public const int HistoricMax = 10000000

Field Value

int

HistoricMin

false The minimum id value for devices that are archived.

public const int HistoricMin = 1000000

Field Value

int

HistoricSerialNumber

The default serial number of historic devices.

public const string HistoricSerialNumber = "000-000-0000"

Field Value

string

S1Prefix

false The default serial number prefix for EOS Solar S1 devices.

public const string S1Prefix = "S1"

Field Value

string

S1ProductId

false The default Product Id for EOS Solar S1 devices.

public const int S1ProductId = 132

Field Value

int

U1Prefix

false The default serial number prefix for uReaderGPS U1 devices.

public const string U1Prefix = "U1"

Field Value

string

U1ProductId

false The default Product Id for uReaderGPS U1 devices.

public const int U1ProductId = 130

Field Value

int

UntrackedAssetHardwareId

false The default Hardware Id for untracked assets.

public const int UntrackedAssetHardwareId = -1

Field Value

int

UntrackedAssetProductId

false The default Product Id for untracked assets.

public const int UntrackedAssetProductId = -1

Field Value

int

Properties

ActiveFrom

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

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

Property Value

DateTime?

DateTime

ActiveTo

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

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

Property Value

DateTime?

DateTime

Comment

Gets or sets free text field where any user information can be stored and referenced for this entity.

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

Property Value

string

string

CustomFeatures

Gets or sets a list of DeviceCustomFeatures for this Device and their values.

[Obsolete("CustomFeatures property will be removed completely in a future version of the SDK.", false)]
public IDictionary<DeviceCustomFeature, bool?>? CustomFeatures { get; set; }

Property Value

IDictionary<DeviceCustomFeature, bool?>

A list of DeviceCustomFeatures for this Device and their values.

CustomProperties

Gets or sets the set of dynamic, user created, custom properties.

public List<PropertyValue<Device>>? CustomProperties { get; set; }

Property Value

List<PropertyValue<Device>>

List<T>

DeviceFlags

Gets or sets the device features which have been enabled whether the feature is in use (e.g. HOS, Iridium).

public DeviceFlags? DeviceFlags { get; set; }

Property Value

DeviceFlags

DevicePlan

Remarks

The DevicePlan property cannot be added/updated via the API.

DevicePlanBillingInfo

Gets or sets the DevicePlanBillingInfo that has been purchased for this device.

public IReadOnlyList<DevicePlanBillingInfo>? DevicePlanBillingInfo { get; set; }

Property Value

IReadOnlyList<DevicePlanBillingInfo>

IReadOnlyList<T>

DevicePlans

Gets or sets the Geotab DevicePlan that has been purchased for this device.

[Obsolete("Obsolete. Please use DevicePlanBillingInfo property instead.", false)]
public IReadOnlyList<DevicePlan>? DevicePlans { get; set; }

Property Value

IReadOnlyList<DevicePlan>

Array

DeviceReplacementInfo

Gets or sets the device replacement information.

public DeviceReplacementInfo? DeviceReplacementInfo { get; set; }

Property Value

DeviceReplacementInfo

DeviceReplacementInfo The device replacement information.

DeviceType

Gets specifies the GO or Custom DeviceType.

public DeviceType? DeviceType { get; }

Property Value

DeviceType?

DeviceType

Groups

Gets or sets the list of Group(s) the device belongs to.

[ExcelColumnHeader(new ReportHeading[] { ReportHeading.DeviceGroup, ReportHeading.DeviceParentGroup }, IsList = true, IsGroup = true)]
public virtual IList<Group>? Groups { get; set; }

Property Value

IList<Group>

IList<T>

HardwareId

Gets or sets the unique hardware identifier for the Device. This is a 4 byte unique number to identify devices in the system.

public int? HardwareId { get; set; }

Property Value

int?

int

Remarks

This property is no longer supported via the SDK as of v5.7.2001.

Id

Gets or sets the unique identifier for this entity. See Id.

[ExcelColumnHeader(new ReportHeading[] { ReportHeading.DeviceId })]
public override Id? Id { get; set; }

Property Value

Id

Id

IgnoreDownloadsUntil

Gets or sets The date that tells the system at what moment should it start checking the device status and warn if there is no new data. Used when a new device is just installed or the vehicle undergoes a lengthy service. Default [MinDate].

public DateTime? IgnoreDownloadsUntil { get; set; }

Property Value

DateTime?

DateTime

MaxSecondsBetweenLogs

Gets or sets the maximum allowed time between logs when the ignition is on in seconds. When the value is exceeded, data is considered to be missing. Default [3600] for GoAnywhere or S1 device otherwise [200].

public float? MaxSecondsBetweenLogs { get; set; }

Property Value

float?

float

Exceptions

ArgumentOutOfRangeException

Thrown if the value is negative.

MediaFiles

Gets or sets the list of MediaFile photos of this asset. Maximum length [1].

public virtual IList<MediaFile>? MediaFiles { get; set; }

Property Value

IList<MediaFile>

IList<T>

MinSecondsBetweenLogs

Gets the minimum allowable value for MaxSecondsBetweenLogs. Defaults to 0.0f.

protected virtual float MinSecondsBetweenLogs { get; }

Property Value

float

The minimum allowable value for MaxSecondsBetweenLogs. Defaults to 0.0f.

Name

Gets or sets the name of this entity which identifies it and is used when displaying this entity. Maximum length [50].

[ExcelColumnHeader(new ReportHeading[] { ReportHeading.DeviceName })]
public override string? Name { get; set; }

Property Value

string

string

ProductId

Gets or sets the product id. Each device is assigned a unique hardware product id.

[ExcelColumnHeader(new ReportHeading[] { ReportHeading.DeviceProductId })]
public virtual int? ProductId { get; set; }

Property Value

int?

int

RegisterDeviceResultLite

Gets or sets a value indicating the current registration status of the device to the Gateway.

public RegisterDeviceResultLite? RegisterDeviceResultLite { get; set; }

Property Value

RegisterDeviceResultLite

RegisterDeviceResultLite The registration status of the device to the Gateway.

SerialNumber

Gets or sets the Serial Number of the device. Maximum length [12].

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

Property Value

string

string

TimeToDownload

Gets or sets the expected time between downloads, i.e. how frequently the device is expected to produce new data. For passive devices this might range from 1 to a few days. For live devices this should be maximum 24h unless vehicles travel out of coverage frequently. This is used to check if the device is in good state.

public TimeSpan? TimeToDownload { get; set; }

Property Value

TimeSpan?

Nullable<T> where T is. float

TimeZoneId

Gets or sets the IANA Timezone Id of the device used to determine local work times. This is typically the "home location" of the device. Default ["America/New_York"].

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

Property Value

string

string

Remarks

Retrieve a list of valid timezone Id's by querying "GetTimeZones".

TmpTrailerId

Gets or sets the trailerId for the assets of type trailer.

[Obsolete("Obsolete. Please do not use this property.", false)]
public Id? TmpTrailerId { get; set; }

Property Value

Id

Id

WorkTime

Gets or sets the WorkTime rules to apply to the device. Default [WorkTimeStandardHours].

public WorkTime? WorkTime { get; set; }

Property Value

WorkTime

WorkTime

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.

DeviceTypeFromProductId(int)

`Maps the given productId to a. DeviceType

public static DeviceType DeviceTypeFromProductId(int productId)

Parameters

productId int

The device product Id.

Returns

DeviceType

The. DeviceType

FromDeviceType(DeviceType)

Gets the object type that matches a DeviceType

public static Type FromDeviceType(DeviceType deviceType)

Parameters

deviceType DeviceType

The deviceType.

Returns

Type

Type

FromProductId(int)

Get the correct Device object from the given product Id.

public static Device FromProductId(int productId)

Parameters

productId int

The product identifier.

Returns

Device

Device

FromSerialNumber(string)

Returns the correct type of device for the given serial number.

public static Device FromSerialNumber(string value)

Parameters

value string

The serial number for the device. For example, GV-001-000-0000.

Returns

Device

An instance of a Device object that corresponds to the serial number provided.

GetObjectTypeFromDeviceType(DeviceType?)

`Get the correct Device class the given product Id.

public static Type GetObjectTypeFromDeviceType(DeviceType? deviceType)

Parameters

deviceType DeviceType?

Type of the device.

Returns

Type

Type

Exceptions

ArgumentException

Unknown device type.

GetSize()

Gets the size estimate of this instance in bytes.

public virtual long GetSize()

Returns

long

Returns the size of the entity.

IsActive()

Returns [true] the device's active to date is 'max date'. (Active devices use 'max date' as active to).

public bool IsActive()

Returns

bool

bool

IsActive(DateTime?)

Returns [true] if the device's was active on this date.

public bool IsActive(DateTime? date)

Parameters

date DateTime?

The date.

Returns

bool

bool

IsActive(DateTime?, DateTime?)

Calculates if the device was active for a given date range.

public bool IsActive(DateTime? fromDate, DateTime? toDate)

Parameters

fromDate DateTime?

The from date.

toDate DateTime?

The to date.

Returns

bool

bool

IsHistoricHardwareId()

Checks if the device has a historic hardware id.

public bool IsHistoricHardwareId()

Returns

bool

true if it is a historic hardware id, false otherwise.

IsNoGpsDevice()

Determine if a device is NoGps Device by its productId.

public bool IsNoGpsDevice()

Returns

bool

bool

PopulateDefaults()

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

public virtual void PopulateDefaults()

PrefixFromDeviceType(int)

Returns the string prefix of the given product ID.

public static string PrefixFromDeviceType(int productId)

Parameters

productId int

Internal product Id for a serial number

Returns

string

A string serial number prefix.

ProductIdFromSerialNumber(string)

Returns the product id from its serial number;

public static int ProductIdFromSerialNumber(string value)

Parameters

value string

Internal product Id for a serial number

Returns

int

product id

ToString()

Returns a string that represents the current object.

public override string ToString()

Returns

string

A string that represents the current object.