Skip to content

Commit

Permalink
펌웨어 업로드 개선
Browse files Browse the repository at this point in the history
  • Loading branch information
kimorkim committed Nov 16, 2016
1 parent c169594 commit 9e99b7d
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 9 deletions.
12 changes: 7 additions & 5 deletions app/modules/arduinoExt.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,11 +85,13 @@ Module.prototype.requestInitialData = function() {
};

Module.prototype.checkInitialData = function(data, config) {
var datas = this.getDataByBuffer(data);
var isValidData = datas.some(function (data) {
return (data.length > 4 && data[0] === 255 && data[1] === 85);
});
return isValidData;
return true;
// 이후에 체크 로직 개선되면 처리
// var datas = this.getDataByBuffer(data);
// var isValidData = datas.some(function (data) {
// return (data.length > 4 && data[0] === 255 && data[1] === 85);
// });
// return isValidData;
};

Module.prototype.afterConnect = function(that, cb) {
Expand Down
10 changes: 6 additions & 4 deletions app/src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -250,15 +250,17 @@
}
});
},
flashFirmware: function(firmware, config) {
flashFirmware: function(firmware, config, prevPort) {
try{
if (!router.connector) {
if (!router.connector || (!router.connector.sp && !prevPort)) {
alert(translator.translate('Hardware Device Is Not Connected'));
ui.showConnecting();
$('#firmwareButtonSet').show();
return;
}
$('#firmwareButtonSet').hide();
ui.showAlert(translator.translate("Firmware Uploading..."));
var port = router.connector.sp.path;
var port = prevPort || router.connector.sp.path;
var baudRate = config.firmwareBaudRate;
router.close();
setTimeout(function () {
Expand All @@ -269,7 +271,7 @@
function(error, stdout, stderr) {
if(error) {
setTimeout(function () {
ui.flashFirmware(firmware, config);
ui.flashFirmware(firmware, config, port);
}, 100);
} else {
$('#firmwareButtonSet').show();
Expand Down

0 comments on commit 9e99b7d

Please sign in to comment.