I have a question
I declared a USB HID DEVICE, HID report as follows:
Usage Page (Vendor-Defined 1) 06 00 FF
Usage (Vendor-Defined 2) 09 02
Collection (Application) A1 01
Logical Minimum (0) 15 00
Logical Maximum (255) 26 FF 00
Report Size (8) 75 08
Report ID (1) 85 01
Report Count (7) 95 07
Usage (Vendor-Defined 2) 09 02
Input (Data,Var,Abs,NWrp,Lin,Pref,NNul,Bit) 81 02
Usage (Vendor-Defined 2) 09 02
Output (Data,Var,Abs,NWrp,Lin,Pref,NNul,NVol,Bit) 91 02
Report ID (2) 85 02
Report Count (63) 95 3F
Usage (Vendor-Defined 2) 09 02
Input (Data,Var,Abs,NWrp,Lin,Pref,NNul,Bit) 81 02
Usage (Vendor-Defined 2) 09 02
Output (Data,Var,Abs,NWrp,Lin,Pref,NNul,NVol,Bit) 91 02
End Collection C0
USB HID device success send 8 bytes data to pc. (01 35 00 00 00 00 00 00)
HidP_GetCaps(pPreData, &cap) get cap.InputReportByteLength = 64
Part of the source code:
{
memset(ReadReportBuffer, 0, sizeof(ReadReportBuffer));
ReadFile(m_hReadHandle,
ReadReportBuffer,
64,
NULL,
&ReadOverlapped);
}
dObject = WaitForMultipleObjects(2, hArray, FALSE, INFINITE);
if (dObject == WAIT_OBJECT_0)
{
if (!MyDevFound){
continue;
}
GetOverlappedResult(m_hReadHandle,
&ReadOverlapped,
&nBytesRead,
TRUE);if (nBytesRead != 0)
{
m_strTemp = ReadReportBuffer;
m_strLog.Format(_T("Read the Report Data Length is %d.(%02d:%02d:%02d)"),
nBytesRead, sysTime.wHour, sysTime.wMinute, sysTime.wSecond);
m_strLog += m_strTemp;
Display_Info::SendEvent(m_strLog);
pDlg->DisplayDataHex(ReadReportBuffer, nBytesRead);
}
why nBytesRead value = 64?