Table of Contents

Class DeviceHelper

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

This class contains helper methods related to encoding and parsing device serial numbers and hardware IDs.

public static class DeviceHelper
Inheritance
DeviceHelper
Inherited Members

Properties

CvaasDeviceTypes

Gets the CVAAS device types. (OEMShared)

public static IReadOnlyDictionary<int, string> CvaasDeviceTypes { get; }

Property Value

IReadOnlyDictionary<int, string>

The third-party device types.

Methods

EncodeSerialNumber(int, int)

Encodes the serial number.

public static string EncodeSerialNumber(int productId, int hardwareId)

Parameters

productId int

The product ID.

hardwareId int

The hardware ID.

Returns

string

The serial number.

GetEffectiveMaxNoLogDuration(float?)

Returns the device maximum time interval between log points incremented by 2 seconds.

public static TimeSpan GetEffectiveMaxNoLogDuration(float? maxNoLogSeconds)

Parameters

maxNoLogSeconds float?

The max no log seconds.

Returns

TimeSpan

The maximum time interval in milliseconds.

IsCvaasDeviceType(int)

Checks if a product ID is a supported CVAAS (OEMShared) device type.

public static bool IsCvaasDeviceType(int productId)

Parameters

productId int

The product ID.

Returns

bool

True if the product ID is a supported CVAAS device type, false otherwise.

ParseSerialNumber(string)

Parses the serial number.

public static int ParseSerialNumber(string serialNumber)

Parameters

serialNumber string

The serial number.

Returns

int

The hardware ID.

PrefixFromGoDeviceType(DeviceType)

Gets GO device prefix for a device type.

public static string PrefixFromGoDeviceType(DeviceType deviceType)

Parameters

deviceType DeviceType

The DeviceType.

Returns

string

A string.

TryParseSerialNumber(string)

Tries to parse the serial number.

public static int? TryParseSerialNumber(string serialNumber)

Parameters

serialNumber string

The serial number to parse.

Returns

int?

True if successful, false otherwise.