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

Method handleStart

WirelessGamingReceiver/WirelessHIDDevice.cpp:104–141  ·  view source on GitHub ↗

Start up the driver

Source from the content-addressed store, hash-verified

102
103// Start up the driver
104bool WirelessHIDDevice::handleStart(IOService *provider)
105{
106 WirelessDevice *device;
107 IOWorkLoop *workloop;
108
109 if (!super::handleStart(provider))
110 goto fail;
111
112 device = OSDynamicCast(WirelessDevice, provider);
113 if (device == NULL)
114 goto fail;
115
116 serialTimerCount = 0;
117
118 serialTimer = IOTimerEventSource::timerEventSource(this, ChatPadTimerActionWrapper);
119 if (serialTimer == NULL)
120 {
121 IOLog("start - failed to create timer for chatpad\n");
122 goto fail;
123 }
124 workloop = getWorkLoop();
125 if ((workloop == NULL) || (workloop->addEventSource(serialTimer) != kIOReturnSuccess))
126 {
127 IOLog("start - failed to connect timer for chatpad\n");
128 goto fail;
129 }
130
131 device->RegisterWatcher(this, _receivedData, NULL);
132
133 device->SendPacket(weirdStart, sizeof(weirdStart));
134
135 serialTimer->setTimeoutMS(1000);
136
137 return true;
138
139fail:
140 return false;
141}
142
143// Shut down the driver
144void WirelessHIDDevice::handleStop(IOService *provider)

Callers

nothing calls this directly

Calls 2

RegisterWatcherMethod · 0.80
SendPacketMethod · 0.80

Tested by

no test coverage detected