A class for representing and encoding 6-byte binary commands.
More...
|
byte | CommandNumber = 54 |
| The number of the command to send. More...
|
|
int | Data = 0 |
| The data value to send in the command. More...
|
|
byte | DeviceAddress |
| The address of the device to which to send a command, or 0 to send a command to all devices on the chain. More...
|
|
A class for representing and encoding 6-byte binary commands.
Create a blank BinaryCommand.
Though this constructor should be thought of as creating a blank command, integers must be set to something by default, which is usually 0. This is dangerous, as command number 0 is the "reset" command. Therefore, the default command number is instead 54, the "get status" command.
Create a BinaryCommand from 6 bytes in the proper form to be sent to a device using the binary protocol.
- Parameters
-
command | A byte array, the first six bytes of which will be converted into a BinaryCommand object. |
BinaryCommand |
( |
byte |
deviceAddress, |
|
|
byte |
commandNumber, |
|
|
int |
data |
|
) |
| |
|
inline |
The recommended constructor, creating a BinaryCommand from user- specified parameters.
- Parameters
-
deviceAddress | The number of the target device. |
commandNumber | The number of the command to send. |
data | The data to send with the command. |
override bool Equals |
( |
object |
obj | ) |
|
|
inlineinherited |
Tests the equality of any object against this command.
- Parameters
-
obj | The object to be compared. |
- Returns
- True if the object and this command are equal, false if they are inequal.
override bool Equals |
( |
Command |
command | ) |
|
|
inlinevirtual |
Checks to see if this command is equal to another Command.
- Parameters
-
command | The command to compare this one to. |
- Returns
- True if the commands are equal, false if inequal.
Implements Command.
Reports whether a BinaryCommand is equal to this one.
Equality is defined as having all of the same attribute values. If any of the objects' attributes are inequal, this method returns false.
- Parameters
-
- Returns
- true if equal, false if inequal.
override int GetHashCode |
( |
| ) |
|
|
inlinevirtual |
Returns a hash code based off the command's attributes.
The hash code returned by this function depends on all of the attributes of the object, including the mutable ones. This means that when using this class in a HashMap or similar structure, it should be considered immutable, or else it will be lost upon being changed.
- Returns
- The calculated hash code.
Implements Command.
Encodes the command represented by this object into an array of bytes in the form specified by the Zaber Binary Protocol Manual.
- Returns
- A 6-byte array to be transmitted to a device.
override string ToString |
( |
| ) |
|
|
inlinevirtual |
Returns a human-readable representation of this command.
- Returns
- A string representing the command.
Implements Command.
The number of the command to send.
The data value to send in the command.
The address of the device to which to send a command, or 0 to send a command to all devices on the chain.
The documentation for this class was generated from the following file: