Windows/.Net 中的蓝牙 API? [英] Bluetooth APIs in Windows/.Net?

查看:16
本文介绍了Windows/.Net 中的蓝牙 API?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在编写一个蓝牙扫描仪,用于定位和识别本地附近的移动设备.这是我可以使用 C# 完成的事情,还是我需要深入到 C/C++ API 中?我的应用程序面向 Windows XP 和 Vista.指针表示赞赏.

I am in the process of writing a Bluetooth scanner that locates and identifies mobile devices in the local vicinity. Is this something that I can accomplish using C#, or do I need to drop down into the C/C++ APIs? My application is targeting Windows XP and Vista. Pointers are appreciated.

谢谢!

推荐答案

PC 上蓝牙的一个问题是有多个 BT 堆栈在使用,您永远无法完全知道在给定机器上可用哪个堆栈.最常见的是 Widcomm(现在是 Broadcom)和 Microsoft(出现在 XP 中,可能是其中的一个服务包).但是,一些 BT 硬件供应商封装了 BlueSoleil,一些使用 Toshiba.大多数加密狗都适用于 MS 堆栈,因此我见过的 .NET 库倾向于使用它.

One problem with Bluetooth on the PC is that there are several BT stacks in use and you can never quite know which one is available on a given machine. The most common ones are Widcomm (now Broadcom) and Microsoft (appeared in XP, maybe one of the service packs). However, some BT hardware vendors package BlueSoleil and some use Toshiba. Most dongles will work with the MS stack so the .NET libs I've seen tend to use that.

每个堆栈都有完全不同的方式来执行发现部分,您可以在其中浏览附近的设备并查询它们的服务.

Each of the stacks has a totally different way of doing the discovery part where you browse for nearby devices and inquire their services.

如果我今天必须选择一种方法,我可能会用 C++ 进行发现并为 .NET 添加一个接口.

If I had to pick one approach today I'd probably do the discovery in C++ and add an interface for .NET.

当我尝试使用 32feet.net 时,它运行得很好,但不支持 Widcomm 堆栈.

The 32feet.net stuff worked pretty well when I tried it but didn't support the Widcomm stack.

这篇关于Windows/.Net 中的蓝牙 API?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆