MCPcopy Create free account
hub / github.com/acidanthera/BrcmPatchRAM / getStringDescriptor

Method getStringDescriptor

BrcmPatchRAM/USBHostDeviceShim.cpp:70–86  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

68}
69
70IOReturn 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
88UInt16 USBDeviceShim::getDeviceRelease()
89{

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected