Wish USB : UsbDeviceConnection : Add wrap for second bulkTransfert method

kiki78

Active Member
Licensed User
Longtime User
Dear Erel,

In future release, may you add wrap for other bulkTransfert method (with offset) in UsbDeviceConnection ?

Regards,
Christian
 

kiki78

Active Member
Licensed User
Longtime User
Dear Erel,

I probably make a mistake, but for now, in B4A 10.50, I found only bulkTransfert method without offset.

bulkTransfert.png


And it is also not describe in USBDeviceConnection help.

Is it accessible from other class, or is it implemented but not currently exposed ?

Regards,
Christian
 

Erel

B4X founder
Staff member
Licensed User
Longtime User
You are correct. You can implement it with Reflector + JavaObject:
B4X:
Sub BulkTransfer (Endpoint As UsbEndpoint, Buffer() As Byte, Offset As Int, Length As Int, Timeout As Int)
 Dim r As Reflector
 r.Target = UsbConnection 'change as needed
 Dim connection As JavaObject = r.GetField("connection")
 connection.RunMethod("bulkTransfer", Array(Endpoint, Buffer, Offset, Length, Timeout)
End Sub
 

kiki78

Active Member
Licensed User
Longtime User
Thank you Erel for your reactivity :)
Also, by advance, thank you if you can add it as bulkTransfert2 method of USBDeviceConnection in next release.

Regards,
Christian
 
Top