Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update SerialPort to v10, fixing several breaking changes. I need a hand with tests. #255

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions avrgirl-arduino.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ var injectDependencies = function(boards, Connection, protocols) {
var EventEmitter = require('events');
var util = require('util');
var tools = require('./lib/tools');

/**
* Constructor
*
Expand Down
7 changes: 4 additions & 3 deletions lib/connection.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
var Serialport = require('serialport');
var { SerialPort } = require('serialport');
var awty = require('awty');

var Connection = function(options) {
Expand Down Expand Up @@ -46,7 +46,8 @@ Connection.prototype._init = function(callback) {
* Create new serialport instance for the Arduino board, but do not immediately connect.
*/
Connection.prototype._setUpSerial = function(callback) {
this.serialPort = new Serialport(this.options.port, {
this.serialPort = new SerialPort({
path: this.options.port,
baudRate: this.board.baud,
autoOpen: false
});
Expand Down Expand Up @@ -172,7 +173,7 @@ Connection.prototype._listPorts = function(callback) {
var foundPorts = [];

// list all available ports
Serialport.list().then(function(ports) {
SerialPort.list().then(function(ports) {
// iterate through ports
for (var i = 0; i < ports.length; i += 1) {
var pid;
Expand Down
Loading