MCPcopy Create free account
hub / github.com/360Controller/360Controller / getDeviceString

Method getDeviceString

360Controller/Controller.cpp:150–163  ·  view source on GitHub ↗

Returns the string for the specified index from the USB device's string list, with an optional default

Source from the content-addressed store, hash-verified

148
149// Returns the string for the specified index from the USB device's string list, with an optional default
150OSString* Xbox360ControllerClass::getDeviceString(UInt8 index,const char *def) const
151{
152 IOReturn err;
153 char buf[1024];
154 const char *string;
155
156 err = GetOwnerProvider(this)->GetStringDescriptor(index, buf, sizeof(buf));
157 if(err==kIOReturnSuccess) string=buf;
158 else {
159 if(def == NULL) string = "Unknown";
160 else string = def;
161 }
162 return OSString::withCString(string);
163}
164
165OSString* Xbox360ControllerClass::newManufacturerString() const
166{

Callers

nothing calls this directly

Calls 1

GetOwnerProviderFunction · 0.85

Tested by

no test coverage detected