2017-11-22 8 views
1

스캔하여 Ti 센서 디바이스와 연결할 수 있지만 서비스 요청시 작동하지 않습니다.블루투스 센서 디바이스 (Pycom)에서 서비스를받을 수 없습니다

bluetooth = Bluetooth() 
bluetooth.start_scan(5) 
while bluetooth.isscanning(): 
adv = bluetooth.get_adv() 
if adv: 
if(str(binascii.hexlify(adv.mac).decode()) == '78a50454b267'): 
conn = bluetooth.connect(adv.mac) 
print(type(conn)) 
service = bluetooth.get_service() 
print("got service", service) 

서비스가 인쇄되지 않습니다. 루프가 응답을 멈추었습니다.

심지어 내가 너무 많은 GET 서비스 방법을 시도했습니다.,

어떤 가져 오기 기능을 놓쳤다. ? GATT 연결 문제가 있습니까? ? .gatt 및 해당 서비스 특성을 가져 오는 방법 ??

답변

2

수면 시간을 사용하고 아래의 사전 데이터를 얻으려고하면 모든 일이 ... 건배 !!!

services = dict() 
      time.sleep(0.050); 
      services = conn.services()