您的位置:首页 > 其它

Ubuntu15.10 执行sdptool add A2SNK没任何提示

2016-02-14 14:24 489 查看
晕哥516333132@QQ.com 原创

转载请注明: /article/10549429.html

2016-02-14

昨天在ubuntu 15.10 调试A2DP SNK 的时候,

执行 sdptool add A2SNK, 发现没任何错误提示,

我以为A2SNK写错了, 结果 sdptool add SP, 还是一样的问题。

执行 echo $, 输出 255(根据经验应该是 return -1), 应该是没成功了。

权限不够? 加上sudo 还他妈的一样,

sdptool del SP, 居然说服务不存在,

实在没办法了,下载blueZ 最新5.37 源码编译

非常顺利的产生了 sdptool 文件,

执行 sdptool add A2SNK 结果还是一样,

跟踪源码, 发现 sdp_connect() 函数返回值是NULL指针,程序直接退出了。

而后发现别的地方调用了 sdp_connect() 会打印出错误提示:

Failed to connect to SDP server on FF:FF:FF:00:00:00


唯独执行add 这个命令的时候没打印, 就直接退出了, SHIT !!!!

根据上面的关键字, 放狗搜索,发现不止我一个人有这个问题

http://stackoverflow.com/questions/22739906/registering-a-sdp-service-with-bluez-on-fedora-20

解决方法:

You have to start bluetoothd with --compat flag. I don't know if this is the "Fedora way" of doing it, but I edited /usr/lib/systemd/system/bluetooth.service and included the flag in the ExecStart option.

ExecStart=/usr/libexec/bluetooth/bluetoothd --compat
Then

$ systemctl daemon-reload
$ systemctl restart bluetooth.service


bluetoothd守护程序要执行兼容模式,

我试了一下,成功了!

但是没搞明白原因。
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: