| 68 | } |
| 69 | |
| 70 | IOReturn USBDeviceShim::getStringDescriptor(UInt8 index, char *buf, int maxLen, UInt16 lang) |
| 71 | { |
| 72 | memset(buf, 0, maxLen); |
| 73 | |
| 74 | const StringDescriptor* desc = m_pDevice->getStringDescriptor(index); |
| 75 | |
| 76 | if (!desc) |
| 77 | return kIOReturnBadArgument; |
| 78 | |
| 79 | if (desc->bLength <= StandardUSB::kDescriptorSize) |
| 80 | return kIOReturnBadArgument; |
| 81 | |
| 82 | size_t utf8len = 0; |
| 83 | utf8_encodestr(reinterpret_cast<const u_int16_t*>(desc->bString), desc->bLength - StandardUSB::kDescriptorSize, reinterpret_cast<u_int8_t*>(buf), &utf8len, maxLen, '/', UTF_LITTLE_ENDIAN); |
| 84 | |
| 85 | return kIOReturnSuccess; |
| 86 | } |
| 87 | |
| 88 | UInt16 USBDeviceShim::getDeviceRelease() |
| 89 | { |
nothing calls this directly
no outgoing calls
no test coverage detected