精华内容
下载资源
问答
  • 查看是否驱动有问题,我的电脑—管理—设备管理器—鼠标和其它指针设置—HID-compliant mouse,是否为黄色感叹号,如为黄色感叹号表示驱动有问题,右键禁用此驱动,然后再重启驱动,重启电脑就好啦。...

    查看是否驱动有问题,我的电脑—管理—设备管理器—鼠标和其它指针设置—HID-compliant mouse,是否为黄色感叹号,如为黄色感叹号表示驱动有问题,右键禁用此驱动,然后再重启驱动,重启电脑就好啦。


    展开全文
  • HID - Keyboard键盘和Mouse鼠标实例

    千次阅读 2010-07-12 15:48:00
    hid报告描述符生成工具Dt.exe以及hid-keyboard键盘和mouse鼠标实例 报告描述符范例 键 盘 鼠  标 项 目 编码 项 目 编码 Usage Page (Generic Desktop), 0x...
    hid报告描述符生成工具Dt.exe以及hid-keyboard键盘和mouse鼠标实例
    报告描述符范例

        

         

     

      

    Usage Page (Generic Desktop),

    0x0105

    Usage Page (Generic Desktop),

    0x0105

    Usage ( Keyboard ),

    0x0609

    Usage ( Mouse ),

    0x0209

    Collection (Application),

    0x01A1

    Collection (Application),

    0x01A1

    Usage Page (Keyboard),

    0x0705

    Usage ( Pointer ),

    0x0109

    Usage Minimum (224),

    0xE019

    Collection (Physical),

    0x00A1

    Usage Maximum (231),

    0xE729

    Usage Page (Buttons),

    0x0905

    Logical Minimum (0),

    0x0015

    Usage Minimum (1),

    0x0119

    Logical Maximum (1),

    0x0125

    Usage Maximum (3),

    0x0329

    Report Size (1),

    0x0175

    Logical Minimum (0),

    0x0015

    Report Count (8),

    0x0895

    Logical Maximum (1),

    0x0125

    Input (Data, Variable, Absolute),

    0x0281

    Report Size (1),

    0x0175

    Report Size (8),

    0x0875

    Report Count (3),

    0x0395

    Report Count (1),

    0x0195

    Input (Data, Variable, bsolute),

    0x0281

    Input (Constant),

    0x0181

    Report Size (5),

    0x0575

    Usage Minimum (0),

    0x0019

    Report Count (1),

    0x0195

    Usage Maximum (101),

    0x6529

    Input (Constant),

    0x0181

    Logical Minimum (0),

    0x0015

    Usage Page (Generic Desktop),

    0x0105

    Logical Maximum (101),

    0x6525

    Usage (X),

    0x3009

    Report Size (8),

    0x0875

    Usage (Y),

    0x3109

    Report Count (6),

    0x0695

    Logical Minimum (-127),

    0x8115

    Input (Data, Array),

    0x0081

    Logical Maximum (127),

    0x7F25

    Usage Page (LEDs),

    0x0805

    Report Size (8),

    0x0875

    Usage Minimum (1),

    0x0119

    Report Count (2),

    0x0295

    Usage Maximum (5),

    0x0529

    Input (Data, Variable, Relative),

    0x0681

    Logical Minimum (0),

    0x0015

    End Collection,

    0xC0

    Logical Maximum (1),

    0x0125

    End Collection

    0xC0

    Report Size (1),

    0x0175

     

     

    Report Count (5),

    0x0595

     

     

    Output (Data, Variable,Absolute),

    0x0291

     

     

    Report Size (3),

    0x0375

     

     

    Report Count (1),

    0x0195

     

     

    Output (Constant),

    0x0191

     

     

    End Collection

    0xC0

     

     



    http://www.usb.org/developers/hidpage/#Class_Definition


    HID Information

    HID Related Specifications

    HID Resources

     

     

    HID Related Specifications

    Device Class Definition HID
    The Device Class Definition for HID 1.11 is intended to supplement the USB Specification and provide HID manufacturers with the information necessary to build USB-compatible devices. It also specifies how the HID class driver should extract data from USB devices. The primary and underlying goals of the HID class definition are to:

    • be as compact as possible to save device data space
    • allow the software application to skip unknown information
    • be extensible and robust
    • support nesting and collections
    • be self-describing to allow generic software applications

    HID Usage Tables
    The HID Usage Tables 1.12 document defines constants that can be interpreted by an application to identify the purpose and meaning of a data field in a HID report.

    Usages are also used to define the meaning of groups of related data items. This is accomplished by the hierarchical assignment of usage information to collections.

    Usages identify the purpose of a collection and the items it contains. Each Input, Output, Feature, and/or Collection data item within a Collection item can be assigned a purpose with its own usage item. Usages assigned to a collection apply to the items within the collection.

    The HID Usage Tables document contains extensions to the tables defined in the USB Device Class Definition for Human Interface Devices. All usages pages, except the Keyboard table, are replicated in the Usage Table document. The Usage Table document identifies the extensions to the Keyboard usage table.

    Note: For keyboards, look at the usage table sections in both the HID Specification and the HID Usage Table document!

    Approved Usage Table Review Requests

    The following HID Usage Table Review Requests have been approved for implementation by the USB Device Working Group HID Committee. These Review requests assign enumeration values and recommended meaning to new Usages allocated after the publication of the HID Usage Tables v1.12. Please note that the creation of a new Usage does not imply support for that Usage by any USB HID Host vendor.

         Review Request 28:  Creation of a Usage Page for the Gaming Standards Association
         Review Request 29:  Repurposing the Alphanumberic Display Page (0x14) as a generic Auxiliary Display Page and adding bitmap and custom segment capabilities
         Review Request 30:  Touch digitizers
         Review Request 31:  Background Events application collection
         Review Request 32:  Dual-Mode Telephone devices
         Review Request 33:  Water cooling and computer chassis
         Review Request 34:  Multi-touch digitizers
         Review Request 35:  Consumer electronics devices (PiP Toggle, PiP-swap)
         Review Request 36:  Consumer electronics devices (Color buttons)

    Usage Tables for Physical Interface Devices
    The
    Device Class Definition for PID 1.0 provides information for the development of Physical Interface Devices. These devices include force feedback joysticks, steering wheels, etc. It allows peripheral and driver developers to use a common set of HID report descriptors, device usages and reports to describe the characteristics of a PID class device.

    Usage Tables for HID Power Devices
    The
    Usage Tables for HID Power Devices 1.0 specification provides information to guide implementers in using the USB logical structures for Power Devices, OS designers, BIOS designers, and peripheral and UPS designers can use the common descriptors, of USB Power Device Usages and Reports.

    Monitor Control Class Specification
    The
    Monitor Control Class 1.0 specification defines how a monitor with a USB Monitor Control interface interacts with a USB-enabled host system.

    HID Point Of Sale Usage Tables
    The
    HID Point Of Sale Usage Tables 1.02 document defines usages that apply to Point of Sale devices, in particular Barcode Scanners and Scales.

    OAAD Arcade Usage Table
    The
    OAAD Arcade Usage Table document defines usages for coin changers, general purpose digital inputs and outputs, and other devices used in arcade products.

    Gaming Standards Association Gaming Device Standards
    The Gaming Standards Association defines HID Usages and HID Reports used in the implementation of GSA-compliant Gaming Devices such as currency handlers, gaming-specific printers, etc. Their standards relating to USB HID implementations can be found here .

    Microsoft Related HID Documentation
    The
    Microsoft Related HID Documentation page contains links to documentation on Microsoft's site geared towards HID implementation, device class support, devices, etc.

    HID Resources

    HID Descriptor Tool
    This tool allows you to create, edit and validate HID Report Descriptors. The tool also supports a variety of output formats (.txt, .inc, .h, etc.). DT uses ASCII based Usage Tables and supports vendor defined pages as well. Included are Usage Table files for the HID Usage Table document 1.0 Release Candidate 1, Monitor Class 1.0 Release Candidate 2, and Power Class Spec. Read the included README.TXT file for more information.

    HIDView
    This program, found in the USBCheck, is now obsolete. Its replacement is
    USBCV .

    HID White Papers

    HID FAQ
    A FAQ with questions and answers regarding hid and hid usage. 

    Unicode
    The Unicode web site (
    www.unicode.org ) allows you to download the latest character tables for free. Check it before you finalize a design because new ones are always in process.
    The Nadine Kano book, "Developing International Software" which was used as key reference for Unicode, is out of print. It can still be obtained in a CD-ROM version as part of the Microsoft Developers Network (MSDN) subscription. Subscription information can be obtained at the MSDN web site (msdn.microsoft.com ). Or it can be accessed for free online at the MSDN Library . The book can be found under "Books / Developing International Software".
    To get the latest LANGID definitions go to http://msdn.microsoft.com/library/default.asp?url=/library/en-us/intl/nls_8xo3.asp . This page will change as new LANGIDs are added.
    Note that the HID Primary LANGID (0x0FF) is not on the above list, however it is permanently reserved and will never be reassigned.

    Please send your URLs to hidcomments@usb.org


     

     原文地址 http://www.usb.org/developers/hidpage/#Class_Definition
    展开全文
  • mouse 鼠标

    2014-04-21 14:02:47
    mouse 鼠标
  • usb 那点事

    2021-07-14 18:13:10
    1、usb 为何而生https://blog.csdn.net/u013165704/article/details/118734258 2、usb 如何枚举 3、usb 低速 高速 全速如何匹配的 4、usb 接口类型 5、usb otg 6、usb fastboot ...7、usb 调式技巧

    1、usb 为何而生

    2、usb 如何枚举

    3、usb 低速 高速 全速如何匹配的

    4、usb 接口类型

    5、usb otg

    6、usb fastboot

    7、usb 调式技巧

    展开全文
  • HID_USB通信

    2014-06-30 07:10:11
    经过这一段时间的摸索,自己写了HID_USB模块, #ifndef __HIDUSB__H__20140620 #define __HIDUSB__H__20140620 #include "../include/IHidUsb.h" #include "../include/UsbProcol.h" extern "C" { #include ...

    经过这一段时间的摸索,自己写了HID_USB模块,

    #ifndef __HIDUSB__H__20140620
    #define __HIDUSB__H__20140620
    
    #include "../include/IHidUsb.h"
    #include "../include/UsbProcol.h"
    
    extern "C"
    {
    #include "hidsdi.h"
    #include "hid.h"
    }
    
    class CHidUsb : public IHidUsb
    {
    public:
    	virtual HANDLE OpenDevice(DWORD dwVentorId, DWORD dwProductId, IUsbResponse *lpRes, VOID *lpContext, DWORD dwTimeOut = 5);
    	virtual BOOL WriteDevice(HANDLE hUsbDevice, const CHAR *lpszBuf, INT nSize, BOOL bNeedRead = TRUE);
    	virtual VOID CloseDevice(HANDLE hUsbDevice);
    	virtual BOOL ReOpen(HANDLE hUsbDevice);
    	virtual VOID Release();
    
    	typedef struct tagDEVICE_CONFIG
    	{
    		DWORD dwVentorId;
    		DWORD dwProductId;
    		DWORD dwTimeOut;
    
    	}DEVICE_CONFIG;
    
    private:
    	CHidUsb();
    	virtual ~CHidUsb();
    
    private:
    	HANDLE OpenHidDevice(DWORD dwVentorId, DWORD dwProductId);
    	BOOL TranslateData(const CHAR *lpszBuf, INT nSize);
    
    public:
    	static CHidUsb *CreateInstance();
    	static DWORD WINAPI ThreadProc(LPVOID lpParameter);
    
    private:
    	HANDLE m_hUsbDevice;
    	HANDLE m_hThread;
    	DEVICE_CONFIG m_DeviceCfg;
    	IUsbResponse *m_lpResponse;
    	VOID *m_lpContext;
    	BOOL m_bStop;
    	BOOL m_bClose; 
    
    	HANDLE m_hWriteEvent;
    	HANDLE m_hReadEvent;
    	HANDLE m_hWaitEvent;
    
    	static CHidUsb *m_lpInstance;
    };
    
    #endif

    .cpp

    
    #include "HidUsb.h"
    #include <string.h>
    #include <assert.h>
    
    #pragma comment(lib, "../Bin/hid.lib")
    #pragma comment(lib, "setupapi.lib ")
    CHidUsb *CHidUsb::m_lpInstance = NULL;
    
    #define  HID_PACKAGE_SIZE	64
    
    HANDLE CHidUsb::OpenDevice(DWORD dwVentorId, DWORD dwProductId, IUsbResponse *lpRes, VOID *lpContext, DWORD dwTimeOut)
    {
    	do
    	{
    		m_hUsbDevice = OpenHidDevice(dwVentorId, dwProductId);
    		if (INVALID_HANDLE_VALUE == m_hUsbDevice)
    		{
    			break;
    		}
    
    	memset(&m_DeviceCfg, 0, sizeof(m_DeviceCfg));
    	m_DeviceCfg.dwVentorId = dwVentorId;
    	m_DeviceCfg.dwProductId = dwProductId;
    	m_DeviceCfg.dwTimeOut = dwTimeOut;
    
    	m_lpResponse = lpRes;
    	m_lpContext = lpContext;
    	m_bStop = FALSE;
    	m_hReadEvent = ::CreateEvent(NULL, FALSE, FALSE, NULL);
    	m_hWriteEvent = ::CreateEvent(NULL, FALSE, FALSE, NULL);
    	m_hWaitEvent = ::CreateEvent(NULL, FALSE, FALSE, NULL);
    
    	SetEvent(m_hWaitEvent);
    	// 创建接受线程
    	m_hThread = ::CreateThread(0, 0, ThreadProc, this, 0, 0);
    	assert(m_hThread != INVALID_HANDLE_VALUE);
    
    	} while (0);
    
    	return m_hUsbDevice;
    }
    
    BOOL CHidUsb::WriteDevice(HANDLE hUsbDevice, const CHAR *lpszBuf, INT nSize, BOOL bNeedRead)
    {
    	DWORD dwSizeWritten;
    	OVERLAPPED OverLapped;
    	DWORD dwErrCode;
    	INT nWriteSize;
    	INT nNeedWriteSize;
    	CHAR szHidBuf[HID_PACKAGE_SIZE + 1];
    	BOOL bRet;
    
    	nNeedWriteSize = nSize;
    	nWriteSize = 0;
    
    	// 只能已HID包的格式发送
    	memset(&OverLapped, 0, sizeof(OverLapped));
    	OverLapped.hEvent = m_hWriteEvent;
    	bRet = FALSE;
    
    	while (1)
    	{
    		if (nSize <= 0)
    		{
    			bRet = TRUE;
    			break;
    		}
    
    		nNeedWriteSize = HID_PACKAGE_SIZE;
    		if (nNeedWriteSize > nSize)
    		{
    			nNeedWriteSize = nSize;
    		}
    		nSize -= nNeedWriteSize;
    
    		memset(szHidBuf, 0xff, HID_PACKAGE_SIZE + 1);
    		szHidBuf[0] = 0;
    		memcpy(szHidBuf + 1, lpszBuf, nNeedWriteSize);
    		lpszBuf += nNeedWriteSize;
    
    		if (!::WriteFile(m_hUsbDevice, szHidBuf, HID_PACKAGE_SIZE + 1, &dwSizeWritten, &OverLapped))
    		{
    			dwErrCode = GetLastError();
    			if (dwErrCode == ERROR_IO_PENDING)	// 延时等待
    			{
    				DWORD dwTimeOut;
    				DWORD dwResult;
    
    				dwTimeOut = 2 * 1000;			// 等待2s, 因为WriteFile函数是主动发送,所以这里人为定义了超时
    				dwResult = WaitForSingleObject(OverLapped.hEvent, dwTimeOut);
    				if (dwResult == WAIT_TIMEOUT)	// 写超时
    				{
    					// 关掉连接
    					CloseDevice(m_hUsbDevice);
    					m_hUsbDevice = INVALID_HANDLE_VALUE;
    					bRet = FALSE;
    					break;
    				}
    				else if (dwResult == WAIT_OBJECT_0)
    				{
    					GetOverlappedResult(m_hUsbDevice, &OverLapped, &dwSizeWritten, FALSE);
    					assert(dwSizeWritten == HID_PACKAGE_SIZE + 1);
    					continue;
    				}
    				else
    				{
    					assert(0);
    				}
    			}
    
    			break;
    		}
    
    		assert(dwSizeWritten == HID_PACKAGE_SIZE + 1);
    		nWriteSize += dwSizeWritten;
    
    	}
    
    	return bRet;
    }
    
    VOID CHidUsb::CloseDevice(HANDLE hUsbDevice)
    {
    
    	// 断开设备方法,为了同步, 可能会影响到速度
    	m_bClose = TRUE;
    }
    
    VOID CHidUsb::Release()
    {
    	CloseDevice(m_hUsbDevice);
    
    	assert(m_hWaitEvent != INVALID_HANDLE_VALUE);
    	assert(m_hWriteEvent != INVALID_HANDLE_VALUE);
    	assert(m_hReadEvent != INVALID_HANDLE_VALUE);
    	assert(m_hThread != INVALID_HANDLE_VALUE);
    
    	m_bStop = TRUE;
    	SetEvent(m_hWaitEvent);
    	WaitForSingleObject(m_hThread, INFINITE);
    	CloseHandle(m_hWriteEvent);
    	CloseHandle(m_hWaitEvent);
    	CloseHandle(m_hReadEvent);
    	
    	m_hUsbDevice = INVALID_HANDLE_VALUE;
    	m_hThread = INVALID_HANDLE_VALUE;
    	m_hWriteEvent = INVALID_HANDLE_VALUE;
    	m_hWaitEvent = INVALID_HANDLE_VALUE;
    	m_hReadEvent = INVALID_HANDLE_VALUE;
    }
    
    CHidUsb::CHidUsb()
    {
    	m_hUsbDevice = INVALID_HANDLE_VALUE;
    	m_hThread = INVALID_HANDLE_VALUE;
    	m_hWriteEvent = INVALID_HANDLE_VALUE;
    	m_hWaitEvent = INVALID_HANDLE_VALUE;
    	m_hReadEvent = INVALID_HANDLE_VALUE;
    	memset(&m_DeviceCfg, 0, sizeof(m_DeviceCfg));
    	m_lpResponse = NULL;
    	m_lpContext = NULL;
    	m_bStop  = TRUE;
    	m_bClose = FALSE;
    }
    
    CHidUsb::~CHidUsb()
    {
    
    }
    
    CHidUsb *CHidUsb::CreateInstance()
    {
    	if (m_lpInstance == NULL)
    	{
    		m_lpInstance = new CHidUsb;
    	}
    
    	return m_lpInstance;
    }
    
    DWORD CHidUsb::ThreadProc(LPVOID lpParameter)
    {
    	CHidUsb *lpInstance = (CHidUsb *)lpParameter;
    	HANDLE hDevice;
    	OVERLAPPED OverLapped;
    	CHAR szBuf[HID_PACKAGE_SIZE + 1];
    	DWORD dwSizeReaded;
    	DWORD dwResult;
    	DWORD dwTimeOut;
    	IUsbResponse *lpRes;
    	VOID *lpContext;
    	DWORD dwErrCode;
    	DWORD dwTimeTickPre; // 上一次的时间计数, 这里用来计算超时
    
    	lpRes = lpInstance->m_lpResponse;
    	lpContext = lpInstance->m_lpContext;
    	memset(&OverLapped, 0, sizeof(OverLapped));
    	OverLapped.hEvent = lpInstance->m_hReadEvent;
    	dwTimeOut = lpInstance->m_DeviceCfg.dwTimeOut;
    
    	dwTimeTickPre = 0;
    	while (1)
    	{
    		WaitForSingleObject(lpInstance->m_hWaitEvent, INFINITE);
    		if (lpInstance->m_bStop)
    		{
    			break;
    		}
    		hDevice = lpInstance->m_hUsbDevice;
    		lpInstance->m_bClose = FALSE;
    
    		// 开始读数据,这里只是简单读HID驱动的缓冲区
    		while (1)
    		{
    			if (lpInstance->m_bClose) // Jimmy added it, 关掉设备
    			{
    				lpRes->OnError(IHidUsb::ERR_HANDLE);
    				break;
    			}
    			if (::ReadFile(hDevice, szBuf, HID_PACKAGE_SIZE + 1, &dwSizeReaded, &OverLapped)) // 成功读取到HID设备的数据
    			{
    				dwTimeTickPre = 0;
    				assert(szBuf[0] == 0 && dwSizeReaded == HID_PACKAGE_SIZE + 1);
    				lpRes->OnReadDevice(hDevice, &szBuf[0], HID_PACKAGE_SIZE, lpContext);
    			}
    			else
    			{
    				dwErrCode = GetLastError();
    				if (dwErrCode == ERROR_IO_PENDING)	// 重叠端口即将阻塞
    				{
    					DWORD dwTimeWait;
    					
    					// 等待2 * 1000ms
    					dwTimeWait = 2 * 1000;
    					dwResult = WaitForSingleObject(OverLapped.hEvent, dwTimeWait);
    					if (dwResult == WAIT_TIMEOUT)
    					{
    						// 接受超时
    						if (GetTickCount() - dwTimeTickPre > dwTimeOut)
    						{
    							dwTimeTickPre = 0;
    							if (!lpRes->OnTimeOut(lpContext)) // 连接断开
    							{
    								break;
    							}
    						}
    						
    						continue;
    					}
    					else if (dwResult == WAIT_OBJECT_0)	// USB的数据可读
    					{
    						dwTimeTickPre = 0;
    						GetOverlappedResult(hDevice, &OverLapped, &dwSizeReaded, FALSE);
    						assert(szBuf[0] == 0 && dwSizeReaded == HID_PACKAGE_SIZE + 1);
    						lpRes->OnReadDevice(hDevice, &szBuf[0], HID_PACKAGE_SIZE, lpContext);
    						
    					}
    					else	// 这个错误是不允许出现的
    					{
    						assert(0);
    					}
    				}
    				else
    				{
    					lpRes->OnError(IHidUsb::ERR_HANDLE);
    					break;
    				}
    			}
    
    			::CloseHandle(hDevice);
    			hDevice = INVALID_HANDLE_VALUE;
    		}
    	}
    
    	return 1;
    }
    
    HANDLE CHidUsb::OpenHidDevice(DWORD dwVentorId, DWORD dwProductId)
    {
    	GUID								HidGuid;
    	HDEVINFO							DevInfo;
    	HIDD_ATTRIBUTES						DevAttributes;
    	SP_DEVICE_INTERFACE_DATA			DevData;
    	PSP_DEVICE_INTERFACE_DETAIL_DATA	DevDetail;
    	PHIDP_PREPARSED_DATA				PreparsedData;
    	HIDP_CAPS							Capabilities;
    	ULONG								ulLength;
    	INT									nIndex;
    	USHORT								usFIFOLen;
    	
     
    	BOOL	bOk;
    	HANDLE	hDevHandle = INVALID_HANDLE_VALUE;
    	INT		nDevCount= 0;
    
    	/* Get GUID for all System HIDs */
    	HidD_GetHidGuid(&HidGuid);
    
    	/* Get Device Information for all present devices */
    	DevInfo = SetupDiGetClassDevs(&HidGuid,	NULL, NULL, (DIGCF_PRESENT | DIGCF_DEVICEINTERFACE));
    	DevData.cbSize = sizeof(DevData);
    	DevDetail = NULL;
    
    	nIndex = -1;
    	/* Scan all Devices */
    	 do 
    	 {
    		 nIndex ++;
    
    		/* Device Interface Element of a Device Information set */
    		 bOk = SetupDiEnumDeviceInterfaces(DevInfo, 0, &HidGuid, nIndex, &DevData);
    		if (!bOk)
    		{
    			break;
    		}
    
    		/* Get Device Interface Details - Get Length */
    		bOk = SetupDiGetDeviceInterfaceDetail(DevInfo, &DevData, NULL, 0, &ulLength, NULL);
      
    		/* Allocate memory for Device Detailed Data */
    		DevDetail = (PSP_DEVICE_INTERFACE_DETAIL_DATA) malloc(ulLength);
    
    		/* Set cbSize in the DevDetail structure */
    		DevDetail->cbSize = sizeof(SP_DEVICE_INTERFACE_DETAIL_DATA);
    
    		/* Get Device Interface Details */
    		bOk = SetupDiGetDeviceInterfaceDetail(DevInfo, &DevData, DevDetail, ulLength, NULL, NULL);
    		if (!bOk) 
    		{
    			free(DevDetail);
    			DevDetail = NULL;
    			continue;
    		}
      
    	  /* Create File for Device Read/Write */
    		hDevHandle = CreateFile(DevDetail->DevicePath, 
    								GENERIC_WRITE | GENERIC_READ, 
    								FILE_SHARE_WRITE, 
    								NULL,
    								OPEN_EXISTING, 
    								FILE_ATTRIBUTE_NORMAL | FILE_FLAG_OVERLAPPED, 
    								NULL);
    
    	  if (hDevHandle == INVALID_HANDLE_VALUE)
    	  {
    		  free(DevDetail);
    		  DevDetail = NULL;
    		  continue;
    	  }
    	  
    	  DevAttributes.Size = sizeof(DevAttributes);
    	  bOk = HidD_GetAttributes(hDevHandle,&DevAttributes);
    	  if(!bOk) 
    	  {
    		  free(DevDetail);
    		  CloseHandle(hDevHandle);
    		  DevDetail = NULL;
    
    		  continue;
    	  }
    	  if(DevAttributes.VendorID != dwVentorId || DevAttributes.ProductID != dwProductId)
    	  {
    		  free(DevDetail);
    		  CloseHandle(hDevHandle);
    		  hDevHandle = INVALID_HANDLE_VALUE;
    		  DevDetail = NULL;
    		  
    		  continue;
    	  }
    
    	  /* Get Preparsed Data */
    	  bOk = HidD_GetPreparsedData(hDevHandle, &PreparsedData);
    	  if (!bOk) 
    	  {
    	   free(DevDetail);
    	   CloseHandle(hDevHandle);
    	   DevDetail = NULL;
    	   continue;
    	  }
    
    	  /* Get Device's Capabilities */
    	  HidP_GetCaps(PreparsedData, &Capabilities);
    	  usFIFOLen = Capabilities.InputReportByteLength;
    	  free(DevDetail);
    
    	  break;
    
    	 } while (nDevCount < 20);
    
    	 SetupDiDestroyDeviceInfoList (DevInfo);
    
    	return hDevHandle;
    }
    
    BOOL CHidUsb::TranslateData(const CHAR *lpszBuf, INT nSize)
    {
    	CHAR szTranslateBuf[1024];
    	INT nTranslateIndex;
    	const CHAR *lpszPos;
    
    	nTranslateIndex = 0;
    	lpszPos = lpszBuf;
    	while (1)
    	{
    		if (nSize <= 0)
    		{
    			break;
    		}
    
    		lpszPos += 1; // ReportID
    		memcpy(&szTranslateBuf[nTranslateIndex], lpszPos, HID_PACKAGE_SIZE);
    		nTranslateIndex += HID_PACKAGE_SIZE;
    		lpszPos += HID_PACKAGE_SIZE;
    		nSize -= (HID_PACKAGE_SIZE + 1);
    
    	}
    
    	return m_lpResponse->OnReadDevice(m_hUsbDevice, szTranslateBuf, nTranslateIndex, m_lpContext);
    }
    
    
    BOOL CHidUsb::ReOpen(HANDLE hUsbDevice)
    {
    	// 重新打开设备前,一定要关掉设备
    	CloseDevice(m_hUsbDevice);
    
    	m_bClose = FALSE;
    	m_hUsbDevice = OpenHidDevice(m_DeviceCfg.dwVentorId, m_DeviceCfg.dwProductId);
    	if (m_hUsbDevice != INVALID_HANDLE_VALUE)
    	{
    		SetEvent(m_hWaitEvent);
    	}
    
    	return m_hUsbDevice != INVALID_HANDLE_VALUE;
    }

    保存起来,用来以后记录。


    展开全文
  • 哈工大计算机系统实验一:计算机系统漫游

    千次阅读 多人点赞 2021-01-11 12:01:04
    实验报告 实 验(一) 题 目 计算机系统漫游 专 业 计算机类 学 号 1180800811 班 级 1803002 学 生 张瑞豪 指 导 教 师 史先俊 实 验 地 点 G712 实 验 日 期 ...
  • 转自http://zhidao.baidu.com/question/215738766.html... 打开注册表regedit, 定位到HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Class\{4D36E96B-E325-11CE-BFC1-08002BE10318} 删除UpperFilters项 ...
  • 4、HID-compliant mouse 属性,选择电源管理选项卡,勾选允许此设备唤醒计算机,然后点击确定即可完成操作。 以上就是小编为大家带来的关于电脑如何设置电源管理允许鼠标唤醒计算机的详细教程了。如果你在使用电脑...
  • We’re all familiar with touch screen tablets, but some laptops also have touch ... We think they’re pretty useful, but if you tend to use your laptop with the standard keyboard and mouse combinat...
  • QT监测HID设备的拔插

    千次阅读 2018-10-23 13:59:10
    不同类型的设备有特定的唯一的Class GUID,利用这个GUID可以向窗体注册设备通知,我的是HID设备,故应该使用GUID_DEVINTERFACE_HID,使用该GUID要包含“initGUID”头文件 //给设备注册通知 DEV_BROADCAST_...
  • 1 Bus Hound 6.01 capture on Windows Vista Service Pack 1 (x64). Complements of www.perisoft.net 2 3 STM32_HID_mouse 4 5 Device - Device ID (followed by the endpoint for USB de...
  •  Name: HID-compliant mouse  Driver is running. ROOT\MIRAHID\0000  Name: Miracast HID  Driver is running. SWD\MMDEVAPI\MICROSOFTGSWAVETABLESYNTH  Name: Microsoft GS Wavetable Synth  Driver...
  • VID PID -List of USB ID's(一)

    万次阅读 2020-02-29 10:46:51
    1198 HID-compliant mouse 1202 PhotoSmart 320 series 1204 DeskJet 930c 1205 ScanJet 4500C/5550C 1211 OfficeJet v60xi 1217 LaserJet 2300L 1227 Virtual CD-ROM 1302 PhotoSmart 370 series 1305 ...
  • bus Hound usb hid

    千次阅读 2014-03-23 17:13:40
    下面这段数据是MINI mouse枚举成功数据,希望对于初学者有帮助.  USB鼠标枚举成功数据(Human Interface Device): Bus Hound 5.00 capture. Complements of www.perisoft.net  Device - Device ID ...
  • STM32 Customed HID开发流程 本文介绍的是STM32的cubeMX自定义HID的开发流程 cubeMX配置customed HID模式。更多详细配置壳查看代码CubeMX的配置文件。 修改usbd_custome_hid_if.c 里面的CUSTOM_HID_ReportDesc_FS...
  • When a device does not work we can capture touch data to confirm if it is a non-hid compliant device. We have further discovered that some PQLabs devices can run in both 'non-hid' and 'HID' mode. A ...
  • Compliant System/PCI Express根复合体/Intel(R) Serial IO I2C Host Controller -9DE8/I2C HID 设备/HID-compliant mouse 3.3 隐藏分区与虚拟内存之分页文件查看(2分) 写出计算机主硬盘的各隐藏分区的大小(MB)...
  • springboot-OSHI

    2021-09-03 11:36:04
    操作系统和硬件信息库OSHI 是什么支持的平台在Spring boot中使用OSHI1、oshi依赖2、测试代码3、测试结果 OSHI 是什么 OSHI 是一个免费的基于 JNA(本机)的 Java 操作系统和硬件信息库。它不需要安装任何额外的本地...
  • 它在 Linux-5.2/Documentation/hid/hiddev.txt 目录下,大致有这样一个流程 如上图所示,Linux USB子系统提供两种HID events接口: 1)* the input subsystem, which converts HID events into normal input ...
  • 1198 HID-compliant mouse 1202 PhotoSmart 320 series 1204 DeskJet 930c 1205 ScanJet 4500C/5550C 1211 OfficeJet v60xi 1217 LaserJet 2300L 1227 Virtual CD-ROM 1302 PhotoSmart 370 series 1305 ...
  • 1198 HID-compliant mouse 1202 PhotoSmart 320 series 1204 DeskJet 930c 1205 ScanJet 4500C/5550C 1211 OfficeJet v60xi 1217 LaserJet 2300L 1227 Virtual CD-ROM 1302 PhotoSmart 370 series 1305 ...
  • Windows HID 的一些信息

    千次阅读 2010-05-25 18:47:00
    这篇博客并不完整。我也不知道什么时候会将完成她。... Driver stack for mouse:Figure of driver stack for mouse: Figure of driver stack for vendor defined HID collectionsVendor defined collection I
  • 40840 bytes | Driver: kbdclass.sys, 4/13/2008 10:55:22, 23296 bytes | + HID-compliant mouse | Vendor/Product ID: 0x093A, 0x2510 | Matching Device ID: hid_device_system_mouse | Service: mouhid | ...
  • 电脑一周没有重起,今早一重起USB全都认不到,开始以为是硬件接触不良,后来重装驱动,重装驱动后可以正常使用可重起后又无法使用,在看了winodws日志,发现有很多:由于与此系统不兼容,已阻止加载 /?...
  • 戴尔 Latitude E5430 non-vPro 笔记本电脑

    千次阅读 2013-07-30 21:02:00
    --------[ 鲁大师 ]-------------------------------------------------------------------------------- 软件: 鲁大师 3.58.13.1024 时间: 2013-7-30 20:59:02 网站: http://www.luda...
  • 一劳永逸解决WIN10所有睡眠问题

    千次阅读 2021-02-05 00:41:30
    powercfg /deviceenableawake "HID-compliant mouse (003)" 允许鼠标唤醒电脑 powercfg /devicedisablewake "HID-compliant mouse (003)" 禁止鼠标唤醒,让移动、点击鼠标不再能唤醒电脑 这两条允许和禁止命令与...
  • 鼠标: HID-compliant mouse 鼠标: Synaptics PS/2 Port TouchPad   音频  声卡: 瑞昱 ALC269 @ 英特尔 82801I(ICH9) HD Audio Controller 声卡: 瑞昱 ALC269 @ Nvidia HD Audio Controller 2.安装过程 ...
  • USB 枚举信息详解-DriverMonkey

    千次阅读 2014-03-29 10:12:47
     (18) HID-compliant mouse  (25) Linux File-CD Gadget [ROM=0000]  Phase - Phase Type  CTL USB control transfer  IN Data in transfer  USTS USB status  Data - Hex dump of the data ...
  • http://www.usblyzer.com/usb-human-interface-device-hid-class-decoder.htm ...Human Interface Device (HID) Class Decoder Human Interface Device (HID) class is one of the most frequently used USB class...

空空如也

空空如也

1 2 3 4 5 ... 16
收藏数 306
精华内容 122
关键字:

hid-compliantmouse