Bluetooth Page scan and Inquiry scan

Page/page scan - The initial phase of the connection procedure where a
device transmits a train of page messages until a
response is received from the target device or a timeout
occurs.
Inquiry scan   - A procedure where a Bluetooth device listens for inquiry
messages received on its inquiry scan physical channel.

1, Inquiry scan
用hcidump -Xt跟蹤hci sniffer package, 發現host做一個Inquiry scan,就是
向controller發送一個HCI Command: Inquiry (0x01|0x0001) 命令,然後controller
不斷向host返回event結果,10秒鐘左右結束 -- Inquiry Complete .

在Ubuntu上可以用hcitool scan 命令發送一個Inquiry scan .

2, Page scan
在PC或手機上藍牙管理中搜索周圍的藍牙設備(device discovery),會進行page scan。
Page scan其實是不停地進行多次Inquiry scan, 直到外部某個條件才中斷。
Page scan中的兩次Inquiry scan間隔一般是30秒。

3, PC上 bluetooth device類型是BR/EDR, 它是週期性監聽在一個inquiry scan physical channel上,
並在此channel上回應inquiry scan. 所以它表現出“可被發現(visible)”不會超時。
而 phone上 bluetooth device類型是LE,它有“可被發現(visible)”超時設置,當visible設爲可見後,
它在一定超時時間內(1-2分鐘)向外廣播發送connectable or scannable的event消息,這樣能被其它
藍牙設備搜索到。 若超時,visible又被設爲不可見的了。別的設備就不能搜索到它。

4,兩個手機放在一起,藍牙可能有干擾,就只有一個能被搜索到。一般隔開1米左右就行。

5, hcitool scan 和 hcitool inq 區別
hcitool scan 命令會顯示所找到的藍牙設備的物理地址、名稱

hcitool inq 命令會顯示哪些 被找到的藍牙設備物理地址、clock offset和類型







發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章