Roboid Control for C#
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | Static Public Attributes | List of all members
RoboidControl.ThingMsg Class Reference

Detailed Description

Message providing generic details about a Thing.

Inheritance diagram for RoboidControl.ThingMsg:
RoboidControl.IMessage

Public Member Functions

 ThingMsg (byte networkId, Thing thing)
 Create a message for sending.
 
 ThingMsg (byte[] buffer)
 Create a message for receiving.
 
override byte Serialize (ref byte[] buffer)
 Serialize the message into a byte array.
 

Public Attributes

byte networkId
 The network ID of the thing.
 
byte thingId
 The ID of the thing.
 
byte thingType
 The type of thing.
 
byte parentId
 The ID of the parent thing in the hierarchy. This is zero for root things.
 

Static Public Attributes

const byte id = 0x80
 The message ID.
 
const byte length = 5
 The length of the message.
 

Constructor & Destructor Documentation

◆ ThingMsg() [1/2]

RoboidControl.ThingMsg.ThingMsg ( byte  networkId,
Thing  thing 
)

Create a message for sending.

Parameters
networkIdThe network ID of the thing
thingThe thing

◆ ThingMsg() [2/2]

RoboidControl.ThingMsg.ThingMsg ( byte[]  buffer)

Create a message for receiving.

Parameters
bufferThe byte array to parse

Member Function Documentation

◆ Serialize()

override byte RoboidControl.ThingMsg.Serialize ( ref byte[]  buffer)
virtual

Serialize the message into a byte array.

Parameters
bufferThe buffer to serialize into
Returns
The length of the message in the bufer. 0 when the buffer was too small

Reimplemented from RoboidControl.IMessage.