Module supporting XBee radios.
The default options for connections over XBee radio.
Return an array of serial port names or null if none are found.
An array of port names.
Return an array of the types supported by the current host for the receiveType option.
Return an array of the types supported by the current host for the sendType option.
(static) XBee(portName, options)
Construct an XBee object, initialize it with the specified options. It is an event emitter that emits the following events:
'data': Emitted when new data arrives on the radio.
The options argument is a JSON object that can include:
receiveType: See below.
- sendType: See below.
- baudRate: The baud rate to communicate with the radio. This defaults to 9600.
When type conversions are needed, e.g. when you send a double with sendType set to int, or an int with sendType set to byte, then a "primitive narrowing conversion" will be applied, as specified here: https://docs.oracle.com/javase/specs/jls/se8/html/jls-5.html#jls-5.1.3 .
For numeric types, you can also send an array with a single call to this.send(). The elements of the array will be sent in sequence all at once, and may be received in one batch. If both ends have rawBytes set to false (specifying message framing), then these elements will be emitted at the receiving end all at once in a single array. Otherwise, they will be emitted one at a time.
For strings, you can also send an array of strings in a single call, but these will be simply be concatenated and received as a single string.
The name of the port to open.
If the port is in use or initializing the port fails.
An XBee interface.