- interrupt read fixed
git-svn-id: https://svn.code.sf.net/p/libusbjava/code/trunk@191 94ad28fe-ef68-46b1-9651-e7ae4fcf1c4c
This commit is contained in:
@@ -705,7 +705,7 @@ JNIEXPORT jint JNICALL Java_ch_ntb_usb_LibusbWin_usb_1interrupt_1read
|
|||||||
(JNIEnv *env, jclass obj, jint dev_handle, jint ep, jbyteArray jbytes, jint size, jint timeout)
|
(JNIEnv *env, jclass obj, jint dev_handle, jint ep, jbyteArray jbytes, jint size, jint timeout)
|
||||||
{
|
{
|
||||||
char *bytes = (char *) malloc(size * sizeof(char));
|
char *bytes = (char *) malloc(size * sizeof(char));
|
||||||
int retVal = usb_interrupt_write((usb_dev_handle *) dev_handle, ep, bytes, size, timeout);
|
int retVal = usb_interrupt_read((usb_dev_handle *) dev_handle, ep, bytes, size, timeout);
|
||||||
if (!bytes) { return retVal; }
|
if (!bytes) { return retVal; }
|
||||||
env->SetByteArrayRegion(jbytes, 0, size, (jbyte *) bytes);
|
env->SetByteArrayRegion(jbytes, 0, size, (jbyte *) bytes);
|
||||||
free(bytes);
|
free(bytes);
|
||||||
|
|||||||
Reference in New Issue
Block a user