作者James840617 (James Li)
看板Python
标题[问题] Raspberry pi 3 蓝牙Characteristic以及UUID
时间Wed Jun 7 17:06:04 2017
最想用raspberry pi 3的蓝芽功能收集资料
首先步骤是想先能抓取到蓝芽的Characteristic以及UUID
於是用现成code达到了这一步
https://github.com/IanHarvey/bluepy/blob/master/bluepy/blescan.py
(已造作者的开发环境并架设完成)
http://i.imgur.com/s7bcu2Q.jpg
这是执行後的结果
确实已达到我要的目的
(我的装置是那两个蓝色gm22AD、gmFFFF)
但现在我想要”只显示我两个装置的资讯Characteristic以及UUID”
目前构想是在def dump_services(dev):这段加一个判断式if,else
但不确定是不是加在这就没问题
http://i.imgur.com/2P5ysId.jpg
Code在这里:
https://github.com/IanHarvey/bluepy/blob/master/bluepy/blescan.py
https://github.com/IanHarvey/bluepy/blob/master/bluepy/blescan.py
请求开导..
--
※ 发信站: 批踢踢实业坊(ptt.cc), 来自: 111.248.90.237
※ 文章网址: https://webptt.com/cn.aspx?n=bbs/Python/M.1496826368.A.120.html
1F:→ s860134: 假设你已经知道你装置的 mac 了, dev 是 ScanEntry06/07 22:38
3F:→ s860134: [dev for dev in devices if dev.addr in mac_list]06/07 22:49
4F:→ s860134: 在 blescan.py#L127 原本巡行所有找到的 ScanEntry06/07 22:49
5F:→ s860134: 你在这之前把 devices 筛到只有你要的 device 即可06/07 22:50
谢谢你,我明天试试看!
※ 编辑: James840617 (118.168.23.106), 06/07/2017 23:30:37