bs2-programmer
Advanced tools
Comparing version 2.0.0 to 2.1.0
@@ -27,6 +27,3 @@ /*eslint-disable no-process-exit */ | ||
// maybe this could be a `search` method on programmer???? | ||
return protocol.enterProgramming() | ||
.then(function(){ | ||
return bs2.identify(bs2Options); | ||
}) | ||
return bs2.identify(bs2Options) | ||
.then(function(content){ | ||
@@ -37,5 +34,2 @@ return { value: content, done: true }; | ||
return { value: null, seed: idx + 1 }; | ||
}) | ||
.finally(function(){ | ||
return protocol.exitProgramming(); | ||
}); | ||
@@ -42,0 +36,0 @@ }, 0); |
@@ -58,3 +58,3 @@ 'use strict'; | ||
//have to call enterprogramming before and exitprogramming after this function | ||
Programmer.prototype.identify = function(cb){ | ||
Programmer.prototype._identifyBoard = function(cb){ | ||
var revision = this._revision; | ||
@@ -73,2 +73,18 @@ var protocol = this._protocol; | ||
Programmer.prototype.identify = function(cb){ | ||
var self = this; | ||
var protocol = this._protocol; | ||
var promise = protocol.enterProgramming() | ||
.then(function(){ | ||
return self._identifyBoard(); | ||
}) | ||
.then(function(board){ | ||
return protocol.exitProgramming().yield(board); | ||
}); | ||
return nodefn.bindCallback(promise, cb); | ||
}; | ||
Programmer.prototype.bootload = function(hex, cb){ | ||
@@ -109,3 +125,3 @@ var self = this; | ||
.then(function(){ | ||
return self.identify(); | ||
return self._identifyBoard(); | ||
}) | ||
@@ -112,0 +128,0 @@ .then(upload) |
{ | ||
"name": "bs2-programmer", | ||
"version": "2.0.0", | ||
"version": "2.1.0", | ||
"description": "Upload tokenized hex to Basic Stamp 2", | ||
@@ -23,6 +23,6 @@ "main": "index.js", | ||
"type": "git", | ||
"url": "https://github.com/jacobrosenthal/bs2-programmer" | ||
"url": "https://github.com/irkenjs/bs2-programmer" | ||
}, | ||
"bugs": { | ||
"url": "https://github.com/jacobrosenthal/bs2-programmer/issues" | ||
"url": "https://github.com/irkenjs/bs2-programmer/issues" | ||
}, | ||
@@ -29,0 +29,0 @@ "author": "Jacob Rosenthal", |
@@ -1,4 +0,4 @@ | ||
#bs2 | ||
#bs2-programmer | ||
[![Build Status](https://travis-ci.org/jacobrosenthal/bs2-programmer.svg)](https://travis-ci.org/jacobrosenthal/bs2-programmer) | ||
[![Build Status](https://travis-ci.org/irkenjs/bs2-programmer.svg)](https://travis-ci.org/irkenjs/bs2-programmer) | ||
@@ -48,4 +48,4 @@ Upload tokenized hex to Basic Stamp 2. | ||
* Called for you by bootload, but exposed for your convenience. | ||
* Called for you by bootload, but exposed for your convenience. | ||
* Takes a previously opened, reset stream-style object (See the example for details) and a Node buffer of tokenized bytes to send. | ||
* Callback has singature (error, object) where object is a version object like { name: 'BS2', version: '1.0' } |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
29396
733
0