diff --git a/js/serial.js b/js/serial.js index b8da9353e4..f2d790f452 100644 --- a/js/serial.js +++ b/js/serial.js @@ -42,6 +42,8 @@ var serial = { console.log('SERIAL: Failed to close connection with ID: ' + self.connectionId + ' closed'); } + console.log('SERIAL: Statistics - Sent: ' + self.bytes_sent + ' bytes, Received: ' + self.bytes_received + ' bytes'); + self.connectionId = -1; callback(result); diff --git a/js/stm32.js b/js/stm32.js index 7b95b8b016..c0ab344e7c 100644 --- a/js/stm32.js +++ b/js/stm32.js @@ -40,10 +40,6 @@ var STM32_protocol = function() { }; // Erase (x043) and Extended Erase (0x44) are exclusive. A device may support either the Erase command or the Extended Erase command but not both. - - // debug variables - this.serial_bytes_send; - this.serial_bytes_received; }; // string = string .. duh @@ -136,9 +132,6 @@ STM32_protocol.prototype.initialize = function() { self.verify_hex = []; - self.serial_bytes_send = 0; - self.serial_bytes_received = 0; - self.upload_time_start = microtime(); self.steps_executed = 0; @@ -183,8 +176,6 @@ STM32_protocol.prototype.read = function(readInfo) { self.receive_buffer.push(data[i]); } - self.serial_bytes_received += data.length; - // routine that fetches data from buffer if statement is true if (self.receive_buffer.length >= self.bytes_to_read && self.bytes_to_read != 0) { var data = self.receive_buffer.slice(0, self.bytes_to_read); // bytes requested @@ -220,11 +211,7 @@ STM32_protocol.prototype.send = function(Array, bytes_to_read, callback) { this.read_callback = callback; // send over the actual data - serial.send(bufferOut, function(writeInfo) { - if (writeInfo.bytesSent > 0) { - self.serial_bytes_send += writeInfo.bytesSent; - } - }); + serial.send(bufferOut, function(writeInfo) {}); }; // val = single byte to be verified @@ -568,10 +555,8 @@ STM32_protocol.prototype.upload_procedure = function(step) { break; case 99: // disconnect - GUI.interval_remove('STM32_timeout'); // stop STM32 timeout timer (everything is finished now) - console.log('Transfered: ' + self.serial_bytes_send + ' bytes, Received: ' + self.serial_bytes_received + ' bytes'); console.log('Script finished after: ' + (microtime() - self.upload_time_start).toFixed(4) + ' seconds, ' + self.steps_executed + ' steps'); // close connection