Class XBeeMessage

    • Constructor Detail

      • XBeeMessage

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

        public XBeeMessage​(java.lang.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 Detail

      • 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

        public java.lang.String toMonitorString()
        Returns:
        a human-readable representation of the message.
      • getRemoteDoutMessage

        public static XBeeMessage getRemoteDoutMessage​(java.lang.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​(java.lang.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​(java.lang.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​(java.lang.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.