TBinHeader

Overview

The TBinHeader class encapsulates the heading of the binary messages protocol which consists of:

    Header BINARY LAYOUT: $1C bytes
     52 4f 31 30  = "RO10" basic RO signature for RO 1.0
     XX YY ZZ --  = XX: subversion (currenly "7")
                     YY: option flags: 01 = compressed
                     ZZ: message type as defined in uROClientIntf
                     --: reserved for future use
     -- -- UU UU  = UU: user data (word)
     CC CC CC CC    $10 bytes ClientID (guid)
     CC CC CC CC
     CC CC CC CC
     CC CC CC CC

It is used by TROBinMessage to encode and decode the standard message prefix. You will not need to use the TBinHeader class directly, ecxept if you want develop your own proprietary protocol. Be aware that it has to concord with TROBinMessage and other participants of communication. You can safely use the user data field to store an arbitrary 2 bytes.

Location


 

constructor Create

Reads the Header from iStream and raises an exception if SignatureValid is false.

constructor Create

constructor CreateFromStream

constructor CreateFromStream(Source: TStream)

Parameters:

  • Source:

ClientID

Value of the TROMessage property.

property ClientID: TGUID read write

Compressed

Value of the TROBinMessage property (related to the message body only).

property Compressed: Boolean read write

Access to content binary data (array of $1C bytes).

property Header: TBinHeaderArray read

HeaderValid

class function HeaderValid(aData: TBytes): Boolean

Parameters:

  • aData:

MessageType

Value of the TMessageType.

property MessageType: TBinMessageType read write

SignatureIsEncrypted

True if the header's signature (first 5 bytes) is equal to (#114, #111, #114, #111, #99) //'roroc'.

property SignatureIsEncrypted: Boolean read

SignatureValid

True if the header's signature (first 5 bytes) is equal to (#82, #79, #49, #48, #55) //'RO107'.

property SignatureValid: Boolean read

UserData

An arbitrary 2 bytes (not used by RO SDK).

property UserData: Word read write

WriteToStream

Writes the content of the Header into iStream.

procedure WriteToStream(Dest: TStream)

Parameters:

  • Dest: stream

 

ClientID

Value of the TROMessage property.

property ClientID: TGUID read write

Compressed

Value of the TROBinMessage property (related to the message body only).

property Compressed: Boolean read write

Access to content binary data (array of $1C bytes).

property Header: TBinHeaderArray read

MessageType

Value of the TMessageType.

property MessageType: TBinMessageType read write

SignatureIsEncrypted

True if the header's signature (first 5 bytes) is equal to (#114, #111, #114, #111, #99) //'roroc'.

property SignatureIsEncrypted: Boolean read

SignatureValid

True if the header's signature (first 5 bytes) is equal to (#82, #79, #49, #48, #55) //'RO107'.

property SignatureValid: Boolean read

UserData

An arbitrary 2 bytes (not used by RO SDK).

property UserData: Word read write

 

HeaderValid

class function HeaderValid(aData: TBytes): Boolean

Parameters:

  • aData:

 

constructor Create

Reads the Header from iStream and raises an exception if SignatureValid is false.

constructor Create

constructor CreateFromStream

constructor CreateFromStream(Source: TStream)

Parameters:

  • Source:

WriteToStream

Writes the content of the Header into iStream.

procedure WriteToStream(Dest: TStream)

Parameters:

  • Dest: stream