适用于 Windows 7.0 的蓝牙低功耗 API

Bluetooth Low Energy API for Windows 7.0(适用于 Windows 7.0 的蓝牙低功耗 API)
本文介绍了适用于 Windows 7.0 的蓝牙低功耗 API的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Windows 8 公开了一个 API 来与蓝牙低功耗(智能)设备进行通信,但该 API 在以前的 Windows 版本中不可用,那么如何在 Windows 7 上与 BLE 加密狗进行通信?

Windows 8 exposes an API to communicate to Bluetooth Low Energy (Smart) devices, but this API is not available in previous versions of Windows, so how can I communicate with a BLE dongle on Windows 7?

我目前使用的 BLE 加密狗 (BLED112) 公开了一个虚拟串行端口,您可以使用他们的自定义专有 API 通过该端口发送命令,但如果我在我的软件中实现此功能,它将无法与其他制造商的加密狗一起使用.

The BLE dongle I'm currently using (BLED112) exposes a virtual serial port, over which you can send commands using their custom proprietary API, but if I implement this in my software, it will not work with dongles from other manufacturers.

那么有没有一种方法可以在独立于制造商的 Windows 7 上与 BLE 设备进行通信?

So is there a way to communicate with BLE devices on Windows 7 which is manufacturer-independent?

推荐答案

原来有人找到了解决方法.基本上这个想法是使用 Windows BLE API(在 Windows 7 上不起作用),而是直接与加密狗对话.您可以使用 WinUSB(用户空间 USB 驱动程序)来实现.可以使用 Zadig 安装该驱动程序.

So it turns out that some people have found a workaround. Basically the idea is to not use the Windows BLE API (which doesn't work on Windows 7) but instead to talk to the dongle directly. You can do that using WinUSB (a user-space USB driver). That driver can be installed using Zadig.

这是一个例子:

https://github.com/sandeepmistry/node-bluetooth-hci-socket#windows

它具有 C++ 代码,可让您发送 HCI 命令.还有一个关于如何将 HCI 用于更高级别 BLE 的 Node 库:

It has C++ code to let you send HCI commands. There is also a Node library of how to use HCI for higher level BLE stuff:

https://github.com/sandeepmistry/bleno

我不知道是否有任何非 JS 库可以做到这一点,但我认为无论如何将 Bleno 转换为 C++ 并不难.

I don't know if there are any non-JS libraries that do the same, but I don't think it would be hard to convert Bleno to C++ in any case.

这篇关于适用于 Windows 7.0 的蓝牙低功耗 API的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!

本站部分内容来源互联网,如果有图片或者内容侵犯您的权益请联系我们删除!

相关文档推荐

c# Generic Setlt;Tgt; implementation to access objects by type(按类型访问对象的C#泛型集实现)
InvalidOperationException When using Context Injection in ASP.Net Core(在ASP.NET核心中使用上下文注入时发生InvalidOperationException)
quot;Overflowquot; compiler error with -9223372036854775808L(编译器错误-9223372036854775808L(Q;溢出Q))
Visual Studio 2010 ReportViewer Assembly References(Visual Studio 2010 ReportViewer程序集引用)
Weird behaviour when I open a reportviewer in WPF(在WPF中打开报表查看器时出现奇怪的行为)
how do i pass parameters to aspnet reportviewer(如何将参数传递给aspnet report查看器)