Table of Contents

Class HarpMessage

Namespace
Bonsai.Harp
Assembly
Bonsai.Harp.dll

Represents a single message of the Harp protocol.

public class HarpMessage
Inheritance
HarpMessage
Inherited Members

Constructors

HarpMessage(bool, params byte[])

Initializes a new instance of the HarpMessage class from the full binary representation of the Harp message, and optionally updates the value of the checksum byte.

public HarpMessage(bool updateChecksum, params byte[] messageBytes)

Parameters

updateChecksum bool

Indicates whether to compute and update the checksum byte.

messageBytes byte[]

An array of bytes containing the full binary representation of the Harp message.

Exceptions

ArgumentNullException

messageBytes is null.

HarpMessage(params byte[])

Initializes a new instance of the HarpMessage class from the full binary representation of the Harp message.

public HarpMessage(params byte[] messageBytes)

Parameters

messageBytes byte[]

An array of bytes containing the full binary representation of the Harp message.

Exceptions

ArgumentNullException

messageBytes is null.

Properties

Address

Gets the address of the register to which the Harp message refers to.

public int Address { get; }

Property Value

int

Checksum

Gets the checksum byte used for error detection in the Harp protocol.

public byte Checksum { get; }

Property Value

byte

Error

Gets a value indicating whether this message is an error report from the device.

public bool Error { get; }

Property Value

bool

IsTimestamped

Specifies whether the message payload contains time information.

public bool IsTimestamped { get; }

Property Value

bool

IsValid

Specifies whether the message bytes represent a conformant Harp message, including payload checksum validation.

public bool IsValid { get; }

Property Value

bool

MessageBytes

Gets the full binary representation of the Harp message.

public byte[] MessageBytes { get; }

Property Value

byte[]

MessageType

Gets the type of the Harp message.

public MessageType MessageType { get; }

Property Value

MessageType

PayloadType

Gets the type of data available in the message payload.

public PayloadType PayloadType { get; }

Property Value

PayloadType

Port

If the device is a hub of Harp messages, specifies the origin or destination of the Harp message. Otherwise, if the message refers to the device itself, returns the default value 0xFF.

public int Port { get; }

Property Value

int

Methods

CopyTo<TArray>(TArray[])

Copies the message payload into an array of non-pointer value types. The size in bytes of the array should be equal to or higher than the total size of the payload.

public void CopyTo<TArray>(TArray[] value) where TArray : unmanaged

Parameters

value TArray[]

The array which will contain the copy of the message payload.

Type Parameters

TArray

The type of the non-pointer values in the array.

Exceptions

ArgumentNullException

value is null.

ArgumentException

The number of bytes in value is less than the total size of the payload.

CopyTo<TArray>(TArray[], out double)

Copies the message payload into an array of non-pointer value types and gets the message timestamp. The size in bytes of the array should be equal to or higher than the total size of the payload.

public void CopyTo<TArray>(TArray[] value, out double timestamp) where TArray : unmanaged

Parameters

value TArray[]

The array which will contain the copy of the message payload.

timestamp double

The timestamp of the message payload, in seconds.

Type Parameters

TArray

The type of the non-pointer values in the array.

Exceptions

ArgumentNullException

value is null.

ArgumentException

The number of bytes in value is less than the total size of the payload.

InvalidOperationException

The message does not have a timestamped payload.

CopyTo<TArray>(TArray[], int)

Copies the message payload into an array of non-pointer value types, starting at the specified index. The size in bytes of the array should be equal to or higher than the total size of the payload.

public void CopyTo<TArray>(TArray[] value, int index) where TArray : unmanaged

Parameters

value TArray[]

The array which will contain the copy of the message payload.

index int

The zero-based offset into value.

Type Parameters

TArray

The type of the non-pointer values in the array.

Exceptions

ArgumentNullException

value is null.

ArgumentException

The number of bytes in value is less than index times size of each array element plus the total size of the payload.

CopyTo<TArray>(TArray[], int, out double)

Copies the message payload into an array of non-pointer value types, starting at the specified index, and gets the message timestamp. The size in bytes of the array should be equal to or higher than the total size of the payload.

public void CopyTo<TArray>(TArray[] value, int index, out double timestamp) where TArray : unmanaged

Parameters

value TArray[]

The array which will contain the copy of the message payload.

index int

The zero-based offset into value.

timestamp double

The timestamp of the message payload, in seconds.

Type Parameters

TArray

The type of the non-pointer values in the array.

Exceptions

ArgumentNullException

value is null.

ArgumentException

The number of bytes in value is less than index times size of each array element plus the total size of the payload.

InvalidOperationException

The message does not have a timestamped payload.

FromByte(int, MessageType, byte)

Returns a HarpMessage with the specified address, message type, and a single value 8-bit unsigned integer payload.

public static HarpMessage FromByte(int address, MessageType messageType, byte value)

Parameters

address int

The address of the register to which the Harp message refers to.

messageType MessageType

The type of the Harp message.

value byte

The value to be stored in the payload.

Returns

HarpMessage

A valid HarpMessage instance with the specified address, message type and payload.

FromByte(int, MessageType, params byte[])

Returns a HarpMessage with the specified address, message type, and an array payload of 8-bit unsigned integers.

public static HarpMessage FromByte(int address, MessageType messageType, params byte[] values)

Parameters

address int

The address of the register to which the Harp message refers to.

messageType MessageType

The type of the Harp message.

values byte[]

The values to be stored in the payload.

Returns

HarpMessage

A valid HarpMessage instance with the specified address, message type and payload.

FromByte(int, double, MessageType, byte)

Returns a HarpMessage with the specified address, message type, timestamp, and a single value 8-bit unsigned integer payload.

public static HarpMessage FromByte(int address, double timestamp, MessageType messageType, byte value)

Parameters

address int

The address of the register to which the Harp message refers to.

timestamp double

The timestamp of the message payload, in seconds.

messageType MessageType

The type of the Harp message.

value byte

The value to be stored in the payload.

Returns

HarpMessage

A valid HarpMessage instance with the specified address, message type, timestamp, and payload.

FromByte(int, double, MessageType, params byte[])

Returns a HarpMessage with the specified address, message type, timestamp, and an array payload of 8-bit unsigned integers.

public static HarpMessage FromByte(int address, double timestamp, MessageType messageType, params byte[] values)

Parameters

address int

The address of the register to which the Harp message refers to.

timestamp double

The timestamp of the message payload, in seconds.

messageType MessageType

The type of the Harp message.

values byte[]

The values to be stored in the payload.

Returns

HarpMessage

A valid HarpMessage instance with the specified address, message type, timestamp, and payload.

FromByte(int, int, MessageType, byte)

Returns a HarpMessage with the specified address, message type, port, and a single value 8-bit unsigned integer payload.

public static HarpMessage FromByte(int address, int port, MessageType messageType, byte value)

Parameters

address int

The address of the register to which the Harp message refers to.

port int

The origin or destination of the Harp message, for routing purposes.

messageType MessageType

The type of the Harp message.

value byte

The value to be stored in the payload.

Returns

HarpMessage

A valid HarpMessage instance with the specified address, message type, port, and payload.

FromByte(int, int, MessageType, params byte[])

Returns a HarpMessage with the specified address, message type, port, and an array payload of 8-bit unsigned integers.

public static HarpMessage FromByte(int address, int port, MessageType messageType, params byte[] values)

Parameters

address int

The address of the register to which the Harp message refers to.

port int

The origin or destination of the Harp message, for routing purposes.

messageType MessageType

The type of the Harp message.

values byte[]

The values to be stored in the payload.

Returns

HarpMessage

A valid HarpMessage instance with the specified address, message type, port, and payload.

FromByte(int, int, double, MessageType, byte)

Returns a HarpMessage with the specified address, message type, port, timestamp, and a single value 8-bit unsigned integer payload.

public static HarpMessage FromByte(int address, int port, double timestamp, MessageType messageType, byte value)

Parameters

address int

The address of the register to which the Harp message refers to.

port int

The origin or destination of the Harp message, for routing purposes.

timestamp double

The timestamp of the message payload, in seconds.

messageType MessageType

The type of the Harp message.

value byte

The value to be stored in the payload.

Returns

HarpMessage

A valid HarpMessage instance with the specified address, message type, port, timestamp, and payload.

FromByte(int, int, double, MessageType, params byte[])

Returns a HarpMessage with the specified address, message type, port, timestamp, and an array payload of 8-bit unsigned integers.

public static HarpMessage FromByte(int address, int port, double timestamp, MessageType messageType, params byte[] values)

Parameters

address int

The address of the register to which the Harp message refers to.

port int

The origin or destination of the Harp message, for routing purposes.

timestamp double

The timestamp of the message payload, in seconds.

messageType MessageType

The type of the Harp message.

values byte[]

The values to be stored in the payload.

Returns

HarpMessage

A valid HarpMessage instance with the specified address, message type, port, timestamp, and payload.

FromInt16(int, MessageType, short)

Returns a HarpMessage with the specified address, message type, and a single value 16-bit signed integer payload.

public static HarpMessage FromInt16(int address, MessageType messageType, short value)

Parameters

address int

The address of the register to which the Harp message refers to.

messageType MessageType

The type of the Harp message.

value short

The value to be stored in the payload.

Returns

HarpMessage

A valid HarpMessage instance with the specified address, message type and payload.

FromInt16(int, MessageType, params short[])

Returns a HarpMessage with the specified address, message type, and an array payload of 16-bit signed integers.

public static HarpMessage FromInt16(int address, MessageType messageType, params short[] values)

Parameters

address int

The address of the register to which the Harp message refers to.

messageType MessageType

The type of the Harp message.

values short[]

The values to be stored in the payload.

Returns

HarpMessage

A valid HarpMessage instance with the specified address, message type and payload.

FromInt16(int, double, MessageType, short)

Returns a HarpMessage with the specified address, message type, timestamp, and a single value 16-bit signed integer payload.

public static HarpMessage FromInt16(int address, double timestamp, MessageType messageType, short value)

Parameters

address int

The address of the register to which the Harp message refers to.

timestamp double

The timestamp of the message payload, in seconds.

messageType MessageType

The type of the Harp message.

value short

The value to be stored in the payload.

Returns

HarpMessage

A valid HarpMessage instance with the specified address, message type, timestamp, and payload.

FromInt16(int, double, MessageType, params short[])

Returns a HarpMessage with the specified address, message type, timestamp, and an array payload of 16-bit signed integers.

public static HarpMessage FromInt16(int address, double timestamp, MessageType messageType, params short[] values)

Parameters

address int

The address of the register to which the Harp message refers to.

timestamp double

The timestamp of the message payload, in seconds.

messageType MessageType

The type of the Harp message.

values short[]

The values to be stored in the payload.

Returns

HarpMessage

A valid HarpMessage instance with the specified address, message type, timestamp, and payload.

FromInt16(int, int, MessageType, short)

Returns a HarpMessage with the specified address, message type, port, and a single value 16-bit signed integer payload.

public static HarpMessage FromInt16(int address, int port, MessageType messageType, short value)

Parameters

address int

The address of the register to which the Harp message refers to.

port int

The origin or destination of the Harp message, for routing purposes.

messageType MessageType

The type of the Harp message.

value short

The value to be stored in the payload.

Returns

HarpMessage

A valid HarpMessage instance with the specified address, message type, port, and payload.

FromInt16(int, int, MessageType, params short[])

Returns a HarpMessage with the specified address, message type, port, and an array payload of 16-bit signed integers.

public static HarpMessage FromInt16(int address, int port, MessageType messageType, params short[] values)

Parameters

address int

The address of the register to which the Harp message refers to.

port int

The origin or destination of the Harp message, for routing purposes.

messageType MessageType

The type of the Harp message.

values short[]

The values to be stored in the payload.

Returns

HarpMessage

A valid HarpMessage instance with the specified address, message type, port, and payload.

FromInt16(int, int, double, MessageType, short)

Returns a HarpMessage with the specified address, message type, port, timestamp, and a single value 16-bit signed integer payload.

public static HarpMessage FromInt16(int address, int port, double timestamp, MessageType messageType, short value)

Parameters

address int

The address of the register to which the Harp message refers to.

port int

The origin or destination of the Harp message, for routing purposes.

timestamp double

The timestamp of the message payload, in seconds.

messageType MessageType

The type of the Harp message.

value short

The value to be stored in the payload.

Returns

HarpMessage

A valid HarpMessage instance with the specified address, message type, port, timestamp, and payload.

FromInt16(int, int, double, MessageType, params short[])

Returns a HarpMessage with the specified address, message type, port, timestamp, and an array payload of 16-bit signed integers.

public static HarpMessage FromInt16(int address, int port, double timestamp, MessageType messageType, params short[] values)

Parameters

address int

The address of the register to which the Harp message refers to.

port int

The origin or destination of the Harp message, for routing purposes.

timestamp double

The timestamp of the message payload, in seconds.

messageType MessageType

The type of the Harp message.

values short[]

The values to be stored in the payload.

Returns

HarpMessage

A valid HarpMessage instance with the specified address, message type, port, timestamp, and payload.

FromInt32(int, MessageType, int)

Returns a HarpMessage with the specified address, message type, and a single value 32-bit signed integer payload.

public static HarpMessage FromInt32(int address, MessageType messageType, int value)

Parameters

address int

The address of the register to which the Harp message refers to.

messageType MessageType

The type of the Harp message.

value int

The value to be stored in the payload.

Returns

HarpMessage

A valid HarpMessage instance with the specified address, message type and payload.

FromInt32(int, MessageType, params int[])

Returns a HarpMessage with the specified address, message type, and an array payload of 32-bit signed integers.

public static HarpMessage FromInt32(int address, MessageType messageType, params int[] values)

Parameters

address int

The address of the register to which the Harp message refers to.

messageType MessageType

The type of the Harp message.

values int[]

The values to be stored in the payload.

Returns

HarpMessage

A valid HarpMessage instance with the specified address, message type and payload.

FromInt32(int, double, MessageType, int)

Returns a HarpMessage with the specified address, message type, timestamp, and a single value 32-bit signed integer payload.

public static HarpMessage FromInt32(int address, double timestamp, MessageType messageType, int value)

Parameters

address int

The address of the register to which the Harp message refers to.

timestamp double

The timestamp of the message payload, in seconds.

messageType MessageType

The type of the Harp message.

value int

The value to be stored in the payload.

Returns

HarpMessage

A valid HarpMessage instance with the specified address, message type, timestamp, and payload.

FromInt32(int, double, MessageType, params int[])

Returns a HarpMessage with the specified address, message type, timestamp, and an array payload of 32-bit signed integers.

public static HarpMessage FromInt32(int address, double timestamp, MessageType messageType, params int[] values)

Parameters

address int

The address of the register to which the Harp message refers to.

timestamp double

The timestamp of the message payload, in seconds.

messageType MessageType

The type of the Harp message.

values int[]

The values to be stored in the payload.

Returns

HarpMessage

A valid HarpMessage instance with the specified address, message type, timestamp, and payload.

FromInt32(int, int, MessageType, int)

Returns a HarpMessage with the specified address, message type, port, and a single value 32-bit signed integer payload.

public static HarpMessage FromInt32(int address, int port, MessageType messageType, int value)

Parameters

address int

The address of the register to which the Harp message refers to.

port int

The origin or destination of the Harp message, for routing purposes.

messageType MessageType

The type of the Harp message.

value int

The value to be stored in the payload.

Returns

HarpMessage

A valid HarpMessage instance with the specified address, message type, port, and payload.

FromInt32(int, int, MessageType, params int[])

Returns a HarpMessage with the specified address, message type, port, and an array payload of 32-bit signed integers.

public static HarpMessage FromInt32(int address, int port, MessageType messageType, params int[] values)

Parameters

address int

The address of the register to which the Harp message refers to.

port int

The origin or destination of the Harp message, for routing purposes.

messageType MessageType

The type of the Harp message.

values int[]

The values to be stored in the payload.

Returns

HarpMessage

A valid HarpMessage instance with the specified address, message type, port, and payload.

FromInt32(int, int, double, MessageType, int)

Returns a HarpMessage with the specified address, message type, port, timestamp, and a single value 32-bit signed integer payload.

public static HarpMessage FromInt32(int address, int port, double timestamp, MessageType messageType, int value)

Parameters

address int

The address of the register to which the Harp message refers to.

port int

The origin or destination of the Harp message, for routing purposes.

timestamp double

The timestamp of the message payload, in seconds.

messageType MessageType

The type of the Harp message.

value int

The value to be stored in the payload.

Returns

HarpMessage

A valid HarpMessage instance with the specified address, message type, port, timestamp, and payload.

FromInt32(int, int, double, MessageType, params int[])

Returns a HarpMessage with the specified address, message type, port, timestamp, and an array payload of 32-bit signed integers.

public static HarpMessage FromInt32(int address, int port, double timestamp, MessageType messageType, params int[] values)

Parameters

address int

The address of the register to which the Harp message refers to.

port int

The origin or destination of the Harp message, for routing purposes.

timestamp double

The timestamp of the message payload, in seconds.

messageType MessageType

The type of the Harp message.

values int[]

The values to be stored in the payload.

Returns

HarpMessage

A valid HarpMessage instance with the specified address, message type, port, timestamp, and payload.

FromInt64(int, MessageType, long)

Returns a HarpMessage with the specified address, message type, and a single value 64-bit signed integer payload.

public static HarpMessage FromInt64(int address, MessageType messageType, long value)

Parameters

address int

The address of the register to which the Harp message refers to.

messageType MessageType

The type of the Harp message.

value long

The value to be stored in the payload.

Returns

HarpMessage

A valid HarpMessage instance with the specified address, message type and payload.

FromInt64(int, MessageType, params long[])

Returns a HarpMessage with the specified address, message type, and an array payload of 64-bit signed integers.

public static HarpMessage FromInt64(int address, MessageType messageType, params long[] values)

Parameters

address int

The address of the register to which the Harp message refers to.

messageType MessageType

The type of the Harp message.

values long[]

The values to be stored in the payload.

Returns

HarpMessage

A valid HarpMessage instance with the specified address, message type and payload.

FromInt64(int, double, MessageType, long)

Returns a HarpMessage with the specified address, message type, timestamp, and a single value 64-bit signed integer payload.

public static HarpMessage FromInt64(int address, double timestamp, MessageType messageType, long value)

Parameters

address int

The address of the register to which the Harp message refers to.

timestamp double

The timestamp of the message payload, in seconds.

messageType MessageType

The type of the Harp message.

value long

The value to be stored in the payload.

Returns

HarpMessage

A valid HarpMessage instance with the specified address, message type, timestamp, and payload.

FromInt64(int, double, MessageType, params long[])

Returns a HarpMessage with the specified address, message type, timestamp, and an array payload of 64-bit signed integers.

public static HarpMessage FromInt64(int address, double timestamp, MessageType messageType, params long[] values)

Parameters

address int

The address of the register to which the Harp message refers to.

timestamp double

The timestamp of the message payload, in seconds.

messageType MessageType

The type of the Harp message.

values long[]

The values to be stored in the payload.

Returns

HarpMessage

A valid HarpMessage instance with the specified address, message type, timestamp, and payload.

FromInt64(int, int, MessageType, long)

Returns a HarpMessage with the specified address, message type, port, and a single value 64-bit signed integer payload.

public static HarpMessage FromInt64(int address, int port, MessageType messageType, long value)

Parameters

address int

The address of the register to which the Harp message refers to.

port int

The origin or destination of the Harp message, for routing purposes.

messageType MessageType

The type of the Harp message.

value long

The value to be stored in the payload.

Returns

HarpMessage

A valid HarpMessage instance with the specified address, message type, port, and payload.

FromInt64(int, int, MessageType, params long[])

Returns a HarpMessage with the specified address, message type, port, and an array payload of 64-bit signed integers.

public static HarpMessage FromInt64(int address, int port, MessageType messageType, params long[] values)

Parameters

address int

The address of the register to which the Harp message refers to.

port int

The origin or destination of the Harp message, for routing purposes.

messageType MessageType

The type of the Harp message.

values long[]

The values to be stored in the payload.

Returns

HarpMessage

A valid HarpMessage instance with the specified address, message type, port, and payload.

FromInt64(int, int, double, MessageType, long)

Returns a HarpMessage with the specified address, message type, port, timestamp, and a single value 64-bit signed integer payload.

public static HarpMessage FromInt64(int address, int port, double timestamp, MessageType messageType, long value)

Parameters

address int

The address of the register to which the Harp message refers to.

port int

The origin or destination of the Harp message, for routing purposes.

timestamp double

The timestamp of the message payload, in seconds.

messageType MessageType

The type of the Harp message.

value long

The value to be stored in the payload.

Returns

HarpMessage

A valid HarpMessage instance with the specified address, message type, port, timestamp, and payload.

FromInt64(int, int, double, MessageType, params long[])

Returns a HarpMessage with the specified address, message type, port, timestamp, and an array payload of 64-bit signed integers.

public static HarpMessage FromInt64(int address, int port, double timestamp, MessageType messageType, params long[] values)

Parameters

address int

The address of the register to which the Harp message refers to.

port int

The origin or destination of the Harp message, for routing purposes.

timestamp double

The timestamp of the message payload, in seconds.

messageType MessageType

The type of the Harp message.

values long[]

The values to be stored in the payload.

Returns

HarpMessage

A valid HarpMessage instance with the specified address, message type, port, timestamp, and payload.

FromPayload(int, MessageType, PayloadType, ArraySegment<byte>)

Returns a HarpMessage with the specified address, message type, and payload data stored in the specified array segment.

public static HarpMessage FromPayload(int address, MessageType messageType, PayloadType payloadType, ArraySegment<byte> payload)

Parameters

address int

The address of the register to which the Harp message refers to.

messageType MessageType

The type of the Harp message.

payloadType PayloadType

The type of data available in the message payload.

payload ArraySegment<byte>

An array segment containing the raw binary representation of the payload data.

Returns

HarpMessage

A valid HarpMessage instance with the specified address, message type, and payload.

FromPayload(int, MessageType, PayloadType, params byte[])

Returns a HarpMessage with the specified address, message type, and payload.

public static HarpMessage FromPayload(int address, MessageType messageType, PayloadType payloadType, params byte[] payload)

Parameters

address int

The address of the register to which the Harp message refers to.

messageType MessageType

The type of the Harp message.

payloadType PayloadType

The type of data available in the message payload.

payload byte[]

The raw binary representation of the payload data.

Returns

HarpMessage

A valid HarpMessage instance with the specified address, message type and payload.

FromPayload(int, double, MessageType, PayloadType, ArraySegment<byte>)

Returns a HarpMessage with the specified address, message type, timestamp, and payload data stored in the specified array segment.

public static HarpMessage FromPayload(int address, double timestamp, MessageType messageType, PayloadType payloadType, ArraySegment<byte> payload)

Parameters

address int

The address of the register to which the Harp message refers to.

timestamp double

The timestamp of the message payload, in seconds.

messageType MessageType

The type of the Harp message.

payloadType PayloadType

The type of data available in the message payload.

payload ArraySegment<byte>

An array segment containing the raw binary representation of the payload data.

Returns

HarpMessage

A valid HarpMessage instance with the specified address, message type, timestamp, and payload.

FromPayload(int, double, MessageType, PayloadType, params byte[])

Returns a HarpMessage with the specified address, message type, timestamp, and payload.

public static HarpMessage FromPayload(int address, double timestamp, MessageType messageType, PayloadType payloadType, params byte[] payload)

Parameters

address int

The address of the register to which the Harp message refers to.

timestamp double

The timestamp of the message payload, in seconds.

messageType MessageType

The type of the Harp message.

payloadType PayloadType

The type of data available in the message payload.

payload byte[]

The raw binary representation of the payload data.

Returns

HarpMessage

A valid HarpMessage instance with the specified address, message type, timestamp, and payload.

FromPayload(int, int, MessageType, PayloadType, ArraySegment<byte>)

Returns a HarpMessage with the specified address, message type, port, and payload data stored in the specified array segment.

public static HarpMessage FromPayload(int address, int port, MessageType messageType, PayloadType payloadType, ArraySegment<byte> payload)

Parameters

address int

The address of the register to which the Harp message refers to.

port int

The origin or destination of the Harp message, for routing purposes.

messageType MessageType

The type of the Harp message.

payloadType PayloadType

The type of data available in the message payload.

payload ArraySegment<byte>

An array segment containing the raw binary representation of the payload data.

Returns

HarpMessage

A valid HarpMessage instance with the specified address, message type, port, and payload.

FromPayload(int, int, MessageType, PayloadType, params byte[])

Returns a HarpMessage with the specified address, message type, port, and payload.

public static HarpMessage FromPayload(int address, int port, MessageType messageType, PayloadType payloadType, params byte[] payload)

Parameters

address int

The address of the register to which the Harp message refers to.

port int

The origin or destination of the Harp message, for routing purposes.

messageType MessageType

The type of the Harp message.

payloadType PayloadType

The type of data available in the message payload.

payload byte[]

The raw binary representation of the payload data.

Returns

HarpMessage

A valid HarpMessage instance with the specified address, message type, port, and payload.

FromPayload(int, int, double, MessageType, PayloadType, ArraySegment<byte>)

Returns a HarpMessage with the specified address, message type, port, timestamp, and payload data stored in the specified array segment.

public static HarpMessage FromPayload(int address, int port, double timestamp, MessageType messageType, PayloadType payloadType, ArraySegment<byte> payload)

Parameters

address int

The address of the register to which the Harp message refers to.

port int

The origin or destination of the Harp message, for routing purposes.

timestamp double

The timestamp of the message payload, in seconds.

messageType MessageType

The type of the Harp message.

payloadType PayloadType

The type of data available in the message payload.

payload ArraySegment<byte>

An array segment containing the raw binary representation of the payload data.

Returns

HarpMessage

A valid HarpMessage instance with the specified address, message type, port, timestamp, and payload.

FromPayload(int, int, double, MessageType, PayloadType, params byte[])

Returns a HarpMessage with the specified address, message type, port, timestamp, and payload.

public static HarpMessage FromPayload(int address, int port, double timestamp, MessageType messageType, PayloadType payloadType, params byte[] payload)

Parameters

address int

The address of the register to which the Harp message refers to.

port int

The origin or destination of the Harp message, for routing purposes.

timestamp double

The timestamp of the message payload, in seconds.

messageType MessageType

The type of the Harp message.

payloadType PayloadType

The type of data available in the message payload.

payload byte[]

The raw binary representation of the payload data.

Returns

HarpMessage

A valid HarpMessage instance with the specified address, message type, port, timestamp, and payload.

FromSByte(int, MessageType, sbyte)

Returns a HarpMessage with the specified address, message type, and a single value 8-bit signed integer payload.

public static HarpMessage FromSByte(int address, MessageType messageType, sbyte value)

Parameters

address int

The address of the register to which the Harp message refers to.

messageType MessageType

The type of the Harp message.

value sbyte

The value to be stored in the payload.

Returns

HarpMessage

A valid HarpMessage instance with the specified address, message type and payload.

FromSByte(int, MessageType, params sbyte[])

Returns a HarpMessage with the specified address, message type, and an array payload of 8-bit signed integers.

public static HarpMessage FromSByte(int address, MessageType messageType, params sbyte[] values)

Parameters

address int

The address of the register to which the Harp message refers to.

messageType MessageType

The type of the Harp message.

values sbyte[]

The values to be stored in the payload.

Returns

HarpMessage

A valid HarpMessage instance with the specified address, message type and payload.

FromSByte(int, double, MessageType, sbyte)

Returns a HarpMessage with the specified address, message type, timestamp, and a single value 8-bit signed integer payload.

public static HarpMessage FromSByte(int address, double timestamp, MessageType messageType, sbyte value)

Parameters

address int

The address of the register to which the Harp message refers to.

timestamp double

The timestamp of the message payload, in seconds.

messageType MessageType

The type of the Harp message.

value sbyte

The value to be stored in the payload.

Returns

HarpMessage

A valid HarpMessage instance with the specified address, message type, timestamp, and payload.

FromSByte(int, double, MessageType, params sbyte[])

Returns a HarpMessage with the specified address, message type, timestamp, and an array payload of 8-bit signed integers.

public static HarpMessage FromSByte(int address, double timestamp, MessageType messageType, params sbyte[] values)

Parameters

address int

The address of the register to which the Harp message refers to.

timestamp double

The timestamp of the message payload, in seconds.

messageType MessageType

The type of the Harp message.

values sbyte[]

The values to be stored in the payload.

Returns

HarpMessage

A valid HarpMessage instance with the specified address, message type, timestamp, and payload.

FromSByte(int, int, MessageType, sbyte)

Returns a HarpMessage with the specified address, message type, port, and a single value 8-bit signed integer payload.

public static HarpMessage FromSByte(int address, int port, MessageType messageType, sbyte value)

Parameters

address int

The address of the register to which the Harp message refers to.

port int

The origin or destination of the Harp message, for routing purposes.

messageType MessageType

The type of the Harp message.

value sbyte

The value to be stored in the payload.

Returns

HarpMessage

A valid HarpMessage instance with the specified address, message type, port, and payload.

FromSByte(int, int, MessageType, params sbyte[])

Returns a HarpMessage with the specified address, message type, port, and an array payload of 8-bit signed integers.

public static HarpMessage FromSByte(int address, int port, MessageType messageType, params sbyte[] values)

Parameters

address int

The address of the register to which the Harp message refers to.

port int

The origin or destination of the Harp message, for routing purposes.

messageType MessageType

The type of the Harp message.

values sbyte[]

The values to be stored in the payload.

Returns

HarpMessage

A valid HarpMessage instance with the specified address, message type, port, and payload.

FromSByte(int, int, double, MessageType, sbyte)

Returns a HarpMessage with the specified address, message type, port, timestamp, and a single value 8-bit signed integer payload.

public static HarpMessage FromSByte(int address, int port, double timestamp, MessageType messageType, sbyte value)

Parameters

address int

The address of the register to which the Harp message refers to.

port int

The origin or destination of the Harp message, for routing purposes.

timestamp double

The timestamp of the message payload, in seconds.

messageType MessageType

The type of the Harp message.

value sbyte

The value to be stored in the payload.

Returns

HarpMessage

A valid HarpMessage instance with the specified address, message type, port, timestamp, and payload.

FromSByte(int, int, double, MessageType, params sbyte[])

Returns a HarpMessage with the specified address, message type, port, timestamp, and an array payload of 8-bit signed integers.

public static HarpMessage FromSByte(int address, int port, double timestamp, MessageType messageType, params sbyte[] values)

Parameters

address int

The address of the register to which the Harp message refers to.

port int

The origin or destination of the Harp message, for routing purposes.

timestamp double

The timestamp of the message payload, in seconds.

messageType MessageType

The type of the Harp message.

values sbyte[]

The values to be stored in the payload.

Returns

HarpMessage

A valid HarpMessage instance with the specified address, message type, port, timestamp, and payload.

FromSingle(int, MessageType, params float[])

Returns a HarpMessage with the specified address, message type, and an array payload of single-precision floating point numbers.

public static HarpMessage FromSingle(int address, MessageType messageType, params float[] values)

Parameters

address int

The address of the register to which the Harp message refers to.

messageType MessageType

The type of the Harp message.

values float[]

The values to be stored in the payload.

Returns

HarpMessage

A valid HarpMessage instance with the specified address, message type and payload.

FromSingle(int, double, MessageType, params float[])

Returns a HarpMessage with the specified address, message type, timestamp, and an array payload of single-precision floating point numbers.

public static HarpMessage FromSingle(int address, double timestamp, MessageType messageType, params float[] values)

Parameters

address int

The address of the register to which the Harp message refers to.

timestamp double

The timestamp of the message payload, in seconds.

messageType MessageType

The type of the Harp message.

values float[]

The values to be stored in the payload.

Returns

HarpMessage

A valid HarpMessage instance with the specified address, message type, timestamp, and payload.

FromSingle(int, int, MessageType, params float[])

Returns a HarpMessage with the specified address, message type, port, and an array payload of single-precision floating point numbers.

public static HarpMessage FromSingle(int address, int port, MessageType messageType, params float[] values)

Parameters

address int

The address of the register to which the Harp message refers to.

port int

The origin or destination of the Harp message, for routing purposes.

messageType MessageType

The type of the Harp message.

values float[]

The values to be stored in the payload.

Returns

HarpMessage

A valid HarpMessage instance with the specified address, message type, port, and payload.

FromSingle(int, int, double, MessageType, params float[])

Returns a HarpMessage with the specified address, message type, port, timestamp, and an array payload of single-precision floating point numbers.

public static HarpMessage FromSingle(int address, int port, double timestamp, MessageType messageType, params float[] values)

Parameters

address int

The address of the register to which the Harp message refers to.

port int

The origin or destination of the Harp message, for routing purposes.

timestamp double

The timestamp of the message payload, in seconds.

messageType MessageType

The type of the Harp message.

values float[]

The values to be stored in the payload.

Returns

HarpMessage

A valid HarpMessage instance with the specified address, message type, port, timestamp, and payload.

FromUInt16(int, MessageType, ushort)

Returns a HarpMessage with the specified address, message type, and a single value 16-bit unsigned integer payload.

public static HarpMessage FromUInt16(int address, MessageType messageType, ushort value)

Parameters

address int

The address of the register to which the Harp message refers to.

messageType MessageType

The type of the Harp message.

value ushort

The value to be stored in the payload.

Returns

HarpMessage

A valid HarpMessage instance with the specified address, message type and payload.

FromUInt16(int, MessageType, params ushort[])

Returns a HarpMessage with the specified address, message type, and an array payload of 16-bit unsigned integers.

public static HarpMessage FromUInt16(int address, MessageType messageType, params ushort[] values)

Parameters

address int

The address of the register to which the Harp message refers to.

messageType MessageType

The type of the Harp message.

values ushort[]

The values to be stored in the payload.

Returns

HarpMessage

A valid HarpMessage instance with the specified address, message type and payload.

FromUInt16(int, double, MessageType, ushort)

Returns a HarpMessage with the specified address, message type, timestamp, and a single value 16-bit unsigned integer payload.

public static HarpMessage FromUInt16(int address, double timestamp, MessageType messageType, ushort value)

Parameters

address int

The address of the register to which the Harp message refers to.

timestamp double

The timestamp of the message payload, in seconds.

messageType MessageType

The type of the Harp message.

value ushort

The value to be stored in the payload.

Returns

HarpMessage

A valid HarpMessage instance with the specified address, message type, timestamp, and payload.

FromUInt16(int, double, MessageType, params ushort[])

Returns a HarpMessage with the specified address, message type, timestamp, and an array payload of 16-bit unsigned integers.

public static HarpMessage FromUInt16(int address, double timestamp, MessageType messageType, params ushort[] values)

Parameters

address int

The address of the register to which the Harp message refers to.

timestamp double

The timestamp of the message payload, in seconds.

messageType MessageType

The type of the Harp message.

values ushort[]

The values to be stored in the payload.

Returns

HarpMessage

A valid HarpMessage instance with the specified address, message type, timestamp, and payload.

FromUInt16(int, int, MessageType, ushort)

Returns a HarpMessage with the specified address, message type, port, and a single value 16-bit unsigned integer payload.

public static HarpMessage FromUInt16(int address, int port, MessageType messageType, ushort value)

Parameters

address int

The address of the register to which the Harp message refers to.

port int

The origin or destination of the Harp message, for routing purposes.

messageType MessageType

The type of the Harp message.

value ushort

The value to be stored in the payload.

Returns

HarpMessage

A valid HarpMessage instance with the specified address, message type, port, and payload.

FromUInt16(int, int, MessageType, params ushort[])

Returns a HarpMessage with the specified address, message type, port, and an array payload of 16-bit unsigned integers.

public static HarpMessage FromUInt16(int address, int port, MessageType messageType, params ushort[] values)

Parameters

address int

The address of the register to which the Harp message refers to.

port int

The origin or destination of the Harp message, for routing purposes.

messageType MessageType

The type of the Harp message.

values ushort[]

The values to be stored in the payload.

Returns

HarpMessage

A valid HarpMessage instance with the specified address, message type, port, and payload.

FromUInt16(int, int, double, MessageType, ushort)

Returns a HarpMessage with the specified address, message type, port, timestamp, and a single value 16-bit unsigned integer payload.

public static HarpMessage FromUInt16(int address, int port, double timestamp, MessageType messageType, ushort value)

Parameters

address int

The address of the register to which the Harp message refers to.

port int

The origin or destination of the Harp message, for routing purposes.

timestamp double

The timestamp of the message payload, in seconds.

messageType MessageType

The type of the Harp message.

value ushort

The value to be stored in the payload.

Returns

HarpMessage

A valid HarpMessage instance with the specified address, message type, port, timestamp, and payload.

FromUInt16(int, int, double, MessageType, params ushort[])

Returns a HarpMessage with the specified address, message type, port, timestamp, and an array payload of 16-bit unsigned integers.

public static HarpMessage FromUInt16(int address, int port, double timestamp, MessageType messageType, params ushort[] values)

Parameters

address int

The address of the register to which the Harp message refers to.

port int

The origin or destination of the Harp message, for routing purposes.

timestamp double

The timestamp of the message payload, in seconds.

messageType MessageType

The type of the Harp message.

values ushort[]

The values to be stored in the payload.

Returns

HarpMessage

A valid HarpMessage instance with the specified address, message type, port, timestamp, and payload.

FromUInt32(int, MessageType, uint)

Returns a HarpMessage with the specified address, message type, and a single value 32-bit unsigned integer payload.

public static HarpMessage FromUInt32(int address, MessageType messageType, uint value)

Parameters

address int

The address of the register to which the Harp message refers to.

messageType MessageType

The type of the Harp message.

value uint

The value to be stored in the payload.

Returns

HarpMessage

A valid HarpMessage instance with the specified address, message type and payload.

FromUInt32(int, MessageType, params uint[])

Returns a HarpMessage with the specified address, message type, and an array payload of 32-bit unsigned integers.

public static HarpMessage FromUInt32(int address, MessageType messageType, params uint[] values)

Parameters

address int

The address of the register to which the Harp message refers to.

messageType MessageType

The type of the Harp message.

values uint[]

The values to be stored in the payload.

Returns

HarpMessage

A valid HarpMessage instance with the specified address, message type and payload.

FromUInt32(int, double, MessageType, uint)

Returns a HarpMessage with the specified address, message type, timestamp, and a single value 32-bit unsigned integer payload.

public static HarpMessage FromUInt32(int address, double timestamp, MessageType messageType, uint value)

Parameters

address int

The address of the register to which the Harp message refers to.

timestamp double

The timestamp of the message payload, in seconds.

messageType MessageType

The type of the Harp message.

value uint

The value to be stored in the payload.

Returns

HarpMessage

A valid HarpMessage instance with the specified address, message type, timestamp, and payload.

FromUInt32(int, double, MessageType, params uint[])

Returns a HarpMessage with the specified address, message type, timestamp, and an array payload of 32-bit unsigned integers.

public static HarpMessage FromUInt32(int address, double timestamp, MessageType messageType, params uint[] values)

Parameters

address int

The address of the register to which the Harp message refers to.

timestamp double

The timestamp of the message payload, in seconds.

messageType MessageType

The type of the Harp message.

values uint[]

The values to be stored in the payload.

Returns

HarpMessage

A valid HarpMessage instance with the specified address, message type, timestamp, and payload.

FromUInt32(int, int, MessageType, uint)

Returns a HarpMessage with the specified address, message type, port, and a single value 32-bit unsigned integer payload.

public static HarpMessage FromUInt32(int address, int port, MessageType messageType, uint value)

Parameters

address int

The address of the register to which the Harp message refers to.

port int

The origin or destination of the Harp message, for routing purposes.

messageType MessageType

The type of the Harp message.

value uint

The value to be stored in the payload.

Returns

HarpMessage

A valid HarpMessage instance with the specified address, message type, port, and payload.

FromUInt32(int, int, MessageType, params uint[])

Returns a HarpMessage with the specified address, message type, port, and an array payload of 32-bit unsigned integers.

public static HarpMessage FromUInt32(int address, int port, MessageType messageType, params uint[] values)

Parameters

address int

The address of the register to which the Harp message refers to.

port int

The origin or destination of the Harp message, for routing purposes.

messageType MessageType

The type of the Harp message.

values uint[]

The values to be stored in the payload.

Returns

HarpMessage

A valid HarpMessage instance with the specified address, message type, port, and payload.

FromUInt32(int, int, double, MessageType, uint)

Returns a HarpMessage with the specified address, message type, port, timestamp, and a single value 32-bit unsigned integer payload.

public static HarpMessage FromUInt32(int address, int port, double timestamp, MessageType messageType, uint value)

Parameters

address int

The address of the register to which the Harp message refers to.

port int

The origin or destination of the Harp message, for routing purposes.

timestamp double

The timestamp of the message payload, in seconds.

messageType MessageType

The type of the Harp message.

value uint

The value to be stored in the payload.

Returns

HarpMessage

A valid HarpMessage instance with the specified address, message type, port, timestamp, and payload.

FromUInt32(int, int, double, MessageType, params uint[])

Returns a HarpMessage with the specified address, message type, port, timestamp, and an array payload of 32-bit unsigned integers.

public static HarpMessage FromUInt32(int address, int port, double timestamp, MessageType messageType, params uint[] values)

Parameters

address int

The address of the register to which the Harp message refers to.

port int

The origin or destination of the Harp message, for routing purposes.

timestamp double

The timestamp of the message payload, in seconds.

messageType MessageType

The type of the Harp message.

values uint[]

The values to be stored in the payload.

Returns

HarpMessage

A valid HarpMessage instance with the specified address, message type, port, timestamp, and payload.

FromUInt64(int, MessageType, ulong)

Returns a HarpMessage with the specified address, message type, and a single value 64-bit unsigned integer payload.

public static HarpMessage FromUInt64(int address, MessageType messageType, ulong value)

Parameters

address int

The address of the register to which the Harp message refers to.

messageType MessageType

The type of the Harp message.

value ulong

The value to be stored in the payload.

Returns

HarpMessage

A valid HarpMessage instance with the specified address, message type and payload.

FromUInt64(int, MessageType, params ulong[])

Returns a HarpMessage with the specified address, message type, and an array payload of 64-bit unsigned integers.

public static HarpMessage FromUInt64(int address, MessageType messageType, params ulong[] values)

Parameters

address int

The address of the register to which the Harp message refers to.

messageType MessageType

The type of the Harp message.

values ulong[]

The values to be stored in the payload.

Returns

HarpMessage

A valid HarpMessage instance with the specified address, message type and payload.

FromUInt64(int, double, MessageType, ulong)

Returns a HarpMessage with the specified address, message type, timestamp, and a single value 64-bit unsigned integer payload.

public static HarpMessage FromUInt64(int address, double timestamp, MessageType messageType, ulong value)

Parameters

address int

The address of the register to which the Harp message refers to.

timestamp double

The timestamp of the message payload, in seconds.

messageType MessageType

The type of the Harp message.

value ulong

The value to be stored in the payload.

Returns

HarpMessage

A valid HarpMessage instance with the specified address, message type, timestamp, and payload.

FromUInt64(int, double, MessageType, params ulong[])

Returns a HarpMessage with the specified address, message type, timestamp, and an array payload of 64-bit unsigned integers.

public static HarpMessage FromUInt64(int address, double timestamp, MessageType messageType, params ulong[] values)

Parameters

address int

The address of the register to which the Harp message refers to.

timestamp double

The timestamp of the message payload, in seconds.

messageType MessageType

The type of the Harp message.

values ulong[]

The values to be stored in the payload.

Returns

HarpMessage

A valid HarpMessage instance with the specified address, message type, timestamp, and payload.

FromUInt64(int, int, MessageType, ulong)

Returns a HarpMessage with the specified address, message type, port, and a single value 64-bit unsigned integer payload.

public static HarpMessage FromUInt64(int address, int port, MessageType messageType, ulong value)

Parameters

address int

The address of the register to which the Harp message refers to.

port int

The origin or destination of the Harp message, for routing purposes.

messageType MessageType

The type of the Harp message.

value ulong

The value to be stored in the payload.

Returns

HarpMessage

A valid HarpMessage instance with the specified address, message type, port, and payload.

FromUInt64(int, int, MessageType, params ulong[])

Returns a HarpMessage with the specified address, message type, port, and an array payload of 64-bit unsigned integers.

public static HarpMessage FromUInt64(int address, int port, MessageType messageType, params ulong[] values)

Parameters

address int

The address of the register to which the Harp message refers to.

port int

The origin or destination of the Harp message, for routing purposes.

messageType MessageType

The type of the Harp message.

values ulong[]

The values to be stored in the payload.

Returns

HarpMessage

A valid HarpMessage instance with the specified address, message type, port, and payload.

FromUInt64(int, int, double, MessageType, ulong)

Returns a HarpMessage with the specified address, message type, port, timestamp, and a single value 64-bit unsigned integer payload.

public static HarpMessage FromUInt64(int address, int port, double timestamp, MessageType messageType, ulong value)

Parameters

address int

The address of the register to which the Harp message refers to.

port int

The origin or destination of the Harp message, for routing purposes.

timestamp double

The timestamp of the message payload, in seconds.

messageType MessageType

The type of the Harp message.

value ulong

The value to be stored in the payload.

Returns

HarpMessage

A valid HarpMessage instance with the specified address, message type, port, timestamp, and payload.

FromUInt64(int, int, double, MessageType, params ulong[])

Returns a HarpMessage with the specified address, message type, port, timestamp, and an array payload of 64-bit unsigned integers.

public static HarpMessage FromUInt64(int address, int port, double timestamp, MessageType messageType, params ulong[] values)

Parameters

address int

The address of the register to which the Harp message refers to.

port int

The origin or destination of the Harp message, for routing purposes.

timestamp double

The timestamp of the message payload, in seconds.

messageType MessageType

The type of the Harp message.

values ulong[]

The values to be stored in the payload.

Returns

HarpMessage

A valid HarpMessage instance with the specified address, message type, port, timestamp, and payload.

GetPayload()

Gets the array segment containing the raw message payload. This method returns a view into the original array without copying any data.

public ArraySegment<byte> GetPayload()

Returns

ArraySegment<byte>

An ArraySegment<T> delimiting the message payload section of the message bytes.

GetPayloadArray<TArray>()

Returns the message payload as an array of non-pointer value types. The size of the type should be a multiple of the total size of the payload.

public TArray[] GetPayloadArray<TArray>() where TArray : unmanaged

Returns

TArray[]

An array containing a copy of the message payload data.

Type Parameters

TArray

The type of the non-pointer values in the array.

GetPayloadByte()

Returns the message payload as a single 8-bit unsigned integer.

public byte GetPayloadByte()

Returns

byte

A byte representing the message payload.

GetPayloadByte(int)

Returns the element at the specified index of the 8-bit unsigned integer array payload.

public byte GetPayloadByte(int index)

Parameters

index int

The zero-based index of the array element to get.

Returns

byte

A byte representing the element at the specified index of the array payload.

GetPayloadInt16()

Returns the message payload as a single 16-bit signed integer.

public short GetPayloadInt16()

Returns

short

A short representing the message payload.

GetPayloadInt16(int)

Returns the element at the specified index of the 16-bit signed integer array payload.

public short GetPayloadInt16(int index)

Parameters

index int

The zero-based index of the array element to get.

Returns

short

A short representing the element at the specified index of the array payload.

GetPayloadInt32()

Returns the message payload as a single 32-bit signed integer.

public int GetPayloadInt32()

Returns

int

An int representing the message payload.

GetPayloadInt32(int)

Returns the element at the specified index of the 32-bit signed integer array payload.

public int GetPayloadInt32(int index)

Parameters

index int

The zero-based index of the array element to get.

Returns

int

An int representing the element at the specified index of the array payload.

GetPayloadInt64()

Returns the message payload as a single 64-bit signed integer.

public long GetPayloadInt64()

Returns

long

A long representing the message payload.

GetPayloadInt64(int)

Returns the element at the specified index of the 64-bit signed integer array payload.

public long GetPayloadInt64(int index)

Parameters

index int

The zero-based index of the array element to get.

Returns

long

A long representing the element at the specified index of the array payload.

GetPayloadSByte()

Returns the message payload as a single 8-bit signed integer.

public sbyte GetPayloadSByte()

Returns

sbyte

An sbyte representing the message payload.

GetPayloadSByte(int)

Returns the element at the specified index of the 8-bit signed integer array payload.

public sbyte GetPayloadSByte(int index)

Parameters

index int

The zero-based index of the array element to get.

Returns

sbyte

An sbyte representing the element at the specified index of the array payload.

GetPayloadSingle()

Returns the message payload as a single-precision floating point number.

public float GetPayloadSingle()

Returns

float

A float representing the message payload.

GetPayloadSingle(int)

Returns the element at the specified index of the single-precision floating point array payload.

public float GetPayloadSingle(int index)

Parameters

index int

The zero-based index of the array element to get.

Returns

float

A float representing the element at the specified index of the array payload.

GetPayloadUInt16()

Returns the message payload as a single 16-bit unsigned integer.

public ushort GetPayloadUInt16()

Returns

ushort

A ushort representing the message payload.

GetPayloadUInt16(int)

Returns the element at the specified index of the 16-bit unsigned integer array payload.

public ushort GetPayloadUInt16(int index)

Parameters

index int

The zero-based index of the array element to get.

Returns

ushort

A ushort representing the element at the specified index of the array payload.

GetPayloadUInt32()

Returns the message payload as a single 32-bit unsigned integer.

public uint GetPayloadUInt32()

Returns

uint

A uint representing the message payload.

GetPayloadUInt32(int)

Returns the element at the specified index of the 32-bit unsigned integer array payload.

public uint GetPayloadUInt32(int index)

Parameters

index int

The zero-based index of the array element to get.

Returns

uint

A uint representing the element at the specified index of the array payload.

GetPayloadUInt64()

Returns the message payload as a single 64-bit unsigned integer.

public ulong GetPayloadUInt64()

Returns

ulong

A ulong representing the message payload.

GetPayloadUInt64(int)

Returns the element at the specified index of the 64-bit unsigned integer array payload.

public ulong GetPayloadUInt64(int index)

Parameters

index int

The zero-based index of the array element to get.

Returns

ulong

A ulong representing the element at the specified index of the array payload.

GetTimestamp()

Gets the timestamp of the message payload, in seconds.

public double GetTimestamp()

Returns

double

A double representing the timestamp of the message payload, in seconds.

Exceptions

InvalidOperationException

The message does not have a timestamped payload.

GetTimestampedPayload()

Gets the array segment containing the raw message payload and the timestamp. This method returns a view into the original array without copying any data.

public Timestamped<ArraySegment<byte>> GetTimestampedPayload()

Returns

Timestamped<ArraySegment<byte>>

A timestamped ArraySegment<T> delimiting the message payload section of the message bytes.

Exceptions

InvalidOperationException

The message does not have a timestamped payload.

GetTimestampedPayloadArray<TArray>()

Returns the message payload as an array of non-pointer value types and gets the message timestamp. The size of the type should be a multiple of the total size of the payload.

public Timestamped<TArray[]> GetTimestampedPayloadArray<TArray>() where TArray : unmanaged

Returns

Timestamped<TArray[]>

A timestamped array containing a copy of the message payload data.

Type Parameters

TArray

The type of the non-pointer values in the array.

Exceptions

InvalidOperationException

The message does not have a timestamped payload.

GetTimestampedPayloadByte()

Returns the message payload as a single 8-bit unsigned integer and gets the message timestamp.

public Timestamped<byte> GetTimestampedPayloadByte()

Returns

Timestamped<byte>

A timestamped byte representing the message payload.

Exceptions

InvalidOperationException

The message does not have a timestamped payload.

GetTimestampedPayloadByte(int)

Returns the element at the specified index of the 8-bit unsigned integer array payload and gets the message timestamp.

public Timestamped<byte> GetTimestampedPayloadByte(int index)

Parameters

index int

The zero-based index of the array element to get.

Returns

Timestamped<byte>

A timestamped byte representing the element at the specified index of the array payload.

Exceptions

InvalidOperationException

The message does not have a timestamped payload.

GetTimestampedPayloadInt16()

Returns the message payload as a single 16-bit signed integer and gets the message timestamp.

public Timestamped<short> GetTimestampedPayloadInt16()

Returns

Timestamped<short>

A timestamped short representing the message payload.

Exceptions

InvalidOperationException

The message does not have a timestamped payload.

GetTimestampedPayloadInt16(int)

Returns the element at the specified index of the 16-bit signed integer array payload and gets the message timestamp.

public Timestamped<short> GetTimestampedPayloadInt16(int index)

Parameters

index int

The zero-based index of the array element to get.

Returns

Timestamped<short>

A timestamped short representing the element at the specified index of the array payload.

Exceptions

InvalidOperationException

The message does not have a timestamped payload.

GetTimestampedPayloadInt32()

Returns the message payload as a single 32-bit signed integer and gets the message timestamp.

public Timestamped<int> GetTimestampedPayloadInt32()

Returns

Timestamped<int>

A timestamped int representing the message payload.

Exceptions

InvalidOperationException

The message does not have a timestamped payload.

GetTimestampedPayloadInt32(int)

Returns the element at the specified index of the 32-bit signed integer array payload and gets the message timestamp.

public Timestamped<int> GetTimestampedPayloadInt32(int index)

Parameters

index int

The zero-based index of the array element to get.

Returns

Timestamped<int>

A timestamped int representing the element at the specified index of the array payload.

Exceptions

InvalidOperationException

The message does not have a timestamped payload.

GetTimestampedPayloadInt64()

Returns the message payload as a single 64-bit signed integer and gets the message timestamp.

public Timestamped<long> GetTimestampedPayloadInt64()

Returns

Timestamped<long>

A timestamped long representing the message payload.

Exceptions

InvalidOperationException

The message does not have a timestamped payload.

GetTimestampedPayloadInt64(int)

Returns the element at the specified index of the 64-bit signed integer array payload and gets the message timestamp.

public Timestamped<long> GetTimestampedPayloadInt64(int index)

Parameters

index int

The zero-based index of the array element to get.

Returns

Timestamped<long>

A timestamped long representing the element at the specified index of the array payload.

Exceptions

InvalidOperationException

The message does not have a timestamped payload.

GetTimestampedPayloadSByte()

Returns the message payload as a single 8-bit signed integer and gets the message timestamp.

public Timestamped<sbyte> GetTimestampedPayloadSByte()

Returns

Timestamped<sbyte>

A timestamped sbyte representing the message payload.

Exceptions

InvalidOperationException

The message does not have a timestamped payload.

GetTimestampedPayloadSByte(int)

Returns the element at the specified index of the 8-bit signed integer array payload and gets the message timestamp.

public Timestamped<sbyte> GetTimestampedPayloadSByte(int index)

Parameters

index int

The zero-based index of the array element to get.

Returns

Timestamped<sbyte>

A timestamped sbyte representing the element at the specified index of the array payload.

Exceptions

InvalidOperationException

The message does not have a timestamped payload.

GetTimestampedPayloadSingle()

Returns the message payload as a single-precision floating point number and gets the message timestamp.

public Timestamped<float> GetTimestampedPayloadSingle()

Returns

Timestamped<float>

A timestamped float representing the message payload.

Exceptions

InvalidOperationException

The message does not have a timestamped payload.

GetTimestampedPayloadSingle(int)

Returns the element at the specified index of the single-precision floating point array payload and gets the message timestamp.

public Timestamped<float> GetTimestampedPayloadSingle(int index)

Parameters

index int

The zero-based index of the array element to get.

Returns

Timestamped<float>

A timestamped float representing the element at the specified index of the array payload.

Exceptions

InvalidOperationException

The message does not have a timestamped payload.

GetTimestampedPayloadUInt16()

Returns the message payload as a single 16-bit unsigned integer and gets the message timestamp.

public Timestamped<ushort> GetTimestampedPayloadUInt16()

Returns

Timestamped<ushort>

A timestamped ushort representing the message payload.

Exceptions

InvalidOperationException

The message does not have a timestamped payload.

GetTimestampedPayloadUInt16(int)

Returns the element at the specified index of the 16-bit unsigned integer array payload and gets the message timestamp.

public Timestamped<ushort> GetTimestampedPayloadUInt16(int index)

Parameters

index int

The zero-based index of the array element to get.

Returns

Timestamped<ushort>

A timestamped ushort representing the element at the specified index of the array payload.

Exceptions

InvalidOperationException

The message does not have a timestamped payload.

GetTimestampedPayloadUInt32()

Returns the message payload as a single 32-bit unsigned integer and gets the message timestamp.

public Timestamped<uint> GetTimestampedPayloadUInt32()

Returns

Timestamped<uint>

A timestamped uint representing the message payload.

Exceptions

InvalidOperationException

The message does not have a timestamped payload.

GetTimestampedPayloadUInt32(int)

Returns the element at the specified index of the 32-bit unsigned integer array payload and gets the message timestamp.

public Timestamped<uint> GetTimestampedPayloadUInt32(int index)

Parameters

index int

The zero-based index of the array element to get.

Returns

Timestamped<uint>

A timestamped uint representing the element at the specified index of the array payload.

Exceptions

InvalidOperationException

The message does not have a timestamped payload.

GetTimestampedPayloadUInt64()

Returns the message payload as a single 64-bit unsigned integer and gets the message timestamp.

public Timestamped<ulong> GetTimestampedPayloadUInt64()

Returns

Timestamped<ulong>

A timestamped ulong representing the message payload.

Exceptions

InvalidOperationException

The message does not have a timestamped payload.

GetTimestampedPayloadUInt64(int)

Returns the element at the specified index of the 64-bit unsigned integer array payload and gets the message timestamp.

public Timestamped<ulong> GetTimestampedPayloadUInt64(int index)

Parameters

index int

The zero-based index of the array element to get.

Returns

Timestamped<ulong>

A timestamped ulong representing the element at the specified index of the array payload.

Exceptions

InvalidOperationException

The message does not have a timestamped payload.

IsMatch(int)

Indicates whether the Harp message matches the specified address.

public bool IsMatch(int address)

Parameters

address int

The address to test for a match.

Returns

bool

true if this Harp message matches the specified address; otherwise, false.

IsMatch(int, MessageType)

Indicates whether the Harp message matches the specified address and message type.

public bool IsMatch(int address, MessageType messageType)

Parameters

address int

The address to test for a match.

messageType MessageType

The message type to test for a match.

Returns

bool

true if this Harp message matches the specified address and message type; otherwise, false.

IsMatch(int, MessageType, PayloadType)

Indicates whether the Harp message matches the specified address, message type, and payload type.

public bool IsMatch(int address, MessageType messageType, PayloadType payloadType)

Parameters

address int

The address to test for a match.

messageType MessageType

The message type to test for a match.

payloadType PayloadType

The payload type to test for a match.

Returns

bool

true if this Harp message matches the specified address, message type, and payload type; otherwise, false.

IsMatch(int, PayloadType)

Indicates whether the Harp message matches the specified address and payload type.

public bool IsMatch(int address, PayloadType payloadType)

Parameters

address int

The address to test for a match.

payloadType PayloadType

The payload type to test for a match.

Returns

bool

true if this Harp message matches the specified address and payload type; otherwise, false.

ToString()

Returns a string that represents the Harp message metadata, payload length and timestamp.

public override string ToString()

Returns

string

A formatted string representing the Harp message metadata, payload length and timestamp.

TryGetTimestamp(out double)

Gets the timestamp of the message payload, in seconds. A return value indicates whether the message has a timestamped payload.

public bool TryGetTimestamp(out double timestamp)

Parameters

timestamp double

The timestamp of the message payload, in seconds.

Returns

bool

true if the message has a timestamped payload; otherwise, false.