smartconfig流程图,实时预览需要装插件，可见仓库中的jpeg
```plantuml
@startuml
<style>
activityDiagram {
  BackgroundColor #33668E
  BorderColor #33668E
  LineColor #33668E
  FontColor white
  FontName arial

  diamond {
    BackgroundColor #ccf
    ' LineColor #00FF00
     LineColor #33668E
    FontColor #33668E
    FontName arial
    FontSize 15
  }
  arrow {
    FontName arial
    FontSize 15
    LineColor #33668E
  }
  partition {
    LineColor #33668E
    BorderColor #33668E
    FontColor #00FF00
    RoundCorner 10
    BackgroundColor PeachPuff
  }
  note {
    FontColor Blue
    LineColor Navy
    BackgroundColor #ccf
  }
}
document {
   BackgroundColor transparent
}
</style> 
start
:WIFI_CONF_START;
note right:配网初始化
:smartconfig一键配网;
->教程、选择家庭wifi并输入密码;
:走入sdk逻辑;
->通用wifi协议base逻辑;
:WIFI_CONF_START;
:PROTOCOL_START;
note left: 此处开始所有错误会走入WIFI_CONF_FAIL
:PROTOCOL_Detail;
note right: Welcome Esptouch smartconfig in weapp(乐鑫协议)
:PROTOCOL_Detail;
note right: 广播方式
if (platform === 'android') then (yes)
  :PROTOCOL_Detail;
  note right:start smartconfig in no promise settimeout;
note left: 安卓上因promise和settimeout冲突，使用无promise版本
  else(no)
      :PROTOCOL_Detail;
    note right: start smartconfig in promise settimeout
  endif
  ->step1.生成guide code、data code
step2.guide code广播发送
step3.监听udpserver收到的数据是否满足要求;
:PROTOCOL_Detail;
note right: __listenAsyn() start
:PROTOCOL_Detail;
note right: send gc code
-> udpserver收到消息简单检验长度;
repeat
  repeat
    :udpserver监听消息;
  backward:长度不正确;
  repeat while(消息长度正确?)
  -> 正确;
    :PROTOCOL_Detail;
    note right:RECIEVE_MSG
     :PROTOCOL_Detail;
    note right:Int8Array
    :PROTOCOL_Detail; 
    note right: expectOneByte: xx
    :PROTOCOL_Detail;
    note right: receiveOneByte: xx
repeat while(expectOneByte === reveiveOneByte?)
->yes;
:PROTOCOL_Detail;
note right:receive correct broadcast
->timeout>0;
:PROTOCOL_Detail;
note right: mSocketServer's new timeout is milliseconds;
:PROTOCOL_Detail;
note right: receive correct broadcast
->获取esptouch的结果list;
:PROTOCOL_Detail;
note right: PUT_ESPTOUCH_RESULT:count = xx
  if(结果没被添加过) then(yes)
    :PROTOCOL_Detail;
    note right: PUT_ESPTOUCH_RESULT:put one more result...
  else(no)
    :重复监听消息及处理过程;
  end;
  endif
    if(符合要求的list长度<expected) then(yes)
      :重复监听消息及处理过程;
    end;
    else(no)
      :PROTOCOL_Detail;
      note right: __listenAsyn() finish;
    endif
:PROTOCOL_Detail;
note right: 'GET_RESULT'
:PROTOCOL_SUCCESS;
  ' endif
  :BUSINESS_START;
  :CREATE_UDP_CONNECTION_START;
  :CREATE_UDP_CONNECTION_SUCCESS;
  :BUSINESS_QUERY_TOKEN_STATE_START;
  :BUSINESS_QUERY_TOKEN_STATE_SUCCESS;
  :BUSINESS_ADD_DEVICE_START;
  :BUSINESS_ADD_DEVICE_SUCCESS;
  :BUSINESS_SUCCESS;
  :WIFI_CONF_SUCCESS;
  end;
@enduml


