ソースを参照

Bumps serial-port to 4.0.0 and updates to match new API

craigsdennis 9 年 前
コミット
9a91512ee0
2 ファイル変更5 行追加4 行削除
  1. 3 2
      back-end/rom_comm.js
  2. 2 2
      package.json

+ 3 - 2
back-end/rom_comm.js

@@ -2,7 +2,7 @@
 
 
 const EventEmitter = require("events");
 const EventEmitter = require("events");
 const fs = require("fs");
 const fs = require("fs");
-const SerialPort = require("serialport").SerialPort;
+const SerialPort = require("serialport");
 const log = require("./logger");
 const log = require("./logger");
 const slip = require("./streams/slip");
 const slip = require("./streams/slip");
 const boards = require("./boards");
 const boards = require("./boards");
@@ -59,6 +59,7 @@ class RomComm extends EventEmitter {
     constructor(config) {
     constructor(config) {
         super();
         super();
         this._port = new SerialPort(config.portName, {
         this._port = new SerialPort(config.portName, {
+            autoOpen: false,
             baudRate: config.baudRate,
             baudRate: config.baudRate,
             parity: 'none',
             parity: 'none',
             stopBits: 1,
             stopBits: 1,
@@ -66,7 +67,7 @@ class RomComm extends EventEmitter {
             xoff: false,
             xoff: false,
             rtscts: false,
             rtscts: false,
             dsrdtr: false
             dsrdtr: false
-        }, false);
+        });
         this.bindPort();
         this.bindPort();
         this.resetState();
         this.resetState();
         var boardName = config.boardName ? config.boardName : "Esp12";
         var boardName = config.boardName ? config.boardName : "Esp12";

+ 2 - 2
package.json

@@ -4,7 +4,7 @@
   "description": "A GUI tool for flashing the JavaScript runtimes and other firmware on to ESP8266 based microcontrollers and development boards",
   "description": "A GUI tool for flashing the JavaScript runtimes and other firmware on to ESP8266 based microcontrollers and development boards",
   "main": "index.js",
   "main": "index.js",
   "scripts": {
   "scripts": {
-    "start": "electron .", 
+    "start": "electron .",
     "test": "mocha",
     "test": "mocha",
 
 
     "pre-rebuild": "node ./scripts/pre-rebuild.js",
     "pre-rebuild": "node ./scripts/pre-rebuild.js",
@@ -55,7 +55,7 @@
     "electron-squirrel-startup": "^1.0.0",
     "electron-squirrel-startup": "^1.0.0",
     "node-binary": "^1.1.0",
     "node-binary": "^1.1.0",
     "request": "^2.72.0",
     "request": "^2.72.0",
-    "serialport": "^2.0.7-beta1"
+    "serialport": "4.0.0"
   },
   },
   "devDependencies": {
   "devDependencies": {
     "chai": "^3.5.0",
     "chai": "^3.5.0",