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

Detailed Description

A message containing binary data for custom communication.

Inheritance diagram for Passer.RoboidControl.BinaryMsg:
Passer.RoboidControl.IMessage

Public Member Functions

 BinaryMsg (byte networkId, byte thingId, byte[] bytes)
 Create a new message for sending.
 
 BinaryMsg (byte networkId, Thing thing)
 Create an empty message for sending.
 
 BinaryMsg (byte[] buffer)
 Create a message for receiving.
 
override byte Serialize (ref byte[] buffer)
 Serialize the message into a byte array for sending.
 

Public Attributes

byte networkId
 The network ID identifying the thing.
 
byte thingId
 The ID of the thing.
 
byte[] bytes
 The binary data.
 

Static Public Attributes

const byte Id = 0xB1
 The message ID.
 
const byte length = 2
 The length of the message, excluding the binary data.
 

Constructor & Destructor Documentation

◆ BinaryMsg() [1/3]

Passer.RoboidControl.BinaryMsg.BinaryMsg ( byte  networkId,
byte  thingId,
byte[]  bytes 
)

Create a new message for sending.

Parameters
networkIdThe netowork ID of the thing
thingIdThe ID of the thing
bytesThe binary data for the thing

◆ BinaryMsg() [2/3]

Passer.RoboidControl.BinaryMsg.BinaryMsg ( byte  networkId,
Thing  thing 
)

Create an empty message for sending.

Parameters
networkIdThe netowork ID of the thing
thingIdThe ID of the thing

◆ BinaryMsg() [3/3]

Passer.RoboidControl.BinaryMsg.BinaryMsg ( byte[]  buffer)

Create a message for receiving.

Parameters
bufferThe byte array to parse

Member Function Documentation

◆ Serialize()

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

Serialize the message into a byte array for sending.

Parameters
bufferThe buffer to serilize into
Returns
The length of the message in the buffer

Reimplemented from Passer.RoboidControl.IMessage.

Member Data Documentation

◆ length

const byte Passer.RoboidControl.BinaryMsg.length = 2
static

The length of the message, excluding the binary data.

For the total size of the message this.bytes.Length should be added to this value.