32feet.net HOWTO发现在C#中附近的蓝牙设备异步 [英] 32feet.net howto discover nearby bluetooth devices async in c#

查看:1050
本文介绍了32feet.net HOWTO发现在C#中附近的蓝牙设备异步的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图使用 32feet.NET 蓝牙库在C#应用程序来检测附近的设备。我的小应用程序的目的是让PC知道是谁在利用人们对手机的蓝牙功能房间。

I am trying to use the 32feet.NET bluetooth library in a C# application to detect nearby devices. The purpose of my little application is to let the PC know who is in the room using the bluetooth feature of people's mobile phones.

做这样的事情是让我想跟踪连接一次设备,然后连续检查,如果他们可以通过蓝牙进行检测的最好方法。

The best way to do something like this would be to let the devices I want to "track" connect once, then continuously check if they can be detected via bluetooth.

现在我的问题:


  1. 我需要配对或与我申请认证的设备?如何使用32feet.NET?

  1. Do I need to pair or authenticate a device with my application? How to do this in C# with 32feet.NET?

如何不断检查范围内的设备并将它们与存储设备?

How to continuously check for devices in range and compare them to the stored devices?

我知道,这一切都是可能的库文件中,但它确实是很难读,我和大多数的例子似乎是在VB,我不知道,发现很难转化为C#(特别是当它涉及到AsyncCallbacks等)。

I know that all this is probably in the library documentation, but it is really hard to read for me and most of the examples seem to be in VB which I don't know and find hard to translate to C# (especially when it comes to AsyncCallbacks and the like).

我会很高兴,如果有人可以给我在正确的方向一推!

I would be really glad if someone could give me a push in the right direction!

推荐答案

这是不是一个答案,但我不能够把这么多code在评论section.Chagne code的这些行

This is not an answer, but i wasn't able to put this much code on comment section.Chagne these lines of code

//continue listening for other broadcasting devices
listener.BeginAcceptBluetoothClient(this.BluetoothListenerAcceptClientCallback, listener);

// create a connection to the device that's just been found
BluetoothClient client = listener.EndAcceptBluetoothClient();


// create a connection to the device that's just been found
BluetoothClient client = listener.EndAcceptBluetoothClient();

// continue listening for other broadcasting devices
listener.BeginAcceptBluetoothClient(this.BluetoothListenerAcceptClientCallback, listener);

基本上,改变code的顺序..
至于每次调用BeginXXXX方法必须有下一EndXXXX。及以上code,U试图BeginAcceptBluetoothClient在 已开始BeginAcceptBluetoothClient。

Basically, change the sequence of code..
As for every call to BeginXXXX method must have next EndXXXX. And all above code, u are trying to BeginAcceptBluetoothClient over already began "BeginAcceptBluetoothClient".

希望你理解。

这篇关于32feet.net HOWTO发现在C#中附近的蓝牙设备异步的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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