pt.citar.diablu.nxt.protocol
Class NXTCommandSendMsg

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

public class NXTCommandSendMsg
extends NXTCommand

Represents the SENDMESSAGE Command. The response to this command (if required) is a NXTResponseStatus.
Example 1:


 
Example 2:

 

Author:
Anton Vanhoucke & Jorge Cardoso
See Also:
NXTResponseStatus

Constructor Summary
NXTCommandSendMsg()
           
NXTCommandSendMsg(int mailbox, String message)
          Constructs a new NXTCommandSendMsg object with a given frequency and duration and with no response requirement.
NXTCommandSendMsg(int mailbox, String message, boolean responseRequired)
          Constructs a new NXTCommandSendMsg object with a give message and mailbox number to send to.
 
Method Summary
 int getMailbox()
          Returns the mailbox number when the command is sent.
 String getMessage()
          Returns the current message when the command is sent.
 void setMailbox(int mailbox)
          Sets the mailbox number to send the message to.
 void setMessage(String message)
          Sets the message.
 
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

NXTCommandSendMsg

public NXTCommandSendMsg()

NXTCommandSendMsg

public NXTCommandSendMsg(int mailbox,
                         String message)
Constructs a new NXTCommandSendMsg object with a given frequency and duration and with no response requirement.

Parameters:
Mailbox -
Message - (string)

NXTCommandSendMsg

public NXTCommandSendMsg(int mailbox,
                         String message,
                         boolean responseRequired)
Constructs a new NXTCommandSendMsg object with a give message and mailbox number to send to.

Parameters:
mailbox - Mailbox number for your NXT-G block
message - Message string
responseRequired - Indicates if a response to this command is required.
Method Detail

getMailbox

public int getMailbox()
Returns the mailbox number when the command is sent.

Returns:
The mailbox number

setMailbox

public void setMailbox(int mailbox)
Sets the mailbox number to send the message to.

Parameters:
mailbox - (0->mailbox 1)

getMessage

public String getMessage()
Returns the current message when the command is sent.

Returns:
The message

setMessage

public void setMessage(String message)
Sets the message.

Parameters:
message. - String.


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