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>>?)
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
idIdThe Id.
versionlong?The version.
namestringThe name.
commentstringThe comment.
vehicleIdentificationNumberstringThe device identification number.
engineVehicleIdentificationNumberstringThe device identification number reported by the engine.
pinDevicebool?Disable automatic device moving.
licensePlatestringThe license plate.
licenseStatestringState of the license.
productIdint?The product id.
timeToDownloadTimeSpan?The time to download.
ignoreDownloadsUntilDateTime?The ignore downloads until.
hardwareIdint?The hardware id.
serialNumberstringThe serial number of the device.
enableMustReprogrambool?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.
minorshort?The minor.
majorshort?The major.
workTimeWorkTimeA WorkTime object.
maxSecondsBetweenLogsfloat?The max number of seconds between receiving logs from the device. If exceeded, data is considered missing. Must be at least 200s.
groupsIList<Group>timeZoneIdstringtimeZoneId.deviceFlagsDeviceFlagsThe DevicePlan this device is on.
autoGroupsIList<Group>gpsOffDelayint?The gps off delay.
parameterVersionuint?The parameter version.
ensureHotStartbool?Enable hot start.
customParametersIReadOnlyCollection<CustomParameter>The custom parameters.
activeToDateTime?Date after which device becomes archived.
activeFromDateTime?Date after which device becomes active.
devicePlanBillingInfoIReadOnlyList<DevicePlanBillingInfo>The device plan billing information.
parameterVersionOnDeviceuint?The parameter version that is currently stored on the Device.
customPropertiesList<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
xDeviceXDeviceThe 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
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
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
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
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
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
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
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
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
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
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
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
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
PinDevice
Gets or sets a toggle that determines whether or not a device is under automatic vehicle management. Default [true].
public bool? PinDevice { get; set; }
Property Value
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
Methods
ByteToDegrees(short)
Converts bytes to degrees.
public static int ByteToDegrees(short value)
Parameters
valueshortThe value.
Returns
- int
The angle.
ByteToSpeed(short)
Converts byte to speed.
public static double ByteToSpeed(short value)
Parameters
valueshortThe 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
boolArraybool[]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
doubleArraydouble[]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
booleanArraybool[]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
shortArrayshort[]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
valueintThe 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
valuedoubleThe value.
Returns
- short
The byte encoded representation of the speed.