Help convert Java code to b4a

qsrtech

Active Member
Licensed User
Longtime User
Hi, I have this java code I need help converting to b4a.

B4X:
rdo = connection.controlTransfer(UsbConstants.USB_DIR_IN
           | UsbConstants.USB_TYPE_STANDARD, STD_USB_REQUEST_GET_DESCRIPTOR,
(LIBUSB_DT_STRING << 8) | idxPrd, 0, buffer, 0xFF, 0);

I've already tried this but it doesn't seem to give desired results
B4X:
rdo =connection.controlTransfer(Bit.OR(manager.USB_DIR_IN,manager.USB_TYPE_STANDARD),
STD_USB_REQUEST_GET_DESCRIPTOR,
Bit.OR(Bit.ShiftRight(LIBUSB_DT_STRING,8), idxPrd), 0, buffer, 0xFF, 0)

Thanks!
 
Top