Added Error codes
git-svn-id: https://svn.code.sf.net/p/libusbjava/code/trunk@307 94ad28fe-ef68-46b1-9651-e7ae4fcf1c4c
This commit is contained in:
@@ -20,6 +20,9 @@ public class LibusbError extends Exception {
|
|||||||
public static final int ERROR_NO_MEM = -11;
|
public static final int ERROR_NO_MEM = -11;
|
||||||
public static final int ERROR_NOT_SUPPORTED = -12;
|
public static final int ERROR_NOT_SUPPORTED = -12;
|
||||||
public static final int ERROR_OTHER = -99;
|
public static final int ERROR_OTHER = -99;
|
||||||
|
public static final int ERROR_JAVA_REFERENCES_NOT_LOADED = -100;
|
||||||
|
public static final int ERROR_JAVA_WRONG_ENVIRONMENT = -101;
|
||||||
|
public static final int ERROR_JAVA_ILEGAL_DEVICE_HANDLE = -102;
|
||||||
|
|
||||||
private int code = ERROR_NONE;
|
private int code = ERROR_NONE;
|
||||||
|
|
||||||
@@ -113,6 +116,24 @@ public class LibusbError extends Exception {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
case ERROR_JAVA_REFERENCES_NOT_LOADED:
|
||||||
|
{
|
||||||
|
result = "ERROR_JAVA_REFERENCES_NOT_LOADED";
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
case ERROR_JAVA_WRONG_ENVIRONMENT:
|
||||||
|
{
|
||||||
|
result = "ERROR_JAVA_WRONG_ENVIRONMENT";
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
case ERROR_JAVA_ILEGAL_DEVICE_HANDLE:
|
||||||
|
{
|
||||||
|
result = "ERROR_JAVA_ILEGAL_DEVICE_HANDLE";
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
default:
|
default:
|
||||||
{
|
{
|
||||||
result = "ERROR_UNKNWON (" + code + ")";
|
result = "ERROR_UNKNWON (" + code + ")";
|
||||||
|
|||||||
@@ -31,7 +31,10 @@ public class LibusbErrorTest {
|
|||||||
{"ERROR_NOT_SUPPORTED", -12},
|
{"ERROR_NOT_SUPPORTED", -12},
|
||||||
{"ERROR_UNKNWON (-13)", -13},
|
{"ERROR_UNKNWON (-13)", -13},
|
||||||
{"ERROR_UNKNWON (-98)", -98},
|
{"ERROR_UNKNWON (-98)", -98},
|
||||||
{"ERROR_UNKNWON (-100)", -100},
|
{"ERROR_JAVA_REFERENCES_NOT_LOADED", -100},
|
||||||
|
{"ERROR_JAVA_WRONG_ENVIRONMENT", -101},
|
||||||
|
{"ERROR_JAVA_ILEGAL_DEVICE_HANDLE", -102},
|
||||||
|
{"ERROR_UNKNWON (-103)", -103},
|
||||||
{"ERROR_OTHER", -99} });
|
{"ERROR_OTHER", -99} });
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user