Groups | Search | Server Info | Login | Register
Groups > comp.os.ms-windows.ce > #24
| Newsgroups | comp.os.ms-windows.ce |
|---|---|
| Date | 2013-01-28 08:14 -0800 |
| Message-ID | <23633d87-4d49-4ef0-bccb-163fa3825400@googlegroups.com> (permalink) |
| Subject | WinCE HID Driver setreport |
| From | Liang Zhu <liangliang.zhu@gmail.com> |
I have written the following source to sent data packet to HID slave device. I am getting the input, but I can not see the output on the USB analyzer, could someone tell me where is my mistake?
HANDLE hReg = NULL;
HANDLE hQueue = NULL;
MSGQUEUEOPTIONS msgopts;
GUID InterfaceClassGuid = DEVCLASS_KEYBOARD_GUID;
output[0]=1;
output[1]=2;
dwBytesToWrite=(DWORD)sizeof(output);
memset(&msgopts, 0, sizeof(msgopts));
msgopts.dwSize = sizeof(msgopts);
msgopts.dwFlags = 0;
msgopts.dwMaxMessages = 0;
msgopts.cbMaxMessage = sizeof(pPNPBuf);
msgopts.bReadAccess = TRUE;
InitializeCriticalSection(&g_csHidDevices);
hQueue = CreateMsgQueue(NULL, &msgopts);
if (hQueue == NULL) {printf("Unable to create message queue !\r\n");}
hReg = RequestDeviceNotifications(&InterfaceClassGuid, hQueue, TRUE);
if (hReg == NULL)
{ printf("Unable to RequestDeviceNotifications!\r\n");}
ReadMsgQueue(hQueue, pd, sizeof(pPNPBuf), &dwSize, 0 , &dwFlags);
if (pd->fAttached == TRUE)
{
DWORD result = (DWORD)((LPSET_REPORT)(hQueue, HidP_Output, output, dwBytesToWrite, 3000));
if (result == NULL)
{
printf("Fail1\n");
}
else
{
printf("the data has transfered %d\n");
}
}
Back to comp.os.ms-windows.ce | Previous | Next | Find similar
WinCE HID Driver setreport Liang Zhu <liangliang.zhu@gmail.com> - 2013-01-28 08:14 -0800
csiph-web