development release with debug tails

master
Dmitry Isaenko 2019-03-13 06:54:37 +03:00
parent 387f3d0835
commit d1b3067575
4 changed files with 31 additions and 3 deletions

View File

@ -8,7 +8,7 @@
<name>NS-USBloader</name>
<artifactId>ns-usbloader</artifactId>
<version>0.2.2-SNAPSHOT</version>
<version>0.2.3_DEVELOPMENT-SNAPSHOT</version>
<url>https://github.com/developersu/ns-usbloader/</url>
<description>

View File

@ -12,7 +12,7 @@ import java.util.Locale;
import java.util.ResourceBundle;
public class NSLMain extends Application {
public static final String appVersion = "v0.2.2";
public static final String appVersion = "v0.2.3_DEVELOPMENT";
@Override
public void start(Stage primaryStage) throws Exception{

View File

@ -228,7 +228,15 @@ public class UsbCommunications extends Task<Void> {
}
else
printLog("libusb doesn't supports function 'CAP_SUPPORTS_DETACH_KERNEL_DRIVER'. Proceeding.", EMsgType.WARNING);
// Reset device
result = LibUsb.resetDevice(handlerNS);
if (result == 0)
printLog("Reset device", EMsgType.PASS);
else {
printLog("Reset device returned: " + result, EMsgType.FAIL);
close();
return null;
}
// Set configuration (soft reset if needed)
result = LibUsb.setConfiguration(handlerNS, 1); // 1 - configuration all we need
if (result != LibUsb.SUCCESS){
@ -256,7 +264,27 @@ public class UsbCommunications extends Task<Void> {
printLog("Set active configuration to device.", EMsgType.PASS);
}
////////////////////////////////////////// DEBUG INFORMATION START ///////////////////////////////////////////
//
ConfigDescriptor configDescriptor = new ConfigDescriptor();
//result = LibUsb.getConfigDescriptor(deviceNS, (byte)0x01, configDescriptor);
result = LibUsb.getActiveConfigDescriptor(deviceNS, configDescriptor);
switch (result){
case 0:
printLog("DBG: getActiveConfigDescriptor\n"+configDescriptor.dump(), EMsgType.PASS);
break;
case LibUsb.ERROR_NOT_FOUND:
printLog("DBG: getActiveConfigDescriptor: ERROR_NOT_FOUND", EMsgType.FAIL);
break;
default:
printLog("DBG: getActiveConfigDescriptor: "+result, EMsgType.FAIL);
break;
}
LibUsb.freeConfigDescriptor(configDescriptor);
//*/
////////////////////////////////////////// DEBUG INFORMATION END //////////////////////////////////////////////
// Claim interface
result = LibUsb.claimInterface(handlerNS, DEFAULT_INTERFACE);
if (result != LibUsb.SUCCESS) {

Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB

After

Width:  |  Height:  |  Size: 15 KiB