在Linux命令行中使用低功耗蓝牙 [英] Using Bluetooth low energy in linux command line
问题描述
我正在将Linux低功耗调制解调器与Linux配合使用.我正在使用命令行选项,即hcitool
.我可以使用以下命令找到设备:$ hcitool scan
I am working on using the Bluetooth low energy modem with Linux. I am using the command line option for that i.e. hcitool
. I am able to the find the devices using the command: $ hcitool scan
对我来说很好,我也可以使用:p广播我的设备
It is working fine for me, also I am able to broadcast my device using :
sudo hciconfig hci0 leadv
它也可以正常工作.但是我想向调制解调器设备添加可以被其他设备检测到的服务和特性.我已经尝试过sdptool add
,但是它对我不起作用.有谁知道如何使用ubuntu中的命令行工具向外围设备添加服务和特性?
It is also working fine. But I want to add the services and characteristic to the modem device which can be detected by other device. I have tried sdptool add
but it is not working for me. Does anyone know how to add the services and characteristics to the peripheral using the command line tools in ubuntu?
编辑:我的调制解调器正在广播,但无法浏览其他BLE设备的服务和特性.现在,我可以使用hcio name command
My modem is broadcasting but not able to explore the services and characteristic to the other BLE device. Now I am able to set the name of device using hcio name command
现在,我可以通过同时运行sudo hcidump
命令来呈现服务和特征.但是我无法跟踪从何处获得这些服务和特性.可以肯定地观察到这些服务是从机器渲染的.
Now I am able to render the services and characteristic, by simultaneously running sudo hcidump
command. But I am not able to track from where I am getting those services and characteristics. One definite observation is those services are rendering from the machine.
推荐答案
BLE中不存在SDP.而是使用广播/广告帧和GATT客户端/服务器.
SDP is absent in BLE. Broadcast/advertise frame and GATT client/server are used instead.
几个链接:
- BlueZ gatttool :命令行工具运行通用GATT程序
- BlueZ GATT的就绪配置文件
- GATT和DBUS示例
- Bluetooth Low Energy:监听Linux中的通知/指示
- http://comments.gmane.org/gmane.linux.bluez .kernel/29547
- BlueZ gatttool: command line tool to run common GATT procedures
- BlueZ GATT's ready profiles
- hint: DBUS
- GATT and DBUS example
- How can I connect to the FitBit Zip over Bluetooth 4.0 LE on Linux with bluez?
- Bluetooth Low Energy: listening for notifications/indications in linux
- http://comments.gmane.org/gmane.linux.bluez.kernel/29547
这篇关于在Linux命令行中使用低功耗蓝牙的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!