Allow 0 size control messages
git-svn-id: https://svn.code.sf.net/p/libusbjava/code/trunk@264 94ad28fe-ef68-46b1-9651-e7ae4fcf1c4c
This commit is contained in:
@@ -514,7 +514,8 @@ public class Device {
|
|||||||
* @param data
|
* @param data
|
||||||
* the send/receive buffer
|
* the send/receive buffer
|
||||||
* @param size
|
* @param size
|
||||||
* the buffer size
|
* the buffer size. 0 is a valid value, but there must still be a
|
||||||
|
* dummy data buffer provided.
|
||||||
* @param timeout
|
* @param timeout
|
||||||
* amount of time in ms the device will try to send/receive data
|
* amount of time in ms the device will try to send/receive data
|
||||||
* until a timeout exception is thrown
|
* until a timeout exception is thrown
|
||||||
@@ -534,7 +535,7 @@ public class Device {
|
|||||||
if (data == null) {
|
if (data == null) {
|
||||||
throw new USBException("data must not be null");
|
throw new USBException("data must not be null");
|
||||||
}
|
}
|
||||||
if (size <= 0 || size > data.length) {
|
if (size < 0 || size > data.length) {
|
||||||
throw new ArrayIndexOutOfBoundsException("invalid size: " + size);
|
throw new ArrayIndexOutOfBoundsException("invalid size: " + size);
|
||||||
}
|
}
|
||||||
int len = LibusbJava.usb_control_msg(usbDevHandle, requestType,
|
int len = LibusbJava.usb_control_msg(usbDevHandle, requestType,
|
||||||
|
|||||||
@@ -304,6 +304,7 @@ public class DeviceTest {
|
|||||||
dev.close();
|
dev.close();
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
closeOnException();
|
closeOnException();
|
||||||
|
throw e;
|
||||||
} catch (AssertionError e) {
|
} catch (AssertionError e) {
|
||||||
closeOnException();
|
closeOnException();
|
||||||
throw e;
|
throw e;
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
#Thu Aug 24 14:28:28 CEST 2006
|
#Thu Aug 24 14:28:28 CEST 2006
|
||||||
version.major=0
|
version.major=0
|
||||||
version.minor=5
|
version.minor=5
|
||||||
version.release=5
|
version.release=6
|
||||||
|
|||||||
Reference in New Issue
Block a user