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 4 bytes.

Location

 

constructor Create

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

constructor Create

constructor CreateFromStream

constructor CreateFromStream(iStream: TStream)

Parameters:

  • iStream:

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

Header

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

property Header: TBinHeaderArray read write

HeaderValid

class function HeaderValid(aData: array of Byte): 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 write

SignatureValid

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

property SignatureValid: boolean read write

UserData

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

property UserData: Word read write

WriteToStream

Writes the content of the Header into iStream.

procedure WriteToStream(iStream: TStream)

Parameters:

  • iStream: 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

Header

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

property Header: TBinHeaderArray read write

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 write

SignatureValid

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

property SignatureValid: boolean read write

UserData

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

property UserData: Word read write

 

HeaderValid

class function HeaderValid(aData: array of Byte): Boolean

Parameters:

  • aData:

 

constructor Create

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

constructor Create

constructor CreateFromStream

constructor CreateFromStream(iStream: TStream)

Parameters:

  • iStream:

WriteToStream

Writes the content of the Header into iStream.

procedure WriteToStream(iStream: TStream)

Parameters:

  • iStream: stream

See Also