int AIOTestAdapter::read(Array<uint16> &data) { uint8 temp[NUM_INPUTS_PER_ADAPTER * 2 + 1]; data.clearQuick(); if (INVALID_HANDLE_VALUE == readHandle) return 0; zerostruct(temp); BOOLEAN result = HidD_GetInputReport(readHandle, temp, sizeof(temp)); if (0 == result) { return 0; } uint16 *source = (uint16 *)(temp + 1); for (int i = 0; i < NUM_INPUTS_PER_ADAPTER; ++i) { data.add(source[i]); } return NUM_INPUTS_PER_ADAPTER; }
void WHTDongle::GetInputReportRaw(void* buffer, int report_size) { if (HidD_GetInputReport(hDevice, buffer, report_size) != TRUE) ThrowException(L"HidD_GetInputReport", ((uint8_t*) buffer)[0]); }
// Synchronous immediate read BOOL Read(HANDLE hPortalHandle, RWBlock *pb) { pb->buf[0] = 0; // Use report 0 return HidD_GetInputReport(hPortalHandle, pb->buf, 0x21); }