Re: [問題] Bluetooth4.0背景執行問題
因為你的 peripheral 的 Advertisement裡面沒有 "180A" 這個service uuid.
Advertisement長度是很有限的, 所以通常 "Device Information"
這種servvice uuid是不會放在Ad裡面去發的.
所以你要先確定你的 peripheral 是那一種 profile,
然後去看那個profile裡面有規定 Ad要發什麼,
通常都會帶 main service 的 uuid.
然後你再用 main service的uuid去scan, 就可以scan到了.
※ 引述《mew3133 (大雄)》之銘言:
: 各位我有個疑問....
: 我使用
: [self.centralManager scanForPeripheralsWithServices:nil
: options:nil];
: 可以搜尋到所有裝置
: 我改成搜尋特定UUID就搜尋不到裝置......請問我錯在哪裡QQ...已經卡了一個月了...
: NSArray *uuidArray=
: [NSArray arrayWithObjects:[CBUUID UUIDWithString:@"180A"], nil];
: [self.centralManager scanForPeripheralsWithServices:uuidArray
: options:nil];
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 203.69.87.123
討論串 (同標題文章)