Class CustomData
- Namespace
- Geotab.Checkmate.ObjectModel
- Assembly
- Geotab.Checkmate.ObjectModel.dll
Generic Custom Data from a GO unit that was sent through from a third-party device that is attached to the serial port.
public class CustomData : Entity, IEntity, IComparable, IIdentifiable, IDateTimeProvider, IDeviceProvider, IDefaultable
- Inheritance
-
CustomData
- Implements
- Inherited Members
Constructors
CustomData()
Initializes a new instance of the CustomData class.
public CustomData()
CustomData(Id?, Device?, DateTime?, byte[]?, int?, CustomDataSections)
Initializes a new instance of the CustomData class.
public CustomData(Id? id, Device? device, DateTime? dateTime, byte[]? data, int? dataLength, CustomDataSections loadedSections = CustomDataSections.None)
Parameters
id
IdThe Id.
device
DeviceThe vehicle.
dateTime
DateTime?The log DateTime.
data
byte[]The data.
dataLength
int?Length of the data.
loadedSections
CustomDataSectionsLoaded section flag (see CustomDataSections).
Fields
DataSectionLengthGo3
The maximum length of each section in a GO3.
public const int DataSectionLengthGo3 = 9
Field Value
Properties
Data
Gets or sets the custom data in base64 encoded string format. Default [empty].
public byte[]? Data { get; set; }
Property Value
DateTime
Gets or sets the date and time the log was created.
public DateTime? DateTime { get; set; }
Property Value
Device
Gets or sets the Device for which the data was recorded.
public Device? Device { get; set; }
Property Value
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.
GetDataLength()
The length of the field.
public int? GetDataLength()
Returns
GetInnerData()
Gets the inner data.
public byte[]? GetInnerData()
Returns
- byte[]
data.
GetIsDataComplete()
Whether or not all the custom data for this log has been read. Incomplete data should be discarded.
public bool GetIsDataComplete()
Returns
GetLoadedSections()
Whether the loaded sections. Used for serialization only.
public CustomDataSections? GetLoadedSections()
Returns
- CustomDataSections?
Byte array.
MergeData(CustomData, CustomDataSections, byte[], bool)
public static void MergeData(CustomData customData, CustomDataSections sections, byte[] data, bool isSingleSectionData)
Parameters
customData
CustomDataThe custom data.
sections
CustomDataSectionsThe sections.
data
byte[]The data.
isSingleSectionData
boolif set to true if a single section data.
PopulateDefaults()
Populate non-required empty (null) properties with default values.
public void PopulateDefaults()
SaveData(CustomDataSections, byte[], int)
Saves the data.
public void SaveData(CustomDataSections section, byte[] bytes, int start)
Parameters
section
CustomDataSectionsThe section.
bytes
byte[]The bytes.
start
intOffset where to start in bytes array.
SetDataLength(int)
The length of the field.
public void SetDataLength(int value)
Parameters
SetLoadedSections(CustomDataSections)
Whether the loaded sections. Used for serialization only.
public void SetLoadedSections(CustomDataSections value)
Parameters
value
CustomDataSectionsByte array