简体   繁体   English

访问未定义使用情况页面的HID:可能在UWP内?

[英]Access a HID that does not define the usage page: possible within UWP?

My question. 我的问题。 I have a basic HID that does not define any Usage Page and I need to communicate with it from a UWP application. 我有一个基本的HID,没有定义任何使用页面,我需要从UWP应用程序与它进行通信。 Something really simple: I just need to write/read few bytes from an eeprom integrated in the HID. 非常简单:我只需要从集成在HID中的eeprom写入/读取几个字节。 Can it be done? 可以吗?

What I have done so far. 到目前为止我做了什么。 I looked for the following solutions: 我找了以下解决方案:

Plan A. Write a UWP code to access the device. 计划A.编写UWP代码以访问设备。 The Windows.Devices.HumanInterfaceDevice namespace allows UWP applications to access HIDs. Windows.Devices.HumanInterfaceDevice命名空间允许UWP应用程序访问HID。 However there are limitations... among these, the device is required to define a Usage Page within the vendor range 0xFF00-0xFFFF. 但是存在一些限制......其中,设备需要在供应商范围0xFF00-0xFFFF内定义使用情况页面。 So I soon realized this probably cannot work and I expect to run in to a HID_USAGE_PAGE_UNDEFINED problem. 所以我很快意识到这可能无法工作,我希望遇到HID_USAGE_PAGE_UNDEFINED问题。

https://docs.microsoft.com/en-us/previous-versions/windows/apps/dn263140(v=win.10) https://docs.microsoft.com/en-us/previous-versions/windows/apps/dn263140(v=win.10)

Plan B. I already have some code that works with this device on Windows 10, but it comes from a WPF application and it is based on hid.dll. 计划B.我已经有一些代码可以在Windows 10上使用此设备,但它来自WPF应用程序,它基于hid.dll。 It looks like I cannot just integrate this kind of code in a UWP application: 看起来我不能只在UWP应用程序中集成这种代码:

Can I Use Windows Hid API Calls in UWP (HidD_GetPreparsedData)? 我可以在UWP中使用Windows Hid API调用(HidD_GetPreparsedData)吗?

Any workaround? 任何解决方法? suggestion?... is it just plain impossible? 建议?......这根本不可能吗? I am bound to using UWP. 我一定会使用UWP。

I ran across this before with UWP. 我之前遇到过UWP。 If you are using UWP for an IOT device, this may not work you would need an enterprise version of the IOT device, reason being is you could integrate your HUB dll with a .netframework service running in the background and use signal R to relay your package from your service running in the background to your UWP project. 如果您使用UWP作为物联网设备,这可能无法运行您需要企业版的物联网设备,原因是您可以将您的HUB DLL与后台运行的.netframework服务集成并使用信号R来中继您的从您在后台运行的服务打包到您的UWP项目。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM