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
deviceIndex
intThe tethered device index. GO devices are always index 0.
componentType
DeviceComponentTypeThe component type being addressed.
componentIndex
intThe component type's index, for example, AUX 5 on an auxiliary expansion port.
isAcknowledgeRequired
booltrue if the recipient device must ack the receipt of this message, false otherwise.
messageContentType
MessageContentType?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
obj
object
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
data
byte[]The data to be wrapped.
channel
intThe channel to send the data to.
componentType
intThe component type being addressed.
componentIndex
intThe component type's index, for example, AUX 5 on an auxiliary expansion port.
isAcknowledgeRequired
booltrue if the recipient device must ack the receipt of this message, false otherwise.
isExtended
boolFlag to indicate message requires two length bytes.
Returns
- byte[]
byte array