蓝牙 - >服务发现失败 [英] Bluetooth -> service discovery failed

查看:195
本文介绍了蓝牙 - >服务发现失败的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在写这是能够与电脑进行通信的应用程序。我已经使用了SDK 2.1的蓝牙功能。

我能找到的设备,让他们的MAC地址,创建一个<一个href="http://en.wikipedia.org/wiki/Bluetooth_protocols#Radio_frequency_communication_.28RFCOMM.29">RFCOMM插座,但是当我开始连接,我得到了以下错误消息。

  

服务发现失败。

  1. 是因为 UUID 这是不是对我的申请,我的电脑上的一样吗?它
  2. 我怎样才能让我的电脑上正确的UUID?

如果我写了一个这样的应用程序,是我的的Nexus One 中的客户端或服务器?

解决方案

好了,我得到了同样的问题,但我想我可以回答一些您的问题。如果您的电脑打开了SPP端口,例如,通过使用添加的sdptool = --channel 3 SP你的Andr​​oid手机将在客户端打开一个套接字,并与此套接字连接到服务器(PC或其他蓝牙设备,例如,全球定位系统,鼠标等)。

您可以通过阅读这篇文章的 蓝牙获得此信息的,客户端的定义,我才拿出这篇文章的。

如果您在服务器上打开一个SPP端口(电脑等),您所提供的标准服务中有一个分配给这个服务,这将是一个特殊的UUID:00001101-0000-1000-8000-00805F9B34FB 如果我没有记错。

所以,我认为我们应该得到一个Android开发一个合格的答卷。或者问这个问题上周四在IRC办公时间。

I'm writing an application which is able to communicate with my PC. I have used the Bluetooth functionalities of the SDK 2.1.

I can find devices, get their MAC address, create an RFCOMM socket, but when I start the connection, I get the following error message.

Service discovery failed.

  1. Is it because of the UUID which is not the same on my application and on my PC?
  2. How can I get the correct UUID on my PC?

If I write a such application, is my Nexus One the client or the server?

解决方案

OK, I got the same problem, but I think I can answer a few of your questions. If your PC opened an SPP Port, for example, by using "sdptool add --channel=3 SP" your Android phone would be the client opening a socket and connecting with this socket to the server (your PC or any other Bluetooth device, for example, GPS, mouse, etc.).

You can get this information by reading the article Bluetooth, the definition of a client did I take out of this article.

If you are opening an SPP Port on the server (your PC, etc.) you are offering a standard service an there is a special UUID assigned to this service this would be: "00001101-0000-1000-8000-00805F9B34FB" if I'm not mistaken.

So I think we should get an qualified answer from an Android developer. Or ask this question on Thursday during the IRC office hours.

这篇关于蓝牙 - &GT;服务发现失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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