问题标签 [bluez]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
1 回答
6145 浏览

bluetooth - Bluetooth for ARM embedded linux

I'm struggling now for a few days to setup bluetooth services on an ARM embedded device running Linux. I'm using a bluetooth dongle connected via USB.

Let's start with the beginning. I had to compile myself all the required packages, and that means expat, dbus, zlib, libffi, glib, bluez-3.36-libs and bluez-3.36-utils (yeah 3.36, I know they're old but so is my cross-compiler), libopenobex-1.3, obexd-0.3, obexftp. Then I put the binaries and libs on the device. Also, bluetooth is enabled in kernel.

I'm able to activate the bluetooth using hciconfig hci0 up command, I can perform scan using hcitool scan, I can even ping with l2ping previously discovered devices.

What I want is to be able to transfer files between that ARM device and another bluetooth device using ftp protocol and here my problems begin.

  1. Are these the only tools that I need?

  2. After putting everything on the device, I turn on bluetooth using hciconfig hci0 up, then I start dbus daemon using dbus-launch and after these I try to start obexd. When I run dbus-launch, it prints the values for DBUS_SESSION_BUS_ADDRESS and some pid and next when I try to start obexd it asks me to set the DBUS_SESSION_BUS_ADDRESS. Is this normal because I read that you have to set this only for test purposes? What is the default (real) dbus session bus address? How should I properly configure dbus?

  3. I tend to think that the problem is in the pairing process, when the two bluetooth devices are trying to authenticate. How can I do this from command line as this is all that I have (no GUI)?

  4. Could you please present me the detailed step to follow in order to achieve my goal. I tried to learn more about them from the Internet and also I tried to find these steps online but I could not find what I need.

  5. Could you please explain me the difference between obexd, obexd-client, obexd-server, obex-data-server, obexftp? Are they meant to be used together or they offer the same functionalities? I could not clarify this from their man pages.

I know this is a really long post with a lot of questions, but I don't have experience with bluetooth and I'm under time pressure to solve this. Any help would be kindly appreciated.

0 投票
1 回答
13704 浏览

python - RFCOMM 没有在 Debian 上使用 PyBluez 配对?

我正在尝试使用 Python 创建一个无需配对即可使用的 RFCOMM 服务器进程。最初,我从 PyBluez 文档中获取了两个示例脚本:

服务器:

客户:

当我在 Windows 上运行服务器脚本时,一切都如我所愿——无需配对。在这个阶段,一切看起来都非常有希望。

但是,我需要在 Debian Squeeze 下运行服务器进程。当我在 Debian 上测试时,客户端连接被拒绝。在 syslog 中有来自 bluetoothd 的消息,显示链接密钥请求和 PIN 请求失败。

版本信息:

  • PyBluez 0.18
  • 蟒蛇2.6
  • 蓝兹 4.66
  • 连接两端的蓝牙 v2.0 硬件

这个讨论似乎表明,如果我可以调整服务器套接字的安全级别,那么配对将被禁用,一切都会按预期工作。不过,我不清楚如何使用 PyBluez 来做到这一点,或者即使有可能。

我已经尝试使用各种 BT_SECURITY* 常量调用 setsockopt(),以及获取最后一个 PyBluez 并调用 setl2capsecurity(),但未能取得任何进展。

这可以通过 PyBluez 实现吗?

0 投票
3 回答
642 浏览

linux - Tizen 支持哪种 BT 堆栈?

我想知道 Tizen 是否支持 BT,如果支持,它是否使用开源 bluez 协议?

另外,我想知道在 Tizen 中从哪里开始挖掘蓝牙。

提前致谢!

0 投票
1 回答
1207 浏览

bluetooth - HID 连接到没有 SDP 记录的远程设备

要将 HID 配置文件连接到鼠标/键盘,需要连接具有 psm 17 和 19 的 HID_CONTROL 和 HID_INTERUPT 通道。我们使用 HID 的 SDP 记录查找信息,然后建立 L2CAP 连接以连接通道。

bluez 中是否有任何实用程序可以帮助我连接输入设备。我的键盘/鼠标不支持 SDP 记录,所以当我使用 dbus 信号(连接到输入设备)时,它会失败。bluez 中是否提供了任何库,我可以使用 BD_ADDR 和 PSM 编号连接到设备,而无需通过 SDP 查询设备

0 投票
4 回答
31096 浏览

c - Linux 上 C blueZ 中的蓝牙配对

我找不到任何关于如何在使用 BlueZ 蓝牙库的 C 语言编写的程序中配对 Linux 上的蓝牙设备的参考资料。我已经设法进行 HCI 级别查询以获取设备以及它们的 RSSI 级别(在设备发现期间),但目前我被困住了。我看到了将 DBUS api 用于 blueZ-simple-agent 的建议——但有没有办法避免这种情况,只使用 BlueZ 的一些 C 级方法?

0 投票
2 回答
7399 浏览

linux - 无需 GUI 的蓝牙配对

我需要在 Linux 服务器上使用 USB 蓝牙加密狗。实际上它可以工作,我可以发现其他蓝牙设备,但如果我尝试连接其中一个设备(使用rfcomm),它会显示Can't connect RFCOMM socket: Connection refused

我认为问题在于配对,因为当我在桌面系统上键入相同的命令时,它会在对话框窗口(而不是终端)中向我询问密码。所以问题是:如何在没有桌面环境的情况下配对设备?谢谢指教。

0 投票
1 回答
7465 浏览

windows - 希望在 Windows 中编写蓝牙“hcitool”等效项

我在 Linux 中使用了 Bluez 蓝牙堆栈,它带有一个方便的实用程序“hcitool”。希望在 Windows 中构建具有相同或等效功能的类似功能。具体来说,'hcitool name < MAC >',显示指定设备是否在范围内。任何指导将不胜感激。

我有带有 Visual Studio 2010 的 Windows SDK v7,使用 C/C++

谢谢。

0 投票
0 回答
3594 浏览

android - 在 Android 平板电脑上安装蓝牙 SPP

我无法从我的 Android JellyBean 平板电脑上找到我的蓝牙打印机。但是这两种设备都可以从我的 macbook 中找到。蓝牙打印机规范说它使用 SPP(串行端口配置文件)进行通信。sdptool 输出如下

尝试添加SP

添加 SP 后,使用 sdptool 浏览列表显示 SP 服务

我尝试使用此设置进行发现,但仍然找不到蓝牙打印机。

我不确定 SP 是否安装在我的 Android 上的 bluez 堆栈上,因为我找不到 hcitool 或 rfcomm 可执行文件。

这是我的 /etc/bluetooth 文件夹中的列表

0 投票
0 回答
508 浏览

bluetooth - 在 BlueZ 中设置 L2CAP 流模式

我需要在启用流模式的 BlueZ 上创建一个简单的 L2CAP 连接。有谁知道我如何切换模式?目前,连接已启用重传,我需要取消所有重传。

0 投票
2 回答
15730 浏览

python - Arduino 和 PyBluez 之间的蓝牙通信

我正在尝试使用 Python PyBluez 在 Arduino Uno 板(带有蓝牙屏蔽)和我的 Linux 操作系统之间建立蓝牙通信。

我已成功将笔记本电脑与 Uno 配对。我可以连接到板子,但是板子没有读取正在发送的数据,也无法发送数据。

这是Arduino草图

还有我的 Python 模块:

我有 Arduino IDE 1.0.4,我的笔记本电脑运行的是 Ubuntu 11.10