Class XBeeHelper
- java.lang.Object
-
- ptolemy.actor.lib.jjs.HelperBase
-
- ptolemy.actor.lib.jjs.VertxHelperBase
-
- ptolemy.actor.lib.jjs.modules.xbee.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)
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class ptolemy.actor.lib.jjs.VertxHelperBase
VertxHelperBase.AccessorVerticle
-
Nested classes/interfaces inherited from class ptolemy.actor.lib.jjs.HelperBase
HelperBase.DATA_TYPE
-
-
Field Summary
-
Fields inherited from class ptolemy.actor.lib.jjs.VertxHelperBase
_verticle, _vertx
-
Fields inherited from class ptolemy.actor.lib.jjs.HelperBase
_actor, _currentObj
-
-
Constructor Summary
Constructors Constructor Description 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)
Create an XBee device.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
Close the port, if it is open.void
dataReceived(com.digi.xbee.api.models.XBeeMessage message)
void
send(java.lang.Object data)
Send data over the radio.static java.lang.String[]
supportedReceiveTypes()
Return an array of the types supported by the current host for receiveType arguments.static java.lang.String[]
supportedSendTypes()
Return an array of the types supported by the current host for sendType arguments.-
Methods inherited from class ptolemy.actor.lib.jjs.VertxHelperBase
_issueOrDeferResponse, _processPendingJob, _setBusy, closeVertx, getHelper, getImageTypes, reset, submit, undeploy
-
Methods inherited from class ptolemy.actor.lib.jjs.HelperBase
_appendNumericToBuffer, _appendToBuffer, _error, _error, _error, _error, _extractFromBuffer, _issueResponse, _removeDuplicates, _sizeOfType, _toJavaBytes, _toJSArray, getHelping
-
-
-
-
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 interfacecom.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.
-
-