pt.citar.diablu.nxt.protocol
Class NXTCommandReceiveMsg

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

public class NXTCommandReceiveMsg
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
NXTCommandReceiveMsg()
           
NXTCommandReceiveMsg(int mailbox)
          Constructs a new NXTCommandSendMsg object with a given frequency and duration and with no response requirement.
NXTCommandReceiveMsg(int mailbox, boolean remove)
          Represents the MESSAGEREAD Command.
 
Method Summary
 int getMailbox()
          Returns the mailbox number when the command is sent.
 String getMessageString()
          Returns actual string message obtained from brick
 boolean getRemoveFlag()
          Returns the current status of the remove flag
 void setMailbox(int mailbox)
          Sets the mailbox number to send the message to.
 void setRemoveFlag(boolean remove)
          Sets the value of the remove flag
 
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

NXTCommandReceiveMsg

public NXTCommandReceiveMsg()

NXTCommandReceiveMsg

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

Parameters:
Mailbox -
Message - (string)

NXTCommandReceiveMsg

public NXTCommandReceiveMsg(int mailbox,
                            boolean remove)
Represents the MESSAGEREAD Command. The response to this command is a NXTResponseReceiveMsg.

Parameters:
mailbox - Mailbox number on NXT brick to read message from
remove - true indicates that NXT mailbox should be cleared after reading, false indicates otherwise
See Also:
NXTResponseReceiveMsg
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)

getRemoveFlag

public boolean getRemoveFlag()
Returns the current status of the remove flag

Returns:
The remove flag

setRemoveFlag

public void setRemoveFlag(boolean remove)
Sets the value of the remove flag

Parameters:
remove - true or false

getMessageString

public String getMessageString()
Returns actual string message obtained from brick

Returns:
The message


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