心跳与状态

retained 心跳与 LWT 上下线。

7. 心跳与状态(state,retained)

见 §3.4。retained 消息保证新订阅者立刻能拿到设备最新在线状态;LWT 在网络断时由 broker 自动 publish online=false。