首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Raspberryy pi 3 BLE设备

Raspberryy pi 3 BLE设备
EN

Stack Overflow用户
提问于 2017-12-26 15:25:36
回答 1查看 578关注 0票数 0

我刚接触android。我有Raspberry pi 3设备。我可以通过经典的Bluetooth.now将移动设备连接到Raspberry pi 3。我对Raspberry如何通过蓝牙连接移动设备和Raspberry感到困惑。低energy.we可以将BLE设备连接到安卓设备,并可以编写Characteristics.now我想在Raspberry pi 3 like中做同样的事情(心率监视器,MI频段2)

EN

回答 1

Stack Overflow用户

发布于 2017-12-28 19:57:46

  1. 使用程序执行此操作

您可以使用DBus调用以编程方式完成此操作。DBus是linux中使用的一种进程间通信方法。您可以使用不同语言的DBus绑定来执行DBus调用和操作。以下是帮助您入门的几个链接:

代码语言:javascript
复制
- DBus tutorial - [https://dbus.freedesktop.org/doc/dbus-tutorial.html](https://dbus.freedesktop.org/doc/dbus-tutorial.html)
- BLE DBus API - [https://elinux.org/images/3/32/Doing\_Bluetooth\_Low\_Energy\_on\_Linux.pdf](https://elinux.org/images/3/32/Doing_Bluetooth_Low_Energy_on_Linux.pdf)

从终端使用Gatttool的

Gatttool是一个终端工具,就像hcitool一样。您可以使用以下命令使其正常工作:

代码语言:javascript
复制
- **hcitool lescan**   Gives you the list of nearby Low Energy Devices
- **gatttool -b** _**mac\_adress\_of\_le\_device**_ **-I**   gives you an interactive session with the mentioned LE device
- _From the interactive session_ give **connect** to connect to the device
- **primary** to get the primary services. 
- From this result, you can use the _handle_ values to get the list of characteristics of a specific service. **characteristics** _**handle**_
- To get the _value_ of a characteristic use **char-read-hnd** _**handle**_
- To get the _characteristic descriptor_, use **char-desc** _**handle**_
- to write to a characteristic **char-write-req** _**handle**_ _**value**_

希望这能有所帮助!

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/47975263

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档