看板 Python 關於我們 聯絡資訊
最想用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://www.ptt.cc/bbs/Python/M.1496826368.A.120.html
s860134: 假設你已經知道你裝置的 mac 了, dev 是 ScanEntry06/07 22:38
s860134: https://goo.gl/UHspzV 裡面有些可以判斷的數值06/07 22:39
s860134: [dev for dev in devices if dev.addr in mac_list]06/07 22:49
s860134: 在 blescan.py#L127 原本巡行所有找到的 ScanEntry06/07 22:49
s860134: 你在這之前把 devices 篩到只有你要的 device 即可06/07 22:50
謝謝你,我明天試試看! ※ 編輯: James840617 (118.168.23.106), 06/07/2017 23:30:37