serialportlist
5 min
The serialportlist object exposes the available serial ports on a BrightSign player.
serialportlist IDL
interface SerialPortList {
Promise<array> getList();
};Object Creation
To create a serialportlist object, first load the brightsign/serialportlist module using the Require() method. Then create an instance of the serialportlist class.
var SerialPortListClass = require("@brightsign/serialportlist");
var serialPortList = new SerialPortListClass();serialPortList
Use this interface to get a list of the available serial ports (an array of serial port objects).
getlist()
Promise<array> getList()The following table is an example of what getList() might return:
[{"fid":"UART:0","path":"/dev/ttyS0"},
{"fid":"UART:1","path":"/dev/ttyS1"},
{"fid":"USB:B/2.0","path":"/dev/ttyUSB0","pid":24577,"vid":1027},
{"fid":"USB:B/4.0","path":"/dev/ttyUSB1","pid":24577,"vid":1027}]- fid: The friendly ID that indicates the physical location on the player of a port
- vid, pid: The vendor and product ID (for USB devices only)
- path: The native path suitable for passing to the SerialPort constructor
The roDeviceInfo GetUSBTopology() method contains information about USB devices (though fids used in that method don't contain USB: prefix), and details about the interpretation of the fid field.
This is the standard port enumeration of serial devices:
- To communicate with the serial port of an OPS display (for example, with the HO523), use port 1.
Example
Refer to the node-serialport documentation for examples.