Hello,
I am using VNC2 as usb host controller transmitting data packets scan by barcode scanner.
I give value 0x06 for bRequest in the SETUP TRANSFER code as shown in follows, however I get error code 0x14 on my IDE as shown in the attached figure. I could not find what 0x14 meant in the USBHost.h library (the values of USBHOST_STATUS are from -1~16). Therefore, what does the error code 0x14 mean? Any suggestion to fix this problem?
Also, I have two barcode scanners. When I use them to scan the barcode and I receive data in 8 bytes for one and 9 bytes for another. I looked up the data in wireshark on windows, the one more bytes one barcode scanner had is the report id. Therefore, I tried to get the "report id" infromation from the setup data. I tried to give 0x06 (GET_DESCRIPTOR) for bRequest and 0x07 (SET_DESCRIPTOR) for bRequest both, but all of the two command values got into error messgae when running code " vos_dev_ioctl(hUSBHOST_1, &hc_iocb)". One of the error message is 0x14.
Alternatively, I tried to attach the hid driver for usb host but cannnot get the correct report id information as shwon in the first data byte of the 9-bytes-based barcode scanner. My goal is that I want to get the correct report id information, or remover it, or set it into zero to let the two barcode scanners receive the same data byte length. Are there any configs I miss or made wrong? Or any suggestions are appreciated in advanced!
The following is part of my code:
////// test 1 /////////
desc_dev.bmRequestType = USB_BMREQUESTTYPE_HOST_TO_DEV | USB_BMREQUESTTYPE_CLASS | USB_BMREQUESTTYPE_DEVICE;
desc_dev.bRequest = 0x06;
hc_iocb.ioctl_code = VOS_IOCTL_USBHOST_DEVICE_SETUP_TRANSFER;
hc_iocb.handle.ep = epCtrl;
hc_iocb.set = &desc_dev;
status = vos_dev_ioctl(hUSBHOST_1, &hc_iocb);
if (status != USBHOST_OK) {
break;
}
hid_reportid2 = desc_dev.wValue & 0xff;
///////////////////////
/////// test 2 /////////
desc_dev.bmRequestType = USB_BMREQUESTTYPE_HOST_TO_DEV | USB_BMREQUESTTYPE_CLASS | USB_BMREQUESTTYPE_DEVICE;
desc_dev.bRequest = 0x07;
desc_dev.wValue = 0x0200;
hc_iocb.ioctl_code = VOS_IOCTL_USBHOST_DEVICE_SETUP_TRANSFER;
hc_iocb.handle.ep = epCtrl;
hc_iocb.set = &desc_dev;
status = vos_dev_ioctl(hUSBHOST_1, &hc_iocb);
if (status != USBHOST_OK) {
break;
}
hid_reportid3 = desc_dev.wValue & 0xff;
///////////////////////
Thank you so much for your kind help!
Yvonne