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

Function Device_Send

Feedback360/devlink.cpp:51–64  ·  view source on GitHub ↗

Send a report via the link

Source from the content-addressed store, hash-verified

49
50// Send a report via the link
51bool Device_Send(DeviceLink *link,void *data,int length)
52{
53 if(link->interface==NULL) {
54 fprintf(stderr, "Attempting to send to a closed link!\n");
55 return false;
56 }
57 else {
58 //fprintf(stderr, "Attempting to send: %d %d %d %d\n",((unsigned char*)data)[0], ((unsigned char*)data)[1], ((unsigned char*)data)[2], ((unsigned char*)data)[3]);
59 IOReturn res=(*link->interface)->setReport(link->interface,kIOHIDReportTypeOutput,0,data,length,10000,NULL,NULL,NULL);
60 if (res != kIOReturnSuccess)
61 fprintf(stderr, "Device_Send failed: 0x%.8x\n", res);
62 return res == kIOReturnSuccess;
63 }
64}

Callers 3

EscapeMethod · 0.85
EscapeMethod · 0.85
SetForceMethod · 0.85

Calls 1

setReportMethod · 0.45

Tested by

no test coverage detected