Returns the string for the specified index from the USB device's string list, with an optional default
| 148 | |
| 149 | // Returns the string for the specified index from the USB device's string list, with an optional default |
| 150 | OSString* 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 | |
| 165 | OSString* Xbox360ControllerClass::newManufacturerString() const |
| 166 | { |
nothing calls this directly
no test coverage detected