Player APIs (BrightScript & Ja...
JavaScript APIs
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 docid\ utkdmpos1ulxaoylx1ns6 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 most standard serial devices (including the usb serial port on the ls424 hardware interfaces docid\ pfx3zfroowim0gpelvl68 ) enumerate on port 0 to communicate with the serial port of an ops display (for example, with the ho523), use port 1 example refer to the node serialport https //serialport io/docs/guide usage documentation for examples