Merge "fastboot: set the language local string"

This commit is contained in:
Jean-Baptiste Queru 2012-01-27 10:13:52 -08:00 committed by android code review
commit 0458d37326
2 changed files with 5 additions and 3 deletions

View File

@ -139,10 +139,11 @@ static int filter_usb_device(int fd, char *ptr, int len, int writable,
ctrl.bRequestType = USB_DIR_IN|USB_TYPE_STANDARD|USB_RECIP_DEVICE;
ctrl.bRequest = USB_REQ_GET_DESCRIPTOR;
ctrl.wValue = (USB_DT_STRING << 8) | dev->iSerialNumber;
ctrl.wIndex = 0;
//language ID (en-us) for serial number string
ctrl.wIndex = 0x0409;
ctrl.wLength = sizeof(buffer);
ctrl.data = buffer;
ctrl.timeout = 50;
ctrl.timeout = 50;
result = ioctl(fd, USBDEVFS_CONTROL, &ctrl);
if (result > 0) {

View File

@ -331,7 +331,8 @@ static int try_device(io_service_t device, usb_handle *handle) {
req.bmRequestType = USBmakebmRequestType(kUSBIn, kUSBStandard, kUSBDevice);
req.bRequest = kUSBRqGetDescriptor;
req.wValue = (kUSBStringDesc << 8) | serialIndex;
req.wIndex = 0;
//language ID (en-us) for serial number string
req.wIndex = 0x0409;
req.pData = buffer;
req.wLength = sizeof(buffer);
kr = (*dev)->DeviceRequest(dev, &req);