pt.citar.diablu.nxt.protocol
Class NXTCommandLSWrite

java.lang.Object
  extended by pt.citar.diablu.nxt.protocol.NXTCommand
      extended by pt.citar.diablu.nxt.protocol.NXTCommandLSWrite

public class NXTCommandLSWrite
extends NXTCommand

Represents the LS Write Command. The response to this command (if required) is a NXTResponseStatus.

Author:
Jorge Cardoso
See Also:
NXTResponseStatus

Constructor Summary
NXTCommandLSWrite()
           
NXTCommandLSWrite(byte inputPort, byte txLength, byte rxLength, byte[] data, boolean responseRequired)
          Constructs a new NXTCommandLSWrite object with a given port, TX data length, RX data length, data and resqponse requirement.
 
Method Summary
 void setData(byte[] data)
          Sets the data.
 void setRXLength(byte rxLength)
          Sets the RX Data Length.
 void setTXLength(byte txLength)
          Sets the TX Data Length.
 
Methods inherited from class pt.citar.diablu.nxt.protocol.NXTCommand
getPacketLength, isResponseRequired, sendCommand, setResponseRequired, toString
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

NXTCommandLSWrite

public NXTCommandLSWrite()

NXTCommandLSWrite

public NXTCommandLSWrite(byte inputPort,
                         byte txLength,
                         byte rxLength,
                         byte[] data,
                         boolean responseRequired)
Constructs a new NXTCommandLSWrite object with a given port, TX data length, RX data length, data and resqponse requirement. For LS communication on the NXT, data lengths are limited to 16 bytes per command. Rx Data Length MUST be specified in the write command since reading from the device is done on a master-slave basis.

Parameters:
inputPort - The input port to send the command to.
txLength - Tx Data Length.
rxLength - Rx Data Length.
data - The data to send.
responseRequired - Indicates if a response to this command is required.
Method Detail

setTXLength

public void setTXLength(byte txLength)
Sets the TX Data Length.

Parameters:
txLength - The Tx data length.

setRXLength

public void setRXLength(byte rxLength)
Sets the RX Data Length.

Parameters:
rxLength - The Rx data length.

setData

public void setData(byte[] data)
Sets the data.

Parameters:
data - The data.


Processing library NXTComm by Jorge C. S. Cardoso. (c) 2014