本篇结合着HCI TX,RX log解析蓝牙初始化的过程 over BCSP protocol
BCSP packet format如连接
记录一下BCSP的分析详细流程:
BCSP先有一个link establish的过程(建立过程芯片会通过uart和平台交互,分四种封包格式,如图)
建立过程分三个阶段:
1.State 1 - Shy
•Don’t allow any otherprotocols
•Send SYNC’s every sooften
–Controlled by PSKEY_BCSP_LM_TSHY
•If you receive a SYNC
–Send a SYNC RESPONSE
•If you receive a SYNCRESPONSE
–Change to Curious State
2.State 2 - Curious
•Send CONF’s every sooften
•If you receive a SYNC
–Reply with a SYNC RESPONSE
•If you receive a CONF
–Reply with a CONF RESPONSE
•If you receive a CONFRESPONSE
–Change to Garrulous State
3.State 3 - Garrulous
•If you receive a CONF
–Reply with a CONF RESPONSE
•If you receive a CONFRESPONSE
–Ignore it
•If you receive a SYNC
–Other end has reset
–Reset stack if possible
–Then change to shy state
过程大概如图表示为: