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

Method newLocationIDNumber

360Controller/Controller.cpp:205–230  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

203}
204
205OSNumber* Xbox360ControllerClass::newLocationIDNumber() const
206{
207 IOUSBDevice *device;
208 OSNumber *number;
209 UInt32 location = 0;
210
211 device = GetOwnerProvider(this);
212 if (device)
213 {
214 if ((number = OSDynamicCast(OSNumber, device->getProperty("locationID"))))
215 {
216 location = number->unsigned32BitValue();
217 }
218 else
219 {
220 // Make up an address
221 if ((number = OSDynamicCast(OSNumber, device->getProperty("USB Address"))))
222 location |= number->unsigned8BitValue() << 24;
223
224 if ((number = OSDynamicCast(OSNumber, device->getProperty("idProduct"))))
225 location |= number->unsigned8BitValue() << 16;
226 }
227 }
228
229 return (location != 0) ? OSNumber::withNumber(location, 32) : 0;
230}
231
232void Xbox360ControllerClass::remapButtons(void *buffer)
233{

Callers

nothing calls this directly

Calls 1

GetOwnerProviderFunction · 0.85

Tested by

no test coverage detected