serialport.js 616 B

123456789101112131415161718
  1. "use strict";
  2. Object.defineProperty(exports, "__esModule", { value: true });
  3. exports.SerialPort = void 0;
  4. const stream_1 = require("@serialport/stream");
  5. const bindings_cpp_1 = require("@serialport/bindings-cpp");
  6. const DetectedBinding = (0, bindings_cpp_1.autoDetect)();
  7. class SerialPort extends stream_1.SerialPortStream {
  8. static list = DetectedBinding.list;
  9. static binding = DetectedBinding;
  10. constructor(options, openCallback) {
  11. const opts = {
  12. binding: DetectedBinding,
  13. ...options,
  14. };
  15. super(opts, openCallback);
  16. }
  17. }
  18. exports.SerialPort = SerialPort;