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

Function goodProbe

XBOBTFF/FFDriver.cpp:18–42  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

16using std::min;
17
18static bool goodProbe(io_service_t theService)
19{
20 if (!IOObjectConformsTo(theService, kIOHIDDeviceKey)) {
21 return false;
22 }
23 CFMutableDictionaryRef dict;
24
25 IORegistryEntryCreateCFProperties(theService, &dict, kCFAllocatorDefault, 0);
26 CFTypeRef aNum = CFDictionaryGetValue(dict, CFSTR(kIOHIDProductIDKey));
27 int tmpNum;
28 ::CFNumberGetValue((CFNumberRef)aNum, kCFNumberIntType, &tmpNum);
29 if (tmpNum != 765) {
30 CFRelease(dict);
31 return false;
32 }
33 aNum = CFDictionaryGetValue(dict, CFSTR(kIOHIDVendorIDKey));
34 ::CFNumberGetValue((CFNumberRef)aNum, kCFNumberIntType, &tmpNum);
35 if (tmpNum != 1118) {
36 CFRelease(dict);
37 return false;
38 }
39
40 CFRelease(dict);
41 return true;
42}
43
44#define LoopGranularity 10000 // Microseconds
45

Callers 2

ProbeMethod · 0.85
InitializeTerminateMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected