Module supporting serial port access. This module provides a dummy loopback serial port that can send data to itself. This is useful for regression tests. Currently, it ignores the baud rate.
- Version:
- $$Id$$
- Source:
Methods
(static) hostSerialPorts(callback)
Get an array of serial port names and invoke the specified callback with an argument that is that array.
Parameters:
Name | Type | Description |
---|---|---|
callback |
The function to invoke with the port names |
(static) SerialPort(portName, ownerName, timeout, options)
Construct a serial port 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 serial port.
Parameters:
Name | Type | Description |
---|---|---|
portName |
The name of the port to open. |
|
ownerName |
The name of the owner assigned to this port, if opening is successful. |
|
timeout |
Time in milliseconds before failing. |
|
options |
Serial port options (FIXME: define). |
Throws:
If the port is in use or initializing the port fails.
Returns:
A serial port interface.
(static) supportedReceiveTypes()
Return an array of the types supported by the current host for the receiveType option.
(static) supportedSendTypes()
Return an array of the types supported by the current host for the sendType option.