X-Received: by 10.224.60.6 with SMTP id n6mr7401751qah.8.1359389695621; Mon, 28 Jan 2013 08:14:55 -0800 (PST) X-Received: by 10.49.62.2 with SMTP id u2mr2024121qer.38.1359389695519; Mon, 28 Jan 2013 08:14:55 -0800 (PST) Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!news.glorb.com!p13no7586529qai.0!news-out.google.com!k2ni3639qap.0!nntp.google.com!p13no5816879qai.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.os.ms-windows.ce Date: Mon, 28 Jan 2013 08:14:55 -0800 (PST) Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=74.93.19.225; posting-account=62-aGwoAAADgly9vw-I3o8gshWoq28Jf NNTP-Posting-Host: 74.93.19.225 User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <23633d87-4d49-4ef0-bccb-163fa3825400@googlegroups.com> Subject: WinCE HID Driver setreport From: Liang Zhu Injection-Date: Mon, 28 Jan 2013 16:14:55 +0000 Content-Type: text/plain; charset=ISO-8859-1 Xref: csiph.com comp.os.ms-windows.ce:24 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"); } }