~aleteoryx/muditaos

ref: 0e8b4c848e3f87f3bbb1f64ef7460cf56017b87f muditaos/module-bluetooth/doc/bt_on_off_state_diagram.svg -rw-r--r-- 10.4 KiB
0e8b4c84 — Lefucjusz [BH-2108] Fix misaligned charging symbol 3 months ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
<?xml version="1.0" encoding="UTF-8" standalone="no"?><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" contentScriptType="application/ecmascript" contentStyleType="text/css" height="519px" preserveAspectRatio="none" style="width:784px;height:519px;background:#F0F0F0;" version="1.1" viewBox="0 0 784 519" width="784px" zoomAndPan="magnify"><defs><filter height="300%" id="f1bsr8iakppdr5" width="300%" x="-1" y="-1"><feGaussianBlur result="blurOut" stdDeviation="2.0"/><feColorMatrix in="blurOut" result="blurOut2" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 .4 0"/><feOffset dx="4.0" dy="4.0" in="blurOut2" result="blurOut3"/><feBlend in="SourceGraphic" in2="blurOut3" mode="normal"/></filter></defs><g><!--MD5=[533c208fec6a0d647a17271f098caca5]
cluster Init--><rect fill="#FEFECE" filter="url(#f1bsr8iakppdr5)" height="379" rx="12.5" ry="12.5" style="stroke: #A80036; stroke-width: 1.5;" width="218" x="554" y="129"/><rect fill="#F0F0F0" height="313.7656" rx="12.5" ry="12.5" style="stroke: #F0F0F0; stroke-width: 1.0;" width="212" x="557" y="191.2344"/><line style="stroke: #A80036; stroke-width: 1.5;" x1="554" x2="772" y1="188.2344" y2="188.2344"/><line style="stroke: #A80036; stroke-width: 1.5;" x1="554" x2="772" y1="155.2969" y2="155.2969"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacingAndGlyphs" textLength="20" x="582" y="145.9951">Init</text><text fill="#000000" font-family="sans-serif" font-size="12" lengthAdjust="spacingAndGlyphs" textLength="146" x="559" y="168.9355">Initialization of BT stack</text><text fill="#000000" font-family="sans-serif" font-size="12" lengthAdjust="spacingAndGlyphs" textLength="162" x="559" y="182.9043">Creating BluetoothWorker</text><ellipse cx="667" cy="215" fill="#000000" filter="url(#f1bsr8iakppdr5)" rx="10" ry="10" style="stroke: none; stroke-width: 1.0;"/><rect fill="#FEFECE" filter="url(#f1bsr8iakppdr5)" height="64.2344" rx="12.5" ry="12.5" style="stroke: #A80036; stroke-width: 1.5;" width="162" x="586" y="286"/><line style="stroke: #A80036; stroke-width: 1.5;" x1="586" x2="748" y1="312.2969" y2="312.2969"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacingAndGlyphs" textLength="90" x="622" y="303.9951">WorkerSetup</text><text fill="#000000" font-family="sans-serif" font-size="12" lengthAdjust="spacingAndGlyphs" textLength="142" x="591" y="328.4355">Settings fetch &amp; setup</text><text fill="#000000" font-family="sans-serif" font-size="12" lengthAdjust="spacingAndGlyphs" textLength="94" x="591" y="342.4043">BT driver setup</text><rect fill="#FEFECE" filter="url(#f1bsr8iakppdr5)" height="50.2656" rx="12.5" ry="12.5" style="stroke: #A80036; stroke-width: 1.5;" width="144" x="586" y="434"/><line style="stroke: #A80036; stroke-width: 1.5;" x1="586" x2="730" y1="460.2969" y2="460.2969"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacingAndGlyphs" textLength="68" x="624" y="451.9951">DriverRun</text><text fill="#000000" font-family="sans-serif" font-size="12" lengthAdjust="spacingAndGlyphs" textLength="124" x="591" y="476.4355">Turning on BT stack</text><ellipse cx="16" cy="318" fill="#000000" filter="url(#f1bsr8iakppdr5)" rx="10" ry="10" style="stroke: none; stroke-width: 1.0;"/><rect fill="#FEFECE" filter="url(#f1bsr8iakppdr5)" height="64.2344" rx="12.5" ry="12.5" style="stroke: #A80036; stroke-width: 1.5;" width="147" x="51.5" y="427"/><line style="stroke: #A80036; stroke-width: 1.5;" x1="51.5" x2="198.5" y1="453.2969" y2="453.2969"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacingAndGlyphs" textLength="19" x="115.5" y="444.9951">Off</text><text fill="#000000" font-family="sans-serif" font-size="12" lengthAdjust="spacingAndGlyphs" textLength="127" x="56.5" y="469.4355">Bluetooth turned off</text><text fill="#000000" font-family="sans-serif" font-size="12" lengthAdjust="spacingAndGlyphs" textLength="70" x="56.5" y="483.4043">Initial state</text><rect fill="#FEFECE" filter="url(#f1bsr8iakppdr5)" height="50.2656" rx="12.5" ry="12.5" style="stroke: #A80036; stroke-width: 1.5;" width="303" x="410.5" y="8"/><line style="stroke: #A80036; stroke-width: 1.5;" x1="410.5" x2="713.5" y1="34.2969" y2="34.2969"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacingAndGlyphs" textLength="50" x="537" y="25.9951">Restart</text><text fill="#000000" font-family="sans-serif" font-size="12" lengthAdjust="spacingAndGlyphs" textLength="283" x="415.5" y="50.4355">Restart Bluetooth Stack in case of hard error</text><rect fill="#FEFECE" filter="url(#f1bsr8iakppdr5)" height="50.2656" rx="12.5" ry="12.5" style="stroke: #A80036; stroke-width: 1.5;" width="166" x="349" y="293"/><line style="stroke: #A80036; stroke-width: 1.5;" x1="349" x2="515" y1="319.2969" y2="319.2969"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacingAndGlyphs" textLength="20" x="422" y="310.9951">On</text><text fill="#000000" font-family="sans-serif" font-size="12" lengthAdjust="spacingAndGlyphs" textLength="146" x="354" y="335.4355">BT stack fully operating</text><!--MD5=[79cb27a3a0f2a433e2384f6da7fb5477]
link *start to Off--><path d="M21.04,326.99 C30.24,341.38 50.58,372.46 70,397 C76.77,405.55 84.4,414.44 91.78,422.7 " fill="none" id="*start-&gt;Off" style="stroke: #A80036; stroke-width: 1.0;"/><polygon fill="#A80036" points="95.38,426.69,92.3504,417.3187,92.0423,422.9672,86.3938,422.6591,95.38,426.69" style="stroke: #A80036; stroke-width: 1.0;"/><!--MD5=[cbd16985e98923477b086a370bc489ce]
link Off to Init--><path d="M111.03,426.9 C96.34,388.94 79.61,325 113,286 C145.58,247.945 256.3375,230.42 359.6875,222.4213 C411.3625,218.4219 461.1856,216.8041 498.4588,216.1923 C517.0953,215.8865 532.5944,215.8321 543.6187,215.8574 C546.3747,215.8637 548.8511,215.875 551.027,215.8886 C551.5709,215.892 552.0961,215.8955 552.6022,215.8991 C552.8552,215.901 553.1035,215.9028 553.3469,215.9047 " fill="none" id="Off-&gt;Init" style="stroke: #A80036; stroke-width: 1.0;"/><polygon fill="#A80036" points="553.3469,215.9047,544.3778,211.8359,548.347,215.8664,544.3165,219.8356,553.3469,215.9047" style="stroke: #A80036; stroke-width: 1.0;"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacingAndGlyphs" textLength="216" x="114" y="322.5669">Command::TurnOn /worker-&gt;init()</text><!--MD5=[155566f13e7efec7d105709a16fe3d4a]
link *start*Init to WorkerSetup--><path d="M667,225.32 C667,237.78 667,260.6 667,280.35 " fill="none" id="*start*Init-&gt;WorkerSetup" style="stroke: #A80036; stroke-width: 1.0;"/><polygon fill="#A80036" points="667,285.56,671,276.56,667,280.56,663,276.56,667,285.56" style="stroke: #A80036; stroke-width: 1.0;"/><!--MD5=[c80e218129ccf8c5829d329afa97d946]
link WorkerSetup to DriverRun--><path d="M664.98,350.19 C663.46,373.71 661.38,405.73 659.89,428.76 " fill="none" id="WorkerSetup-&gt;DriverRun" style="stroke: #A80036; stroke-width: 1.0;"/><polygon fill="#A80036" points="659.57,433.82,664.1267,425.0887,659.8837,428.8298,656.1425,424.5868,659.57,433.82" style="stroke: #A80036; stroke-width: 1.0;"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacingAndGlyphs" textLength="88" x="664" y="393.0669">/ initDone = 1</text><!--MD5=[55403775e581799a7dec5eedc8d92082]
link DriverRun to Off--><path d="M585.63,459 C485.85,459 306.72,459 203.7,459 " fill="none" id="DriverRun-&gt;Off" style="stroke: #A80036; stroke-width: 1.0;"/><polygon fill="#A80036" points="198.55,459,207.55,463,203.55,459,207.55,455,198.55,459" style="stroke: #A80036; stroke-width: 1.0;"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacingAndGlyphs" textLength="293" x="245.75" y="452.0669">Turned on [error != 0]/ send status to appMgr</text><!--MD5=[daf29d706684f08af01db28327c260dd]
link DriverRun to On--><path d="M585.7,453.89 C504.72,447.59 380.99,432.34 352,397 C337.06,378.79 354.29,360.31 376.53,345.91 " fill="none" id="DriverRun-&gt;On" style="stroke: #A80036; stroke-width: 1.0;"/><polygon fill="#A80036" points="381.03,343.09,371.2759,344.4532,376.786,345.7336,375.5057,351.2436,381.03,343.09" style="stroke: #A80036; stroke-width: 1.0;"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacingAndGlyphs" textLength="299" x="353" y="393.0669">Turned on [error == 0]/ send status to appMgr</text><!--MD5=[2ee57ebca22bdc8713f173619aa2ce0d]
link On to Off--><path d="M348.7,342.47 C288.04,359.57 216.4,379.79 216,380 C195.03,391.23 174.65,407.99 158.5,423.09 " fill="none" id="On-&gt;Off" style="stroke: #A80036; stroke-width: 1.0;"/><polygon fill="#A80036" points="154.49,426.89,163.772,423.597,158.1171,423.4485,158.2656,417.7936,154.49,426.89" style="stroke: #A80036; stroke-width: 1.0;"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacingAndGlyphs" textLength="121" x="217" y="393.0669">Command::TurnOff</text><!--MD5=[15b5b872ee5848af43a946556c76c324]
link Restart to Init--><path d="M562,58.28 C562,70.37 562,85.94 562,102.545 C562,110.8475 562,119.4088 562,127.9231 C562,128.1892 562,128.4552 562,128.7212 " fill="none" id="Restart-&gt;Init" style="stroke: #A80036; stroke-width: 1.0;"/><polygon fill="#A80036" points="562,128.7212,566,119.7212,562,123.7212,558,119.7212,562,128.7212" style="stroke: #A80036; stroke-width: 1.0;"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacingAndGlyphs" textLength="91" x="563" y="101.0669">/worker-&gt;Init()</text><!--MD5=[6c3c23e026ce7e75e5d4e431ac8c025c]
@startuml
skinparam BackgroundColor F0F0F0

[*] - -> Off
Off: Bluetooth turned off
Off: Initial state

Off - -> Init : Command::TurnOn /worker->init()


state Init{
Init: Initialization of BT stack
Init: Creating BluetoothWorker

[*] - -> WorkerSetup
WorkerSetup: Settings fetch & setup
WorkerSetup: BT driver setup

state DriverRun{
DriverRun: Turning on BT stack
}
WorkerSetup - -> DriverRun : / initDone = 1

DriverRun -r-> Off: Turned on [error != 0]/ send status to appMgr
DriverRun - -> On: Turned on [error == 0]/ send status to appMgr
}
state Restart {
Restart: Restart Bluetooth Stack in case of hard error
}
state On{
On: BT stack fully operating
}
On - -> Off : Command::TurnOff
Restart - -> Init :/worker->Init()
@enduml

PlantUML version 1.2020.02(Sun Mar 01 05:22:07 EST 2020)
(GPL source distribution)
Java Runtime: OpenJDK Runtime Environment
JVM: OpenJDK 64-Bit Server VM
Java Version: 11.0.12+7-post-Debian-2
Operating System: Linux
Default Encoding: UTF-8
Language: en
Country: US
--></g></svg>