Q qsrtech Active Member Licensed User Longtime User Mar 29, 2013 #1 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!
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!
Erel B4X founder Staff member Licensed User Longtime User Mar 30, 2013 #2 << operator is shift left not right. Upvote 0
Q qsrtech Active Member Licensed User Longtime User Mar 30, 2013 #3 Thanks! Seems to be working great now! Upvote 0