Class XBeeMessage

All Implemented Interfaces:
Message
Direct Known Subclasses:
XBeeBroadcastMessage

public class XBeeMessage extends IEEE802154Message
This is a wrapper class for a Digi XBeeAPIPacket.
  • Constructor Details

    • XBeeMessage

      protected XBeeMessage()
      Suppress the default ctor, as the length must always be specified
    • XBeeMessage

      public XBeeMessage(int l)
    • XBeeMessage

      public XBeeMessage(String m, int l)
      This ctor interprets the String as the exact sequence to send, byte-for-byte.
      Parameters:
      m - message
      l - length
    • XBeeMessage

      public XBeeMessage(byte[] a, int l)
      This ctor interprets the byte array as a sequence of characters to send.
      Parameters:
      a - Array of bytes to send
      l - length
    • XBeeMessage

      public XBeeMessage(com.digi.xbee.api.packet.XBeeAPIPacket request)
      This ctor interprets the parameter as an XBeeAPIPacket message. This is the message form that will generally be used by the implementation.
      Parameters:
      request - an XBeeAPIPacket of bytes to send
  • Method Details

    • replyExpected

      public boolean replyExpected()
      Description copied from class: AbstractMRMessage
      Is a reply expected to this message?

      By default, a reply is expected to every message; either a reply or a timeout is needed before the next message can be sent.

      If this returns false, the transmit queue will immediately go on to transmit the next message (if any).

      Overrides:
      replyExpected in class AbstractMRMessage
      Returns:
      true by default in Abstract MR message.
    • getXBeeRequest

      public com.digi.xbee.api.packet.XBeeAPIPacket getXBeeRequest()
    • setXBeeRequest

      public void setXBeeRequest(com.digi.xbee.api.packet.XBeeAPIPacket request)
    • toMonitorString

      Returns:
      a human-readable representation of the message.
    • toString

      public String toString()
      Description copied from interface: Message
      Specified by:
      toString in interface Message
      Overrides:
      toString in class AbstractMRMessage
    • checkParity

      public boolean checkParity()
      check whether the message has a valid parity
      Overrides:
      checkParity in class IEEE802154Message
      Returns:
      true if parity is valid
    • setParity

      public void setParity()
      Overrides:
      setParity in class IEEE802154Message
    • getHardwareVersionRequest

    • getFirmwareVersionRequest

    • getRemoteDoutMessage

      public static XBeeMessage getRemoteDoutMessage(Object address, int pin, boolean on)
      Get an XBee Message requesting a digital output pin be turned on or off.
      Parameters:
      address - XBee Address of the node. This can be either 16 bit or 64 bit.
      pin - the DIO Pin on the XBee to use.
      on - boolean value stating whether the pin should be turned on (true) or off (false)
      Returns:
      XBeeMessage with a message requesting a digital IO pin be turned on or off.
    • getRemoteDoutMessage

      public static XBeeMessage getRemoteDoutMessage(Object address, int pin)
      Get an XBee Message requesting the status of a digital IO pin.
      Parameters:
      address - XBee Address of the node. This can be either 16 bit or 64 bit.
      pin - the DIO Pin on the XBee to use.
      Returns:
      XBeeMessage with a digital IO pin status request.
    • getForceSampleMessage

      public static XBeeMessage getForceSampleMessage(Object address)
      Get an XBee Message requesting an IO sample from the node.
      Parameters:
      address - XBee Address of the node. This can be either
      Returns:
      XBeeMessage with a force IO sample request. 16 bit or 64 bit.
    • getRemoteTransmissionRequest

      public static XBeeMessage getRemoteTransmissionRequest(Object address, byte[] payload)
      Get an XBee Message requesting data be sent to the serial port on a remote node.
      Parameters:
      address - XBee Address of the node. This can be either 16 bit or 64 bit.
      payload - An byte array containing the bytes to be transfered, as the low order word of the integer.
      Returns:
      XBeeMessage with remote transmission request for the provided address containing the provided payload.
    • getRemoteTransmissionRequest

      public static XBeeMessage getRemoteTransmissionRequest(com.digi.xbee.api.models.XBee16BitAddress address, byte[] payload)
      Get an XBee Message requesting data be sent to the serial port on a remote node.
      Parameters:
      address - XBee16BitAddress of the node.
      payload - A byte array containing the bytes to be transfered, as the low order word of the integer.
      Returns:
      XBeeMessage with remote transmission request for the provided address containing the provided payload.
    • getRemoteTransmissionRequest

      public static XBeeMessage getRemoteTransmissionRequest(com.digi.xbee.api.models.XBee64BitAddress address, byte[] payload)
      Get an XBee Message requesting data be sent to the serial port on a remote node.
      Parameters:
      address - XBee64BitAddress of the node.
      payload - A byte array containing the bytes to be transfered, as the low order word of the integer.
      Returns:
      XBeeMessage with remote transmission request for the provided address containing the provided payload.