Xamarin/Xamarin.forms 中的人机接口设备 (HID)
Human Interface Device (HID) in Xamarin/Xamarin.forms
我正在尝试开发一个应用程序来与蓝牙 LE crossplataform 进行通信。为此,我尝试从 xamarin.forms 开始并使用 2 个样本组
- Microchips 和 Monkey.robotic
的 android 应用示例
- 通过 HID 连接的 UWP 项目示例(我有一个设备可以将其用作加密狗服务)
微软的样本是:
https://github.com/oldnewthing/Windows-universal-samples/tree/master/Samples/CustomHidDeviceAccess
我将使用条件编译来处理这两种情况,但是当我尝试将它用于 Xamarin 时,一些 UWP 引用不起作用,它与 xamarin 和几个 await/async错误。
当我尝试强制另一方(如 .NET Standard 1.6)时,它也不起作用。
真正兼容(xamarin/xamarin.forms)2.+的是什么?
是否可以使用 xamarin.forms 设计进行 HID 连接?
提前致谢。
我觉得UWP项目应该引用HID项目。在 PCL(Xamarin.Forms) 项目中,您应该使用 DependencyService 来使用它
https://developer.xamarin.com/guides/xamarin-forms/application-fundamentals/dependency-service/introduction/
在 UWP 和 Android 上使用 Xamarin 连接到 Hid 设备绝对是可能的。 Xamarin.Forms 是一个 UI 库。它与 Hid 连接没有任何关系,但任何 Android 或使用 Xamarin.Forms 的 UWP 应用程序都可以连接到 Hid 设备。
这是一个连接到 Hid 设备的 Xamarin.Forms 示例:
Android:
https://github.com/MelbourneDeveloper/Trezor.Net/tree/master/src/Trezor.Net.XamarinFormsSample/XFAS
为 Xamarin 设计的用于连接设备的基础库称为 Hid.Net https://github.com/MelbourneDeveloper/Hid.Net。
我正在尝试开发一个应用程序来与蓝牙 LE crossplataform 进行通信。为此,我尝试从 xamarin.forms 开始并使用 2 个样本组
- Microchips 和 Monkey.robotic 的 android 应用示例
- 通过 HID 连接的 UWP 项目示例(我有一个设备可以将其用作加密狗服务)
微软的样本是: https://github.com/oldnewthing/Windows-universal-samples/tree/master/Samples/CustomHidDeviceAccess
我将使用条件编译来处理这两种情况,但是当我尝试将它用于 Xamarin 时,一些 UWP 引用不起作用,它与 xamarin 和几个 await/async错误。
当我尝试强制另一方(如 .NET Standard 1.6)时,它也不起作用。
真正兼容(xamarin/xamarin.forms)2.+的是什么?
是否可以使用 xamarin.forms 设计进行 HID 连接?
提前致谢。
我觉得UWP项目应该引用HID项目。在 PCL(Xamarin.Forms) 项目中,您应该使用 DependencyService 来使用它 https://developer.xamarin.com/guides/xamarin-forms/application-fundamentals/dependency-service/introduction/
在 UWP 和 Android 上使用 Xamarin 连接到 Hid 设备绝对是可能的。 Xamarin.Forms 是一个 UI 库。它与 Hid 连接没有任何关系,但任何 Android 或使用 Xamarin.Forms 的 UWP 应用程序都可以连接到 Hid 设备。
这是一个连接到 Hid 设备的 Xamarin.Forms 示例:
Android: https://github.com/MelbourneDeveloper/Trezor.Net/tree/master/src/Trezor.Net.XamarinFormsSample/XFAS
为 Xamarin 设计的用于连接设备的基础库称为 Hid.Net https://github.com/MelbourneDeveloper/Hid.Net。