From f1c6f7985ffc7964b6b5f305bd4352c092fa5cb2 Mon Sep 17 00:00:00 2001 From: Dmitry Isaenko Date: Mon, 11 Feb 2019 21:35:43 +0300 Subject: [PATCH] v0.1 --- src/main/java/nsusbloader/NSLMain.java | 2 +- src/main/java/nsusbloader/UsbCommunications.java | 12 +++++++----- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/src/main/java/nsusbloader/NSLMain.java b/src/main/java/nsusbloader/NSLMain.java index 9f36aab..d34fd56 100644 --- a/src/main/java/nsusbloader/NSLMain.java +++ b/src/main/java/nsusbloader/NSLMain.java @@ -19,7 +19,7 @@ import java.util.Locale; import java.util.ResourceBundle; public class NSLMain extends Application { - static final String appVersion = "v0.1-DEVELOPMENT"; + static final String appVersion = "v0.1"; @Override public void start(Stage primaryStage) throws Exception{ ResourceBundle rb; diff --git a/src/main/java/nsusbloader/UsbCommunications.java b/src/main/java/nsusbloader/UsbCommunications.java index 84bd451..657e10a 100644 --- a/src/main/java/nsusbloader/UsbCommunications.java +++ b/src/main/java/nsusbloader/UsbCommunications.java @@ -433,8 +433,8 @@ class UsbCommunications extends Task { return true; if ((currentOffset + readPice) >= receivedRangeSize ) readPice = Math.toIntExact(receivedRangeSize - currentOffset); - System.out.println("CO: "+currentOffset+"\t\tEO: "+receivedRangeSize+"\t\tRP: "+readPice); // TODO: -----------------------DEBUG----------------- - // updating progress bar if needed START + //System.out.println("CO: "+currentOffset+"\t\tEO: "+receivedRangeSize+"\t\tRP: "+readPice); // TODO: NOTE: -----------------------DEBUG----------------- + // updating progress bar (if a lot of data requested) START BLOCK if (isProgessBarInitiated){ try { if (currentOffset+readPice == receivedRangeOffset){ @@ -451,7 +451,7 @@ class UsbCommunications extends Task { if ((readPice == 8388608) && (currentOffset == 0)) isProgessBarInitiated = true; } - // updating progress bar if needed END + // updating progress bar if needed END BLOCK bufferCurrent = new byte[readPice]; // TODO: not perfect moment, consider refactoring. @@ -587,12 +587,12 @@ class UsbCommunications extends Task { printLog("Execution stopped", MsgType.FAIL); return null; } else { - // DEBUG START---------------------------------------------------------------------------------------------- int trans = readBufTransferred.get(); byte[] receivedBytes = new byte[trans]; readBuffer.get(receivedBytes); + /* DEBUG START---------------------------------------------------------------------------------------------- hexDumpUTF8(receivedBytes); - // DEBUG END------------------------------------------------------------------------------------------------ + // DEBUG END----------------------------------------------------------------------------------------------*/ return receivedBytes; } } @@ -625,6 +625,7 @@ class UsbCommunications extends Task { /** * Debug tool like hexdump <3 */ + /* private void hexDumpUTF8(byte[] byteArray){ for (int i=0; i < byteArray.length; i++) System.out.print(String.format("%02d-", i%10)); @@ -635,4 +636,5 @@ class UsbCommunications extends Task { + new String(byteArray, StandardCharsets.UTF_8) + "\n"); } + */ }