Send command to Lego NXT brick and read reply.

Namespace:  AForge.Robotics.Lego
Assembly:  AForge.Robotics.Lego (in AForge.Robotics.Lego.dll) Version: 2.2.5.0 (2.2.5.0)

Syntax

C#
public bool SendCommand(
	byte[] command,
	byte[] reply
)

Parameters

command
Type: array< System..::.Byte >[]()[]
Command to send.
reply
Type: array< System..::.Byte >[]()[]
Buffer to receive reply into.

Return Value

Returns true if the command was sent successfully and reply was received, otherwise false.

Exceptions

ExceptionCondition
System..::.NullReferenceExceptionCommunication can not be performed, because connection with NXT brick was not established yet.
System..::.ArgumentExceptionReply buffer size is smaller than the reply data size.
System..::.ApplicationExceptionReply does not correspond to command (second byte of reply should be equal to second byte of command).
System..::.ApplicationExceptionError occurred on NXT brick side.

See Also