Send a report via the link
| 49 | |
| 50 | // Send a report via the link |
| 51 | bool 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 | } |