Socket
Socket
Sign inDemoInstall

bs2-programmer

Package Overview
Dependencies
Maintainers
2
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

bs2-programmer - npm Package Compare versions

Comparing version 2.1.0 to 2.2.0

14

lib/programmer.js

@@ -5,7 +5,11 @@ 'use strict';

var util = require('util');
var most = require('most');
var when = require('when');
var nodefn = require('when/node');
var EventEmitter = require('events').EventEmitter;
function Programmer(options){
EventEmitter.call(this);
var opts = options || {};

@@ -24,2 +28,4 @@

util.inherits(Programmer, EventEmitter);
// Static method

@@ -42,3 +48,3 @@ Programmer.revisions = revisions;

return protocol.send(revision.challenge.slice(index, index + 1))
.timeout(1000)
.timeout(200)
.then(function(response){

@@ -69,3 +75,3 @@ if(response !== revision.response[index]){

})
.timeout(1000, new Error(revision.name + ' did not respond. Check power, connection, or maybe this is not a ' + revision.name))
.timeout(200, new Error(revision.name + ' did not respond. Check power, connection, or maybe this is not a ' + revision.name))
.then(revision.lookup);

@@ -104,2 +110,4 @@

function predicate(index) {
var progress = Math.round((index / (hex.length + 1)) * 100) + 1;
self.emit('bootloadProgress', progress);
return index < hex.length;

@@ -132,3 +140,3 @@ }

.then(function(){
return protocol.exitProgramming();
return protocol.exitProgramming({ keepOpen: true });
});

@@ -135,0 +143,0 @@

@@ -16,3 +16,7 @@ 'use strict';

Protocol.prototype.enterProgramming = function(cb){
Protocol.prototype.enterProgramming = function(opts, cb){
if(typeof opts === 'function'){
cb = opts;
opts = {};
}
var promise = when.resolve();

@@ -23,3 +27,7 @@

Protocol.prototype.exitProgramming = function(cb){
Protocol.prototype.exitProgramming = function(opts, cb){
if(typeof opts === 'function'){
cb = opts;
opts = {};
}
var promise = when.resolve();

@@ -26,0 +34,0 @@

{
"name": "bs2-programmer",
"version": "2.1.0",
"version": "2.2.0",
"description": "Upload tokenized hex to Basic Stamp 2",

@@ -14,3 +14,3 @@ "main": "index.js",

"devDependencies": {
"bs2-serial-protocol": "^0.1.2",
"bs2-serial-protocol": "^0.3.0",
"code": "^1.3.0",

@@ -17,0 +17,0 @@ "lab": "^5.2.1"

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc