Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/entrylabs/entry-hw
Browse files Browse the repository at this point in the history
  • Loading branch information
kimorkim committed Dec 2, 2016
2 parents d819ab7 + 35d5024 commit 8a67e12
Show file tree
Hide file tree
Showing 11 changed files with 447 additions and 16 deletions.
4 changes: 2 additions & 2 deletions app/custom_modules/flasher/flasher.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ var Module = {
if(__dirname.indexOf('app.asar') >= 0) {
var asarPath = __dirname;
copyRecursiveSync(asarPath, path.join(__dirname, '..', '..', '..', 'flasher'));
appPath = 'resources';
appPath = path.join(__dirname, '..', '..', '..');
} else {
appPath = path.join(__dirname, '..');
}
Expand All @@ -42,7 +42,7 @@ var Module = {
exec(
cmd,
{
cwd: path.join('.', appPath, 'flasher')
cwd: path.resolve(appPath, 'flasher')
},
callBack
);
Expand Down
18 changes: 6 additions & 12 deletions app/custom_modules/router/scanner/serial.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,8 @@ Scanner.prototype.scan = function(serialport, extension, config, callback) {
if(devices.some(function(device) {
var isVendor = false;
if(Array.isArray(vendor)) {
vendor.forEach(function (v) {
if(device.manufacturer.indexOf(v) >= 0) {
isVendor = true;
}
isVendor = vendor.some(function (v) {
return device.manufacturer && device.manufacturer.indexOf(v) >= 0;
});
} else {
if(device.manufacturer.indexOf(vendor) >= 0) {
Expand All @@ -84,15 +82,11 @@ Scanner.prototype.scan = function(serialport, extension, config, callback) {
var isVendor = false;

if(Array.isArray(vendor)) {
vendor.forEach(function (v) {
if(device.manufacturer.indexOf(v) >= 0) {
isVendor = true;
}
isVendor = vendor.some(function (v) {
return device.manufacturer && device.manufacturer.indexOf(v) >= 0;
});
} else {
if(device.manufacturer.indexOf(vendor) >= 0) {
isVendor = true;
}
} else if(vendor && device.manufacturer && device.manufacturer.indexOf(vendor) >= 0) {
isVendor = true;
}

if(!vendor || (device.manufacturer && isVendor) || (device.pnpId && device.pnpId.indexOf(pnpId) >= 0) || checkComPort) {
Expand Down
Binary file not shown.
6 changes: 6 additions & 0 deletions app/modules/robotis_carCont.js
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,12 @@ Module.prototype.handleRemoteData = function(handler) {
if (this.addressToRead[address] == undefined || this.addressToRead[address] == 0) {
this.addressToRead[address] = 1;
this.robotisBuffer.push(data[index]);
} else {
// 10번 이상 읽지 못한다면 에러이므로 강제로 읽을 수 있도록 처리
this.addressToRead[address] += 1;
if (this.addressToRead[address] >= 10) {
this.addressToRead[address] = 0;
}
}
}
}
Expand Down
6 changes: 6 additions & 0 deletions app/modules/robotis_openCM70.js
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,12 @@ Module.prototype.handleRemoteData = function(handler) {
if (this.addressToRead[address] == undefined || this.addressToRead[address] == 0) {
this.addressToRead[address] = 1;
this.robotisBuffer.push(data[index]);
} else {
// 10번 이상 읽지 못한다면 에러이므로 강제로 읽을 수 있도록 처리
this.addressToRead[address] += 1;
if (this.addressToRead[address] >= 10) {
this.addressToRead[address] = 0;
}
}
}
}
Expand Down
6 changes: 6 additions & 0 deletions app/modules/robotis_openCM70BT.js
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,12 @@ Module.prototype.handleRemoteData = function(handler) {
if (this.addressToRead[address] == undefined || this.addressToRead[address] == 0) {
this.addressToRead[address] = 1;
this.robotisBuffer.push(data[index]);
} else {
// 10번 이상 읽지 못한다면 에러이므로 강제로 읽을 수 있도록 처리
this.addressToRead[address] += 1;
if (this.addressToRead[address] >= 10) {
this.addressToRead[address] = 0;
}
}
}
}
Expand Down
Loading

0 comments on commit 8a67e12

Please sign in to comment.