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

Method SendSwitch

360Controller/_60Controller.cpp:90–108  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

88}
89
90bool Xbox360Peripheral::SendSwitch(bool sendOut)
91{
92 IOUSBDevRequest controlReq;
93
94 controlReq.bmRequestType = USBmakebmRequestType(sendOut ? kUSBOut : kUSBIn, kUSBVendor, kUSBDevice);
95 controlReq.bRequest = 0xa1;
96 controlReq.wValue = 0x0000;
97 controlReq.wIndex = 0xe416;
98 controlReq.wLength = sizeof(chatpadInit);
99 controlReq.pData = chatpadInit;
100 IOReturn err = device->DeviceRequest(&controlReq, 100, 100, NULL);
101 if (err == kIOReturnSuccess)
102 return true;
103
104 const char *errStr = device->stringFromReturn(err);
105 IOLog("start - failed to %s chatpad setting (%x): %s\n",
106 sendOut ? "write" : "read", err, errStr);
107 return false;
108}
109
110void Xbox360Peripheral::SendToggle(void)
111{

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected