#include #include static uint8_t gReport[64] = {0}; static bool gValue = FALSE; static bool gSend = FALSE; static char * getReportTypeString(IOHIDReportType type) { switch ( type ) { case kIOHIDReportTypeInput: return "INPUT"; case kIOHIDReportTypeOutput: return "OUTPUT"; case kIOHIDReportTypeFeature: return "FEATURE"; default: return "DUH"; } } static void __deviceReportCallback(void * context, IOReturn result, void * sender, IOHIDReportType type, uint32_t reportID, uint8_t * report, CFIndex reportLength) { int index; printf("IOHIDDeviceRef[%p]: reportType=%s reportID=%d reportLength=%d: ", sender, getReportTypeString(type), reportID, reportLength); for (index=0; index