Edit

Share via


ProprietaryMessage.ReadFromHexString Method

Definition

Decodes a value from a longer hex string (PRDIN messages contain one blob of stringly-typed hex numbers)

protected bool ReadFromHexString (string input, int start, int length, bool inverseEndianess, out int value);
member this.ReadFromHexString : string * int * int * bool * int -> bool
Protected Function ReadFromHexString (input As String, start As Integer, length As Integer, inverseEndianess As Boolean, ByRef value As Integer) As Boolean

Parameters

input
String

Input string

start
Int32

Start offset of required number

length
Int32

Length of required number. Must be 2, 4 or 8

inverseEndianess
Boolean

True to inverse the endianess of the number (reverse the partial string)

value
Int32

The output value

Returns

True on success, false otherwise

Exceptions

Length is not 2, 4 or 8

Remarks

Other erroneous inputs don't throw an exception but return false, e.g. string shorter than expected or value is not a hex number. This is to prevent an exception in case of a malformed message.

Applies to