2.3. 消息类型

通信消息有两种类型: Request 和 Response。他们分别是通过BL的 Write 和 Notification Characteristic 来传输。

具体关系如下表:

消息类型

方向

Write Characteristic

Notification Characteristic

Request

网关 -> 手环

Y

Response

网关 <- 手环

Y

2.3.1. 向手环发送命令

!pragma teoz true
participant 网关 as G #cyan
box 手环 #LightBlue
box BLE Core
participant Write as W #khaki
participant Notification as I  #lightgreen
end box
participant Application as M #deepskyblue
end box

autonumber
...
note over G,I: BLE已连接
G ->(10) W : CougarRequest
W -> M :
M -> I :
G (10)<- I : CougarResponse