Class XBeeHelper

  • All Implemented Interfaces:
    com.digi.xbee.api.listeners.IDataReceiveListener

    public class XBeeHelper
    extends VertxHelperBase
    implements com.digi.xbee.api.listeners.IDataReceiveListener
    Helper for XBee radio modules. See the xbee module for documentation.
    Since:
    Ptolemy II 11.0
    Version:
    $Id$
    Author:
    Edward A. Lee
    Pt.AcceptedRating:
    red (cxh)
    Pt.ProposedRating:
    red (cxh)
    • Constructor Detail

      • XBeeHelper

        public XBeeHelper​(java.lang.Object actor,
                          jdk.nashorn.api.scripting.ScriptObjectMirror helping,
                          java.lang.String portName,
                          java.util.Map<java.lang.String,​java.lang.Object> options)
                   throws com.digi.xbee.api.exceptions.XBeeException
        Create an XBee device. The first argument is an instance of the JavaScript XBee object.
        Parameters:
        actor - The actor that this is helping.
        helping - The object that this is helping (XBee).
        portName - The name of the port to open.
        options - Serial port options.
        Throws:
        com.digi.xbee.api.exceptions.XBeeException - If there is no such port, if the port is in use, if there are too many listeners or if we can't get an input or output stream for the port.
    • Method Detail

      • close

        public void close()
        Close the port, if it is open.
      • dataReceived

        public void dataReceived​(com.digi.xbee.api.models.XBeeMessage message)
        Specified by:
        dataReceived in interface com.digi.xbee.api.listeners.IDataReceiveListener
      • send

        public void send​(java.lang.Object data)
        Send data over the radio.
        Parameters:
        data - The data to send.
      • supportedReceiveTypes

        public static java.lang.String[] supportedReceiveTypes()
        Return an array of the types supported by the current host for receiveType arguments.
        Returns:
        an array of the types supported by the current host for receiveType arguments.
      • supportedSendTypes

        public static java.lang.String[] supportedSendTypes()
        Return an array of the types supported by the current host for sendType arguments.
        Returns:
        an array of the types supported by the current host for sendType arguments.