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

Function Device_Initialise

Feedback360/devlink.cpp:28–40  ·  view source on GitHub ↗

Initialise the link

Source from the content-addressed store, hash-verified

26
27// Initialise the link
28bool Device_Initialise(DeviceLink *link,io_object_t device)
29{
30 IOCFPlugInInterface **plugInInterface = NULL;
31 SInt32 score = 0;
32 IOReturn ret = IOCreatePlugInInterfaceForService(device, kIOHIDDeviceUserClientTypeID, kIOCFPlugInInterfaceID, &plugInInterface, &score);
33
34 if (ret!=kIOReturnSuccess) return false;
35 ret=(*plugInInterface)->QueryInterface(plugInInterface, CFUUIDGetUUIDBytes(kIOHIDDeviceInterfaceID121), (LPVOID*)(&link->interface));
36 (*plugInInterface)->Release(plugInInterface);
37 if (ret!=kIOReturnSuccess) return false;
38 (*link->interface)->open(link->interface, 0);
39 return true;
40}
41
42// Finish the link
43void Device_Finalise(DeviceLink *link)

Callers 1

InitializeTerminateMethod · 0.85

Calls 2

QueryInterfaceMethod · 0.45
ReleaseMethod · 0.45

Tested by

no test coverage detected