[BLE] State Machine and GAP Roles

在一般 BLE 裝置中, 不同的連線階段也扮演不同角色,
一般來說, 可以分成這四種 GAP Roles:

GAP RoleDescription
BROADCASTERA device that only sends advertising events.
OBSERVERA device that only receives advertising events.
PERIPHERALA device that accepts the establishment of an LE physical link using the connection establishment procedure.
CENTRALA device that supports the Central role initiates the establishment of a physical connection.

其中, Broadcaster 和 Observer 為一對, 進行 adverting 通訊,
Peripheral 和 Central 為一對, 進行資料傳輸,
為了表示此 4 種 GAP 腳色, BLE 可以表示為以下狀態機 (State Machine) 的轉換:


其中, 我們可以看到 Connection 和 Advertising 分屬不同的狀態,
以 one-hot state machine 的概念來說, 在一個時間內應只屬於一個狀態,
至於上述 4 個 GAP Role 則使用了狀態機不同的部分,
如下圖所示:


其中, Peripheral 和 Central 此對連線, 多了進入 Connection 狀態,
在原本 advertising-connection-standby 的流程中,
advertising 是為了之後建立連線進行準備,
主要工作為連線 UUID 的確認與交換之後的 hopping-sequence,
進入 Connection 狀態後, 就將根據 hopping-sequence 跳頻,
也就不會主動在 advertising channel 上進行廣播.

當然, 上述的流程是原本 BLE 的設計,
在各家的實作中, 也加入了一些特殊機制, 例如: GAP Role 的共存,
我們將在下一篇文章中, 以 TI 的實作為例,
介紹 GAP Role 存的機制以及其限制.

留言

熱門文章

LTE筆記: RSRP, RSSI and RSRQ

[WiFi] WiFi 網路的識別: BSS, ESS, SSID, ESSID, BSSID

LTE筆記: 波束成型 (beamforming) 和天線陣列