Class DataToComponentContent
- Namespace
- Geotab.Checkmate.ObjectModel
- Assembly
- Geotab.Checkmate.ObjectModel.dll
public abstract class DataToComponentContent : TextMessageContentType, IBinaryPayload
- Inheritance
-
DataToComponentContent
- Implements
- Derived
- Inherited Members
Constructors
DataToComponentContent(int, DeviceComponentType, int, bool, MessageContentType?)
Initializes a new instance of the DataToComponentContent class.Creates a new DataToComponentContent instance.
protected DataToComponentContent(int deviceIndex, DeviceComponentType componentType, int componentIndex, bool isAcknowledgeRequired, MessageContentType? messageContentType)
Parameters
deviceIndexintThe tethered device index. GO devices are always index 0.
componentTypeDeviceComponentTypeThe component type being addressed.
componentIndexintThe component type's index, for example, AUX 5 on an auxiliary expansion port.
isAcknowledgeRequiredbooltrue if the recipient device must ack the receipt of this message, false otherwise.
messageContentTypeMessageContentType?The type of message.
Properties
DeviceIndex
Gets or sets the device index. Analogous to Channel in IoxAddOn.
protected int DeviceIndex { get; set; }
Property Value
IsAcknowledgeRequired
Gets a value indicating whether the recipient device is required to respond with an acknowledgement.
public bool? IsAcknowledgeRequired { get; }
Property Value
Payload
Gets method to get raw binary. NOTE: The endianness of IDs and other numbers inside of the payload are reversed to keep the C# format.
public byte[]? Payload { get; }
Property Value
- byte[]
Method to get raw binary. NOTE: The endianness of IDs and other numbers inside of the payload are reversed to keep the C# format.
Methods
Clone()
Create a copy.
public abstract IBinaryPayload Clone()
Returns
- IBinaryPayload
The cloned instance.
Equals(object?)
public override bool Equals(object? obj)
Parameters
objobject
Returns
GetData()
Gets the data for the payload.
protected abstract byte[]? GetData()
Returns
- byte[]
The data.
GetHashCode()
public override int GetHashCode()
Returns
WrapData(byte[]?, int, int, int, bool, bool)
Wraps the provided data in the data to component 'envelope'. NOTE: The endianness of IDs and other numbers inside of the payload are reversed to keep the C# format.
public static byte[]? WrapData(byte[]? data, int channel, int componentType, int componentIndex, bool isAcknowledgeRequired, bool isExtended = false)
Parameters
databyte[]The data to be wrapped.
channelintThe channel to send the data to.
componentTypeintThe component type being addressed.
componentIndexintThe component type's index, for example, AUX 5 on an auxiliary expansion port.
isAcknowledgeRequiredbooltrue if the recipient device must ack the receipt of this message, false otherwise.
isExtendedboolFlag to indicate message requires two length bytes.
Returns
- byte[]
byte array