~aleteoryx/muditaos

77d3b1a0c669b5982f7c72271499ee27bb4dc87a — Paweł Olejniczak 5 years ago 7e568d3
[EGD-4506] Add proposal of basic bluetooth settings data flow (#1090)

M module-bluetooth/README.md => module-bluetooth/README.md +27 -0
@@ 18,3 18,30 @@ It's meant to provide interface layer for service-bluetooth like that:
![Flowchart](./flowchart.svg)
<img src="./flowchart.svg">

# Proposal of Bluetooth settings data flow

The Bluetooth settings related data flow is directed by three main entities:
1. `ServiceDB` that is responsible for storing data in DB
2. `ServiceBluetooth` that is responsible for general Bluetooth management, and communication between ServiceDB and ApplicationSettings
3. `ApplicationSettings` that is responsible for `PurePhone<->User` interactions in this context

![bt_settings_basic_flowchart](./bt_settings_basic_flowchart.svg)

`ServiceBluetooth` communicates with `ServiceDB` via `SettingsAgent`, and uses `BluetoothMessages` for communication with `ApplicationSettings`.
It contains `BluetoothSettings` object for caching settings received from `ServiceDB` and `ApplicationSettings`.
`ServiceBluetooth` uses `BluetoothWorker` to control bluetooth stack.

![service_bt_internals](./service_bt_internals.svg)

![bt_messages_class_diagram](./bt_messages_class_diagram.svg)

When `ServiceBluetooth` is being created, it registers on a value change in *DB* for each variable related to *BluetoothSettings* and binds callback functions for them.
When *DB* responds with new values of *BluetoothSettiings* - related variables, callback function of each variable stores its value in cache object (*BluetoothSettings*) in `ServiceBluetooth`, then unregisters from changes in *DB*.
When all variables are loaded from *DB*, then *BluetoothWorker* reloads Bluetooth stack with data from *BluetoothSettings* object.

![load_bt_settings_from_db_on_service_start_flowchart](./load_bt_settings_from_db_on_service_start_flowchart.svg)


Flowchart below is an example of scenario, when user opens *BluetoothWindow*, and tries to change some of settings presented there.

![change_bt_status_flowchart](./change_bt_status_flowchart.svg)

A module-bluetooth/bt_messages_class_diagram.puml => module-bluetooth/bt_messages_class_diagram.puml +40 -0
@@ 0,0 1,40 @@
@startuml

title BluetoothMessages - Class Diagram


class BluetoothMessage

class RequestBluetoothStatus
class RequestBondedDevices
class RequestDeviceName

class ResponseBluetoothStatus
class ResponseBondedDevices
class ResponseDeviceName
class ResponseVisibleDevices

class SetBluetoothStatus
class SetBondedDevices
class SetDeviceName
class SetScanState

BluetoothMessage <|-left- RequestBluetoothStatus: Inheritance
BluetoothMessage <|-up- RequestBondedDevices: Inheritance
BluetoothMessage <|-up- RequestDeviceName: Inheritance


BluetoothMessage <|-up- ResponseBluetoothStatus: Inheritance
BluetoothMessage <|-up- ResponseBondedDevices: Inheritance
BluetoothMessage <|-right- ResponseDeviceName: Inheritance
BluetoothMessage <|-down- ResponseVisibleDevices: Inheritance


BluetoothMessage <|-down- SetBluetoothStatus: Inheritance
BluetoothMessage <|-down- SetBondedDevices: Inheritance
BluetoothMessage <|-down- SetDeviceName: Inheritance
BluetoothMessage <|-down- SetScanState: Inheritance



@enduml

A module-bluetooth/bt_messages_class_diagram.svg => module-bluetooth/bt_messages_class_diagram.svg +71 -0
@@ 0,0 1,71 @@
<?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="337px" preserveAspectRatio="none" style="width:902px;height:337px;" version="1.1" viewBox="0 0 902 337" width="902px" zoomAndPan="magnify"><defs><filter height="300%" id="f1ninxj1xw85cl" 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><text fill="#000000" font-family="sans-serif" font-size="18" lengthAdjust="spacingAndGlyphs" textLength="313" x="298" y="16.708">BluetoothMessages - Class Diagram</text><!--MD5=[23fc707ad27c8e6ea052f1129144ac7b]
class BluetoothMessage--><rect fill="#FEFECE" filter="url(#f1ninxj1xw85cl)" height="48" id="BluetoothMessage" style="stroke: #A80036; stroke-width: 1.5;" width="149" x="413.5" y="153.9531"/><ellipse cx="428.5" cy="169.9531" fill="#ADD1B2" rx="11" ry="11" style="stroke: #A80036; stroke-width: 1.0;"/><path d="M431.4688,175.5938 Q430.8906,175.8906 430.25,176.0391 Q429.6094,176.1875 428.9063,176.1875 Q426.4063,176.1875 425.0859,174.5391 Q423.7656,172.8906 423.7656,169.7656 Q423.7656,166.6406 425.0859,164.9844 Q426.4063,163.3281 428.9063,163.3281 Q429.6094,163.3281 430.2578,163.4844 Q430.9063,163.6406 431.4688,163.9375 L431.4688,166.6563 Q430.8438,166.0781 430.25,165.8047 Q429.6563,165.5313 429.0313,165.5313 Q427.6875,165.5313 427,166.6016 Q426.3125,167.6719 426.3125,169.7656 Q426.3125,171.8594 427,172.9297 Q427.6875,174 429.0313,174 Q429.6563,174 430.25,173.7266 Q430.8438,173.4531 431.4688,172.875 L431.4688,175.5938 Z "/><text fill="#000000" font-family="sans-serif" font-size="12" lengthAdjust="spacingAndGlyphs" textLength="117" x="442.5" y="174.1074">BluetoothMessage</text><line style="stroke: #A80036; stroke-width: 1.5;" x1="414.5" x2="561.5" y1="185.9531" y2="185.9531"/><line style="stroke: #A80036; stroke-width: 1.5;" x1="414.5" x2="561.5" y1="193.9531" y2="193.9531"/><!--MD5=[b68a6893fb5fe43c9ba686fe799938b5]
class RequestBluetoothStatus--><rect fill="#FEFECE" filter="url(#f1ninxj1xw85cl)" height="48" id="RequestBluetoothStatus" style="stroke: #A80036; stroke-width: 1.5;" width="186" x="120" y="153.9531"/><ellipse cx="135" cy="169.9531" fill="#ADD1B2" rx="11" ry="11" style="stroke: #A80036; stroke-width: 1.0;"/><path d="M137.9688,175.5938 Q137.3906,175.8906 136.75,176.0391 Q136.1094,176.1875 135.4063,176.1875 Q132.9063,176.1875 131.5859,174.5391 Q130.2656,172.8906 130.2656,169.7656 Q130.2656,166.6406 131.5859,164.9844 Q132.9063,163.3281 135.4063,163.3281 Q136.1094,163.3281 136.7578,163.4844 Q137.4063,163.6406 137.9688,163.9375 L137.9688,166.6563 Q137.3438,166.0781 136.75,165.8047 Q136.1563,165.5313 135.5313,165.5313 Q134.1875,165.5313 133.5,166.6016 Q132.8125,167.6719 132.8125,169.7656 Q132.8125,171.8594 133.5,172.9297 Q134.1875,174 135.5313,174 Q136.1563,174 136.75,173.7266 Q137.3438,173.4531 137.9688,172.875 L137.9688,175.5938 Z "/><text fill="#000000" font-family="sans-serif" font-size="12" lengthAdjust="spacingAndGlyphs" textLength="154" x="149" y="174.1074">RequestBluetoothStatus</text><line style="stroke: #A80036; stroke-width: 1.5;" x1="121" x2="305" y1="185.9531" y2="185.9531"/><line style="stroke: #A80036; stroke-width: 1.5;" x1="121" x2="305" y1="193.9531" y2="193.9531"/><!--MD5=[cc960df078a163385707cbd025b1228e]
class RequestBondedDevices--><rect fill="#FEFECE" filter="url(#f1ninxj1xw85cl)" height="48" id="RequestBondedDevices" style="stroke: #A80036; stroke-width: 1.5;" width="180" x="711" y="28.9531"/><ellipse cx="726" cy="44.9531" fill="#ADD1B2" rx="11" ry="11" style="stroke: #A80036; stroke-width: 1.0;"/><path d="M728.9688,50.5938 Q728.3906,50.8906 727.75,51.0391 Q727.1094,51.1875 726.4063,51.1875 Q723.9063,51.1875 722.5859,49.5391 Q721.2656,47.8906 721.2656,44.7656 Q721.2656,41.6406 722.5859,39.9844 Q723.9063,38.3281 726.4063,38.3281 Q727.1094,38.3281 727.7578,38.4844 Q728.4063,38.6406 728.9688,38.9375 L728.9688,41.6563 Q728.3438,41.0781 727.75,40.8047 Q727.1563,40.5313 726.5313,40.5313 Q725.1875,40.5313 724.5,41.6016 Q723.8125,42.6719 723.8125,44.7656 Q723.8125,46.8594 724.5,47.9297 Q725.1875,49 726.5313,49 Q727.1563,49 727.75,48.7266 Q728.3438,48.4531 728.9688,47.875 L728.9688,50.5938 Z "/><text fill="#000000" font-family="sans-serif" font-size="12" lengthAdjust="spacingAndGlyphs" textLength="148" x="740" y="49.1074">RequestBondedDevices</text><line style="stroke: #A80036; stroke-width: 1.5;" x1="712" x2="890" y1="60.9531" y2="60.9531"/><line style="stroke: #A80036; stroke-width: 1.5;" x1="712" x2="890" y1="68.9531" y2="68.9531"/><!--MD5=[f1a36d6b3380e677ad379c4765f0f72c]
class RequestDeviceName--><rect fill="#FEFECE" filter="url(#f1ninxj1xw85cl)" height="48" id="RequestDeviceName" style="stroke: #A80036; stroke-width: 1.5;" width="161" x="514.5" y="28.9531"/><ellipse cx="529.5" cy="44.9531" fill="#ADD1B2" rx="11" ry="11" style="stroke: #A80036; stroke-width: 1.0;"/><path d="M532.4688,50.5938 Q531.8906,50.8906 531.25,51.0391 Q530.6094,51.1875 529.9063,51.1875 Q527.4063,51.1875 526.0859,49.5391 Q524.7656,47.8906 524.7656,44.7656 Q524.7656,41.6406 526.0859,39.9844 Q527.4063,38.3281 529.9063,38.3281 Q530.6094,38.3281 531.2578,38.4844 Q531.9063,38.6406 532.4688,38.9375 L532.4688,41.6563 Q531.8438,41.0781 531.25,40.8047 Q530.6563,40.5313 530.0313,40.5313 Q528.6875,40.5313 528,41.6016 Q527.3125,42.6719 527.3125,44.7656 Q527.3125,46.8594 528,47.9297 Q528.6875,49 530.0313,49 Q530.6563,49 531.25,48.7266 Q531.8438,48.4531 532.4688,47.875 L532.4688,50.5938 Z "/><text fill="#000000" font-family="sans-serif" font-size="12" lengthAdjust="spacingAndGlyphs" textLength="129" x="543.5" y="49.1074">RequestDeviceName</text><line style="stroke: #A80036; stroke-width: 1.5;" x1="515.5" x2="674.5" y1="60.9531" y2="60.9531"/><line style="stroke: #A80036; stroke-width: 1.5;" x1="515.5" x2="674.5" y1="68.9531" y2="68.9531"/><!--MD5=[997e5b1c613c646acbb63a9dc35e5d22]
class ResponseBluetoothStatus--><rect fill="#FEFECE" filter="url(#f1ninxj1xw85cl)" height="48" id="ResponseBluetoothStatus" style="stroke: #A80036; stroke-width: 1.5;" width="196" x="283" y="28.9531"/><ellipse cx="298" cy="44.9531" fill="#ADD1B2" rx="11" ry="11" style="stroke: #A80036; stroke-width: 1.0;"/><path d="M300.9688,50.5938 Q300.3906,50.8906 299.75,51.0391 Q299.1094,51.1875 298.4063,51.1875 Q295.9063,51.1875 294.5859,49.5391 Q293.2656,47.8906 293.2656,44.7656 Q293.2656,41.6406 294.5859,39.9844 Q295.9063,38.3281 298.4063,38.3281 Q299.1094,38.3281 299.7578,38.4844 Q300.4063,38.6406 300.9688,38.9375 L300.9688,41.6563 Q300.3438,41.0781 299.75,40.8047 Q299.1563,40.5313 298.5313,40.5313 Q297.1875,40.5313 296.5,41.6016 Q295.8125,42.6719 295.8125,44.7656 Q295.8125,46.8594 296.5,47.9297 Q297.1875,49 298.5313,49 Q299.1563,49 299.75,48.7266 Q300.3438,48.4531 300.9688,47.875 L300.9688,50.5938 Z "/><text fill="#000000" font-family="sans-serif" font-size="12" lengthAdjust="spacingAndGlyphs" textLength="164" x="312" y="49.1074">ResponseBluetoothStatus</text><line style="stroke: #A80036; stroke-width: 1.5;" x1="284" x2="478" y1="60.9531" y2="60.9531"/><line style="stroke: #A80036; stroke-width: 1.5;" x1="284" x2="478" y1="68.9531" y2="68.9531"/><!--MD5=[eb512bcfdbef1ba9066f1482e200ba23]
class ResponseBondedDevices--><rect fill="#FEFECE" filter="url(#f1ninxj1xw85cl)" height="48" id="ResponseBondedDevices" style="stroke: #A80036; stroke-width: 1.5;" width="190" x="58" y="28.9531"/><ellipse cx="73" cy="44.9531" fill="#ADD1B2" rx="11" ry="11" style="stroke: #A80036; stroke-width: 1.0;"/><path d="M75.9688,50.5938 Q75.3906,50.8906 74.75,51.0391 Q74.1094,51.1875 73.4063,51.1875 Q70.9063,51.1875 69.5859,49.5391 Q68.2656,47.8906 68.2656,44.7656 Q68.2656,41.6406 69.5859,39.9844 Q70.9063,38.3281 73.4063,38.3281 Q74.1094,38.3281 74.7578,38.4844 Q75.4063,38.6406 75.9688,38.9375 L75.9688,41.6563 Q75.3438,41.0781 74.75,40.8047 Q74.1563,40.5313 73.5313,40.5313 Q72.1875,40.5313 71.5,41.6016 Q70.8125,42.6719 70.8125,44.7656 Q70.8125,46.8594 71.5,47.9297 Q72.1875,49 73.5313,49 Q74.1563,49 74.75,48.7266 Q75.3438,48.4531 75.9688,47.875 L75.9688,50.5938 Z "/><text fill="#000000" font-family="sans-serif" font-size="12" lengthAdjust="spacingAndGlyphs" textLength="158" x="87" y="49.1074">ResponseBondedDevices</text><line style="stroke: #A80036; stroke-width: 1.5;" x1="59" x2="247" y1="60.9531" y2="60.9531"/><line style="stroke: #A80036; stroke-width: 1.5;" x1="59" x2="247" y1="68.9531" y2="68.9531"/><!--MD5=[3faab22c1f830479f961f6e769115a5d]
class ResponseDeviceName--><rect fill="#FEFECE" filter="url(#f1ninxj1xw85cl)" height="48" id="ResponseDeviceName" style="stroke: #A80036; stroke-width: 1.5;" width="171" x="670.5" y="153.9531"/><ellipse cx="685.5" cy="169.9531" fill="#ADD1B2" rx="11" ry="11" style="stroke: #A80036; stroke-width: 1.0;"/><path d="M688.4688,175.5938 Q687.8906,175.8906 687.25,176.0391 Q686.6094,176.1875 685.9063,176.1875 Q683.4063,176.1875 682.0859,174.5391 Q680.7656,172.8906 680.7656,169.7656 Q680.7656,166.6406 682.0859,164.9844 Q683.4063,163.3281 685.9063,163.3281 Q686.6094,163.3281 687.2578,163.4844 Q687.9063,163.6406 688.4688,163.9375 L688.4688,166.6563 Q687.8438,166.0781 687.25,165.8047 Q686.6563,165.5313 686.0313,165.5313 Q684.6875,165.5313 684,166.6016 Q683.3125,167.6719 683.3125,169.7656 Q683.3125,171.8594 684,172.9297 Q684.6875,174 686.0313,174 Q686.6563,174 687.25,173.7266 Q687.8438,173.4531 688.4688,172.875 L688.4688,175.5938 Z "/><text fill="#000000" font-family="sans-serif" font-size="12" lengthAdjust="spacingAndGlyphs" textLength="139" x="699.5" y="174.1074">ResponseDeviceName</text><line style="stroke: #A80036; stroke-width: 1.5;" x1="671.5" x2="840.5" y1="185.9531" y2="185.9531"/><line style="stroke: #A80036; stroke-width: 1.5;" x1="671.5" x2="840.5" y1="193.9531" y2="193.9531"/><!--MD5=[16efb683b245cffa4f1d0163265c1862]
class ResponseVisibleDevices--><rect fill="#FEFECE" filter="url(#f1ninxj1xw85cl)" height="48" id="ResponseVisibleDevices" style="stroke: #A80036; stroke-width: 1.5;" width="182" x="6" y="278.9531"/><ellipse cx="21" cy="294.9531" fill="#ADD1B2" rx="11" ry="11" style="stroke: #A80036; stroke-width: 1.0;"/><path d="M23.9688,300.5938 Q23.3906,300.8906 22.75,301.0391 Q22.1094,301.1875 21.4063,301.1875 Q18.9063,301.1875 17.5859,299.5391 Q16.2656,297.8906 16.2656,294.7656 Q16.2656,291.6406 17.5859,289.9844 Q18.9063,288.3281 21.4063,288.3281 Q22.1094,288.3281 22.7578,288.4844 Q23.4063,288.6406 23.9688,288.9375 L23.9688,291.6563 Q23.3438,291.0781 22.75,290.8047 Q22.1563,290.5313 21.5313,290.5313 Q20.1875,290.5313 19.5,291.6016 Q18.8125,292.6719 18.8125,294.7656 Q18.8125,296.8594 19.5,297.9297 Q20.1875,299 21.5313,299 Q22.1563,299 22.75,298.7266 Q23.3438,298.4531 23.9688,297.875 L23.9688,300.5938 Z "/><text fill="#000000" font-family="sans-serif" font-size="12" lengthAdjust="spacingAndGlyphs" textLength="150" x="35" y="299.1074">ResponseVisibleDevices</text><line style="stroke: #A80036; stroke-width: 1.5;" x1="7" x2="187" y1="310.9531" y2="310.9531"/><line style="stroke: #A80036; stroke-width: 1.5;" x1="7" x2="187" y1="318.9531" y2="318.9531"/><!--MD5=[55dcaea49b6f335663f06ba5e29d8711]
class SetBluetoothStatus--><rect fill="#FEFECE" filter="url(#f1ninxj1xw85cl)" height="48" id="SetBluetoothStatus" style="stroke: #A80036; stroke-width: 1.5;" width="155" x="223.5" y="278.9531"/><ellipse cx="238.5" cy="294.9531" fill="#ADD1B2" rx="11" ry="11" style="stroke: #A80036; stroke-width: 1.0;"/><path d="M241.4688,300.5938 Q240.8906,300.8906 240.25,301.0391 Q239.6094,301.1875 238.9063,301.1875 Q236.4063,301.1875 235.0859,299.5391 Q233.7656,297.8906 233.7656,294.7656 Q233.7656,291.6406 235.0859,289.9844 Q236.4063,288.3281 238.9063,288.3281 Q239.6094,288.3281 240.2578,288.4844 Q240.9063,288.6406 241.4688,288.9375 L241.4688,291.6563 Q240.8438,291.0781 240.25,290.8047 Q239.6563,290.5313 239.0313,290.5313 Q237.6875,290.5313 237,291.6016 Q236.3125,292.6719 236.3125,294.7656 Q236.3125,296.8594 237,297.9297 Q237.6875,299 239.0313,299 Q239.6563,299 240.25,298.7266 Q240.8438,298.4531 241.4688,297.875 L241.4688,300.5938 Z "/><text fill="#000000" font-family="sans-serif" font-size="12" lengthAdjust="spacingAndGlyphs" textLength="123" x="252.5" y="299.1074">SetBluetoothStatus</text><line style="stroke: #A80036; stroke-width: 1.5;" x1="224.5" x2="377.5" y1="310.9531" y2="310.9531"/><line style="stroke: #A80036; stroke-width: 1.5;" x1="224.5" x2="377.5" y1="318.9531" y2="318.9531"/><!--MD5=[75c2d557c56179bba89b9164f9048e30]
class SetBondedDevices--><rect fill="#FEFECE" filter="url(#f1ninxj1xw85cl)" height="48" id="SetBondedDevices" style="stroke: #A80036; stroke-width: 1.5;" width="149" x="413.5" y="278.9531"/><ellipse cx="428.5" cy="294.9531" fill="#ADD1B2" rx="11" ry="11" style="stroke: #A80036; stroke-width: 1.0;"/><path d="M431.4688,300.5938 Q430.8906,300.8906 430.25,301.0391 Q429.6094,301.1875 428.9063,301.1875 Q426.4063,301.1875 425.0859,299.5391 Q423.7656,297.8906 423.7656,294.7656 Q423.7656,291.6406 425.0859,289.9844 Q426.4063,288.3281 428.9063,288.3281 Q429.6094,288.3281 430.2578,288.4844 Q430.9063,288.6406 431.4688,288.9375 L431.4688,291.6563 Q430.8438,291.0781 430.25,290.8047 Q429.6563,290.5313 429.0313,290.5313 Q427.6875,290.5313 427,291.6016 Q426.3125,292.6719 426.3125,294.7656 Q426.3125,296.8594 427,297.9297 Q427.6875,299 429.0313,299 Q429.6563,299 430.25,298.7266 Q430.8438,298.4531 431.4688,297.875 L431.4688,300.5938 Z "/><text fill="#000000" font-family="sans-serif" font-size="12" lengthAdjust="spacingAndGlyphs" textLength="117" x="442.5" y="299.1074">SetBondedDevices</text><line style="stroke: #A80036; stroke-width: 1.5;" x1="414.5" x2="561.5" y1="310.9531" y2="310.9531"/><line style="stroke: #A80036; stroke-width: 1.5;" x1="414.5" x2="561.5" y1="318.9531" y2="318.9531"/><!--MD5=[8139fa2621595fc198f831176f26a933]
class SetDeviceName--><rect fill="#FEFECE" filter="url(#f1ninxj1xw85cl)" height="48" id="SetDeviceName" style="stroke: #A80036; stroke-width: 1.5;" width="130" x="598" y="278.9531"/><ellipse cx="613" cy="294.9531" fill="#ADD1B2" rx="11" ry="11" style="stroke: #A80036; stroke-width: 1.0;"/><path d="M615.9688,300.5938 Q615.3906,300.8906 614.75,301.0391 Q614.1094,301.1875 613.4063,301.1875 Q610.9063,301.1875 609.5859,299.5391 Q608.2656,297.8906 608.2656,294.7656 Q608.2656,291.6406 609.5859,289.9844 Q610.9063,288.3281 613.4063,288.3281 Q614.1094,288.3281 614.7578,288.4844 Q615.4063,288.6406 615.9688,288.9375 L615.9688,291.6563 Q615.3438,291.0781 614.75,290.8047 Q614.1563,290.5313 613.5313,290.5313 Q612.1875,290.5313 611.5,291.6016 Q610.8125,292.6719 610.8125,294.7656 Q610.8125,296.8594 611.5,297.9297 Q612.1875,299 613.5313,299 Q614.1563,299 614.75,298.7266 Q615.3438,298.4531 615.9688,297.875 L615.9688,300.5938 Z "/><text fill="#000000" font-family="sans-serif" font-size="12" lengthAdjust="spacingAndGlyphs" textLength="98" x="627" y="299.1074">SetDeviceName</text><line style="stroke: #A80036; stroke-width: 1.5;" x1="599" x2="727" y1="310.9531" y2="310.9531"/><line style="stroke: #A80036; stroke-width: 1.5;" x1="599" x2="727" y1="318.9531" y2="318.9531"/><!--MD5=[8cf19ae717c5ffa0942c17e0d92fc75b]
class SetScanState--><rect fill="#FEFECE" filter="url(#f1ninxj1xw85cl)" height="48" id="SetScanState" style="stroke: #A80036; stroke-width: 1.5;" width="118" x="763" y="278.9531"/><ellipse cx="778" cy="294.9531" fill="#ADD1B2" rx="11" ry="11" style="stroke: #A80036; stroke-width: 1.0;"/><path d="M780.9688,300.5938 Q780.3906,300.8906 779.75,301.0391 Q779.1094,301.1875 778.4063,301.1875 Q775.9063,301.1875 774.5859,299.5391 Q773.2656,297.8906 773.2656,294.7656 Q773.2656,291.6406 774.5859,289.9844 Q775.9063,288.3281 778.4063,288.3281 Q779.1094,288.3281 779.7578,288.4844 Q780.4063,288.6406 780.9688,288.9375 L780.9688,291.6563 Q780.3438,291.0781 779.75,290.8047 Q779.1563,290.5313 778.5313,290.5313 Q777.1875,290.5313 776.5,291.6016 Q775.8125,292.6719 775.8125,294.7656 Q775.8125,296.8594 776.5,297.9297 Q777.1875,299 778.5313,299 Q779.1563,299 779.75,298.7266 Q780.3438,298.4531 780.9688,297.875 L780.9688,300.5938 Z "/><text fill="#000000" font-family="sans-serif" font-size="12" lengthAdjust="spacingAndGlyphs" textLength="86" x="792" y="299.1074">SetScanState</text><line style="stroke: #A80036; stroke-width: 1.5;" x1="764" x2="880" y1="310.9531" y2="310.9531"/><line style="stroke: #A80036; stroke-width: 1.5;" x1="764" x2="880" y1="318.9531" y2="318.9531"/><!--MD5=[73ba01893e771b4f052bc4c2c3173fe2]
link RequestBluetoothStatus to BluetoothMessage--><path d="M306.1025,177.9531 C334.0526,177.9531 364.7445,177.9531 392.8265,177.9531 " fill="none" id="RequestBluetoothStatus-&gt;BluetoothMessage" style="stroke: #A80036; stroke-width: 1.0;"/><polygon fill="none" points="393.2183,170.953,413.2183,177.9531,393.2183,184.953,393.2183,170.953" style="stroke: #A80036; stroke-width: 1.0;"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacingAndGlyphs" textLength="71" x="324.25" y="171.02">Inheritance</text><!--MD5=[3552c17c7fd4794cfafc4959abe3dcdf]
link RequestBondedDevices to BluetoothMessage--><path d="M743.0636,77.0909 C709.5226,90.9745 666.4596,108.6459 628,123.9531 C609.3093,131.3921 589.156,139.2567 570.1232,146.6132 " fill="none" id="RequestBondedDevices-&gt;BluetoothMessage" style="stroke: #A80036; stroke-width: 1.0;"/><polygon fill="none" points="572.3622,153.252,551.1828,153.9104,567.329,140.1881,572.3622,153.252" style="stroke: #A80036; stroke-width: 1.0;"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacingAndGlyphs" textLength="71" x="667" y="120.02">Inheritance</text><!--MD5=[fd008eeed691456ddd735d4f025be011]
link RequestDeviceName to BluetoothMessage--><path d="M574.3693,77.0544 C559.4187,94.52 538.8769,118.5175 521.5774,138.7272 " fill="none" id="RequestDeviceName-&gt;BluetoothMessage" style="stroke: #A80036; stroke-width: 1.0;"/><polygon fill="none" points="526.891,143.2841,508.5673,153.9258,516.2554,134.1801,526.891,143.2841" style="stroke: #A80036; stroke-width: 1.0;"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacingAndGlyphs" textLength="71" x="548" y="120.02">Inheritance</text><!--MD5=[122c458fca63b9aff4b84eee201d8d52]
link ResponseBluetoothStatus to BluetoothMessage--><path d="M401.6307,77.0544 C416.5813,94.52 437.1231,118.5175 454.4226,138.7272 " fill="none" id="ResponseBluetoothStatus-&gt;BluetoothMessage" style="stroke: #A80036; stroke-width: 1.0;"/><polygon fill="none" points="459.7446,134.1801,467.4327,153.9258,449.109,143.2841,459.7446,134.1801" style="stroke: #A80036; stroke-width: 1.0;"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacingAndGlyphs" textLength="71" x="442" y="120.02">Inheritance</text><!--MD5=[103f9fc16a112e257e1cfe02f2b18527]
link ResponseBondedDevices to BluetoothMessage--><path d="M217.5914,77.0544 C270.8875,96.941 346.8783,125.2957 404.7387,146.8855 " fill="none" id="ResponseBondedDevices-&gt;BluetoothMessage" style="stroke: #A80036; stroke-width: 1.0;"/><polygon fill="none" points="407.316,140.3756,423.6069,153.9258,402.4217,153.4923,407.316,140.3756" style="stroke: #A80036; stroke-width: 1.0;"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacingAndGlyphs" textLength="71" x="342" y="120.02">Inheritance</text><!--MD5=[0df839f176d4e8747e1fa4ab5a231c8c]
reverse link BluetoothMessage to ResponseDeviceName--><path d="M582.8796,177.9531 C611.4009,177.9531 642.5139,177.9531 670.3971,177.9531 " fill="none" id="BluetoothMessage&lt;-ResponseDeviceName" style="stroke: #A80036; stroke-width: 1.0;"/><polygon fill="none" points="582.653,184.953,562.6529,177.9531,582.6529,170.953,582.653,184.953" style="stroke: #A80036; stroke-width: 1.0;"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacingAndGlyphs" textLength="71" x="581" y="171.02">Inheritance</text><!--MD5=[033a85fd32f3b3aef0299180834d08b5]
reverse link BluetoothMessage to ResponseVisibleDevices--><path d="M394.2498,204.3733 C364.9392,212.8864 332.5447,222.5557 303,231.9531 C256.497,246.7446 204.5524,264.6574 164.4585,278.79 " fill="none" id="BluetoothMessage&lt;-ResponseVisibleDevices" style="stroke: #A80036; stroke-width: 1.0;"/><polygon fill="none" points="392.3318,197.6412,413.4885,198.8216,396.2134,211.0924,392.3318,197.6412" style="stroke: #A80036; stroke-width: 1.0;"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacingAndGlyphs" textLength="71" x="304" y="245.02">Inheritance</text><!--MD5=[b1d91fbcaf829313f55081fceaec155a]
reverse link BluetoothMessage to SetBluetoothStatus--><path d="M434.9143,213.3197 C425.6087,219.526 416.0198,225.9257 407,231.9531 C383.6115,247.5822 357.3412,265.178 336.8045,278.9428 " fill="none" id="BluetoothMessage&lt;-SetBluetoothStatus" style="stroke: #A80036; stroke-width: 1.0;"/><polygon fill="none" points="431.1754,207.3993,451.6993,202.1293,438.9415,219.0479,431.1754,207.3993" style="stroke: #A80036; stroke-width: 1.0;"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacingAndGlyphs" textLength="71" x="408" y="245.02">Inheritance</text><!--MD5=[5be4832e50a96e9afd6716a5726789fc]
reverse link BluetoothMessage to SetBondedDevices--><path d="M488,222.1354 C488,241.245 488,262.8606 488,278.9258 " fill="none" id="BluetoothMessage&lt;-SetBondedDevices" style="stroke: #A80036; stroke-width: 1.0;"/><polygon fill="none" points="481.0001,222.0544,488,202.0544,495.0001,222.0543,481.0001,222.0544" style="stroke: #A80036; stroke-width: 1.0;"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacingAndGlyphs" textLength="71" x="489" y="245.02">Inheritance</text><!--MD5=[9e81130095896bc22196e3fc1c87645b]
reverse link BluetoothMessage to SetDeviceName--><path d="M541.6472,213.0735 C550.8355,219.2719 560.2398,225.7328 569,231.9531 C590.3444,247.109 613.8444,264.859 632.0083,278.82 " fill="none" id="BluetoothMessage&lt;-SetDeviceName" style="stroke: #A80036; stroke-width: 1.0;"/><polygon fill="none" points="537.7517,218.8894,525.0046,201.9627,545.5251,207.2458,537.7517,218.8894" style="stroke: #A80036; stroke-width: 1.0;"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacingAndGlyphs" textLength="71" x="590" y="245.02">Inheritance</text><!--MD5=[27d3195f2473dab648037e6c3b9e7d94]
reverse link BluetoothMessage to SetScanState--><path d="M582.0307,202.9603 C610.5784,211.3238 641.8337,221.2641 670,231.9531 C706.0809,245.6457 745.5313,264.1843 775.1976,278.8845 " fill="none" id="BluetoothMessage&lt;-SetScanState" style="stroke: #A80036; stroke-width: 1.0;"/><polygon fill="none" points="580.0635,209.6784,562.7708,197.4323,583.9259,196.2217,580.0635,209.6784" style="stroke: #A80036; stroke-width: 1.0;"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacingAndGlyphs" textLength="71" x="709" y="245.02">Inheritance</text><!--MD5=[c3530f9c1db8aa2bb047a02e3783307d]
@startuml
title BluetoothMessages - Class Diagram


class BluetoothMessage

class RequestBluetoothStatus
class RequestBondedDevices
class RequestDeviceName

class ResponseBluetoothStatus
class ResponseBondedDevices
class ResponseDeviceName
class ResponseVisibleDevices

class SetBluetoothStatus
class SetBondedDevices
class SetDeviceName
class SetScanState

BluetoothMessage <|-left- RequestBluetoothStatus: Inheritance
BluetoothMessage <|-up- RequestBondedDevices: Inheritance
BluetoothMessage <|-up- RequestDeviceName: Inheritance


BluetoothMessage <|-up- ResponseBluetoothStatus: Inheritance
BluetoothMessage <|-up- ResponseBondedDevices: Inheritance
BluetoothMessage <|-right- ResponseDeviceName: Inheritance
BluetoothMessage <|-down- ResponseVisibleDevices: Inheritance


BluetoothMessage <|-down- SetBluetoothStatus: Inheritance
BluetoothMessage <|-down- SetBondedDevices: Inheritance
BluetoothMessage <|-down- SetDeviceName: Inheritance
BluetoothMessage <|-down- SetScanState: Inheritance
@enduml

PlantUML version 1.2019.12(Sun Nov 03 10:24:54 UTC 2019)
(GPL source distribution)
Java Runtime: OpenJDK Runtime Environment
JVM: OpenJDK 64-Bit Server VM
Java Version: 1.8.0_232-heroku-b09
Operating System: Linux
Default Encoding: UTF-8
Language: en
Country: US
--></g></svg>
\ No newline at end of file

A module-bluetooth/bt_settings_basic_flowchart.puml => module-bluetooth/bt_settings_basic_flowchart.puml +11 -0
@@ 0,0 1,11 @@
@startuml

[Service DB] as srvcdb
[Service Bluetooth] as srvcbt
[Application Settings] as appstngs


srvcdb <-r-> srvcbt : SettingsAgent
srvcbt <-r-> appstngs : BluetoothMessages

@enduml

A module-bluetooth/bt_settings_basic_flowchart.svg => module-bluetooth/bt_settings_basic_flowchart.svg +26 -0
@@ 0,0 1,26 @@
<?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="55px" preserveAspectRatio="none" style="width:700px;height:55px;" version="1.1" viewBox="0 0 700 55" width="700px" zoomAndPan="magnify"><defs><filter height="300%" id="f11mf93z2o7zom" 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=[4ff375fdd5a4c489d7dad352cbd5d06e]
entity srvcdb--><rect fill="#FEFECE" filter="url(#f11mf93z2o7zom)" height="36.2969" style="stroke: #A80036; stroke-width: 1.5;" width="95" x="6" y="8"/><rect fill="#FEFECE" height="5" style="stroke: #A80036; stroke-width: 1.5;" width="10" x="1" y="13"/><rect fill="#FEFECE" height="5" style="stroke: #A80036; stroke-width: 1.5;" width="10" x="1" y="34.2969"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacingAndGlyphs" textLength="75" x="16" y="30.9951">Service DB</text><!--MD5=[44cde863c342c45177f5f29f53d2de1e]
entity srvcbt--><rect fill="#FEFECE" filter="url(#f11mf93z2o7zom)" height="36.2969" style="stroke: #A80036; stroke-width: 1.5;" width="142" x="228.5" y="8"/><rect fill="#FEFECE" height="5" style="stroke: #A80036; stroke-width: 1.5;" width="10" x="223.5" y="13"/><rect fill="#FEFECE" height="5" style="stroke: #A80036; stroke-width: 1.5;" width="10" x="223.5" y="34.2969"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacingAndGlyphs" textLength="122" x="238.5" y="30.9951">Service Bluetooth</text><!--MD5=[ef233ba7a86bbf46a72532c6e29b3ed1]
entity appstngs--><rect fill="#FEFECE" filter="url(#f11mf93z2o7zom)" height="36.2969" style="stroke: #A80036; stroke-width: 1.5;" width="156" x="533.5" y="8"/><rect fill="#FEFECE" height="5" style="stroke: #A80036; stroke-width: 1.5;" width="10" x="528.5" y="13"/><rect fill="#FEFECE" height="5" style="stroke: #A80036; stroke-width: 1.5;" width="10" x="528.5" y="34.2969"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacingAndGlyphs" textLength="136" x="543.5" y="30.9951">Application Settings</text><!--MD5=[ea8f7f3546fb2fa8de5261aa4d1a6346]
link srvcdb to srvcbt--><path d="M106.3823,26 C140.4167,26 185.2057,26 223.0807,26 " fill="none" id="srvcdb-srvcbt" style="stroke: #A80036; stroke-width: 1.0;"/><polygon fill="#A80036" points="228.1388,26,219.1388,22,223.1388,26,219.1388,30,228.1388,26" style="stroke: #A80036; stroke-width: 1.0;"/><polygon fill="#A80036" points="101.223,26,110.223,30,106.223,26,110.223,22,101.223,26" style="stroke: #A80036; stroke-width: 1.0;"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacingAndGlyphs" textLength="91" x="119.25" y="19.0669">SettingsAgent</text><!--MD5=[e3bf7600b9ae2cb087876e44ae9bcba1]
link srvcbt to appstngs--><path d="M375.857,26 C421.9715,26 480.7743,26 528.1023,26 " fill="none" id="srvcbt-appstngs" style="stroke: #A80036; stroke-width: 1.0;"/><polygon fill="#A80036" points="533.2289,26,524.2289,22,528.2289,26,524.2289,30,533.2289,26" style="stroke: #A80036; stroke-width: 1.0;"/><polygon fill="#A80036" points="370.688,26,379.688,30,375.688,26,379.688,22,370.688,26" style="stroke: #A80036; stroke-width: 1.0;"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacingAndGlyphs" textLength="126" x="389" y="19.0669">BluetoothMessages</text><!--MD5=[edba85c2e849d6da9ab271417cd0b1bd]
@startuml
[Service DB] as srvcdb
[Service Bluetooth] as srvcbt
[Application Settings] as appstngs


srvcdb <-r-> srvcbt : SettingsAgent
srvcbt <-r-> appstngs : BluetoothMessages
@enduml

PlantUML version 1.2019.12(Sun Nov 03 10:24:54 UTC 2019)
(GPL source distribution)
Java Runtime: OpenJDK Runtime Environment
JVM: OpenJDK 64-Bit Server VM
Java Version: 1.8.0_232-heroku-b09
Operating System: Linux
Default Encoding: UTF-8
Language: en
Country: US
--></g></svg>

A module-bluetooth/change_bt_status_flowchart.puml => module-bluetooth/change_bt_status_flowchart.puml +45 -0
@@ 0,0 1,45 @@
@startuml

actor User
participant "Application Settings" as appstgs
participant "Bluetooth Window" as btwndw
participant "Service Bluetooth" as srvbt
participant "Bluetooth Worker" as btwrkr
participant "Service DB" as srvdb

    == Change Bluetooth status flow ==

User ->appstgs : Tries to open Bluetooth Window
activate appstgs
appstgs -> btwndw : Create Bluetooth Window
    activate btwndw
    deactivate appstgs
btwndw -> srvbt : BluetoothMessage::RequestBluetoothStatus
    activate srvbt
    deactivate btwndw
srvbt -> appstgs : BluetoothMessage::ResponseBluetoothStatus
activate appstgs
deactivate srvbt
appstgs ->o btwndw : Recreate Bluetooth Window with new bluetoothStatus
deactivate appstgs

User -> btwndw : Changes bluetoothState
activate btwndw
btwndw -> srvbt : BluetoothMessage::SetBluetoothStatus
deactivate btwndw
activate srvbt
srvbt -> srvbt : Cache received new value of bluetoothStatus
srvbt ->o srvdb : Settings::setValue(bluetoothState)
srvbt ->o srvdb : Settings::setValue(deviceVisibility)
srvbt -> btwrkr : Pass cached Bluetooth settings
activate btwrkr
btwrkr ->o btwrkr : Reload Bluetooth settings
deactivate btwrkr
srvbt -> appstgs : BluetoothMessage::ResponseBluetoothStatus
activate appstgs
deactivate srvbt
appstgs ->o btwndw : Recreate Bluetooth Window with new bluetoothStatus
deactivate appstgs
deactivate btwndw

@enduml

A module-bluetooth/change_bt_status_flowchart.svg => module-bluetooth/change_bt_status_flowchart.svg +55 -0
@@ 0,0 1,55 @@
<?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="790px" preserveAspectRatio="none" style="width:1494px;height:790px;" version="1.1" viewBox="0 0 1494 790" width="1494px" zoomAndPan="magnify"><defs><filter height="300%" id="f1blwi1hdashva" 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><rect fill="#FFFFFF" filter="url(#f1blwi1hdashva)" height="59.1328" style="stroke: #A80036; stroke-width: 1.0;" width="10" x="246" y="160.5625"/><rect fill="#FFFFFF" filter="url(#f1blwi1hdashva)" height="59.1328" style="stroke: #A80036; stroke-width: 1.0;" width="10" x="246" y="307.9609"/><rect fill="#FFFFFF" filter="url(#f1blwi1hdashva)" height="59.1328" style="stroke: #A80036; stroke-width: 1.0;" width="10" x="246" y="626.1563"/><rect fill="#FFFFFF" filter="url(#f1blwi1hdashva)" height="89.1328" style="stroke: #A80036; stroke-width: 1.0;" width="10" x="614" y="189.6953"/><rect fill="#FFFFFF" filter="url(#f1blwi1hdashva)" height="29.1328" style="stroke: #A80036; stroke-width: 1.0;" width="10" x="614" y="396.2266"/><rect fill="#FFFFFF" filter="url(#f1blwi1hdashva)" height="89.1328" style="stroke: #A80036; stroke-width: 1.0;" width="10" x="926" y="248.8281"/><rect fill="#FFFFFF" filter="url(#f1blwi1hdashva)" height="230.7969" style="stroke: #A80036; stroke-width: 1.0;" width="10" x="926" y="425.3594"/><rect fill="#FFFFFF" filter="url(#f1blwi1hdashva)" height="35.1328" style="stroke: #A80036; stroke-width: 1.0;" width="10" x="1238" y="554.8906"/><line style="stroke: #A80036; stroke-width: 1.0; stroke-dasharray: 5.0,5.0;" x1="27" x2="27" y1="86.2969" y2="703.2891"/><line style="stroke: #A80036; stroke-width: 1.0; stroke-dasharray: 5.0,5.0;" x1="251" x2="251" y1="86.2969" y2="703.2891"/><line style="stroke: #A80036; stroke-width: 1.0; stroke-dasharray: 5.0,5.0;" x1="619" x2="619" y1="86.2969" y2="703.2891"/><line style="stroke: #A80036; stroke-width: 1.0; stroke-dasharray: 5.0,5.0;" x1="931" x2="931" y1="86.2969" y2="703.2891"/><line style="stroke: #A80036; stroke-width: 1.0; stroke-dasharray: 5.0,5.0;" x1="1242.5" x2="1242.5" y1="86.2969" y2="703.2891"/><line style="stroke: #A80036; stroke-width: 1.0; stroke-dasharray: 5.0,5.0;" x1="1430.5" x2="1430.5" y1="86.2969" y2="703.2891"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacingAndGlyphs" textLength="32" x="8" y="82.9951">User</text><ellipse cx="27" cy="13" fill="#FEFECE" filter="url(#f1blwi1hdashva)" rx="8" ry="8" style="stroke: #A80036; stroke-width: 2.0;"/><path d="M27,21 L27,48 M14,29 L40,29 M27,48 L14,63 M27,48 L40,63 " fill="none" filter="url(#f1blwi1hdashva)" style="stroke: #A80036; stroke-width: 2.0;"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacingAndGlyphs" textLength="32" x="8" y="715.2842">User</text><ellipse cx="27" cy="728.5859" fill="#FEFECE" filter="url(#f1blwi1hdashva)" rx="8" ry="8" style="stroke: #A80036; stroke-width: 2.0;"/><path d="M27,736.5859 L27,763.5859 M14,744.5859 L40,744.5859 M27,763.5859 L14,778.5859 M27,763.5859 L40,778.5859 " fill="none" filter="url(#f1blwi1hdashva)" style="stroke: #A80036; stroke-width: 2.0;"/><rect fill="#FEFECE" filter="url(#f1blwi1hdashva)" height="30.2969" style="stroke: #A80036; stroke-width: 1.5;" width="150" x="174" y="51"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacingAndGlyphs" textLength="136" x="181" y="70.9951">Application Settings</text><rect fill="#FEFECE" filter="url(#f1blwi1hdashva)" height="30.2969" style="stroke: #A80036; stroke-width: 1.5;" width="150" x="174" y="702.2891"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacingAndGlyphs" textLength="136" x="181" y="722.2842">Application Settings</text><rect fill="#FEFECE" filter="url(#f1blwi1hdashva)" height="30.2969" style="stroke: #A80036; stroke-width: 1.5;" width="140" x="547" y="51"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacingAndGlyphs" textLength="126" x="554" y="70.9951">Bluetooth Window</text><rect fill="#FEFECE" filter="url(#f1blwi1hdashva)" height="30.2969" style="stroke: #A80036; stroke-width: 1.5;" width="140" x="547" y="702.2891"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacingAndGlyphs" textLength="126" x="554" y="722.2842">Bluetooth Window</text><rect fill="#FEFECE" filter="url(#f1blwi1hdashva)" height="30.2969" style="stroke: #A80036; stroke-width: 1.5;" width="136" x="861" y="51"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacingAndGlyphs" textLength="122" x="868" y="70.9951">Service Bluetooth</text><rect fill="#FEFECE" filter="url(#f1blwi1hdashva)" height="30.2969" style="stroke: #A80036; stroke-width: 1.5;" width="136" x="861" y="702.2891"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacingAndGlyphs" textLength="122" x="868" y="722.2842">Service Bluetooth</text><rect fill="#FEFECE" filter="url(#f1blwi1hdashva)" height="30.2969" style="stroke: #A80036; stroke-width: 1.5;" width="135" x="1173.5" y="51"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacingAndGlyphs" textLength="121" x="1180.5" y="70.9951">Bluetooth Worker</text><rect fill="#FEFECE" filter="url(#f1blwi1hdashva)" height="30.2969" style="stroke: #A80036; stroke-width: 1.5;" width="135" x="1173.5" y="702.2891"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacingAndGlyphs" textLength="121" x="1180.5" y="722.2842">Bluetooth Worker</text><rect fill="#FEFECE" filter="url(#f1blwi1hdashva)" height="30.2969" style="stroke: #A80036; stroke-width: 1.5;" width="89" x="1384.5" y="51"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacingAndGlyphs" textLength="75" x="1391.5" y="70.9951">Service DB</text><rect fill="#FEFECE" filter="url(#f1blwi1hdashva)" height="30.2969" style="stroke: #A80036; stroke-width: 1.5;" width="89" x="1384.5" y="702.2891"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacingAndGlyphs" textLength="75" x="1391.5" y="722.2842">Service DB</text><rect fill="#FFFFFF" filter="url(#f1blwi1hdashva)" height="59.1328" style="stroke: #A80036; stroke-width: 1.0;" width="10" x="246" y="160.5625"/><rect fill="#FFFFFF" filter="url(#f1blwi1hdashva)" height="59.1328" style="stroke: #A80036; stroke-width: 1.0;" width="10" x="246" y="307.9609"/><rect fill="#FFFFFF" filter="url(#f1blwi1hdashva)" height="59.1328" style="stroke: #A80036; stroke-width: 1.0;" width="10" x="246" y="626.1563"/><rect fill="#FFFFFF" filter="url(#f1blwi1hdashva)" height="89.1328" style="stroke: #A80036; stroke-width: 1.0;" width="10" x="614" y="189.6953"/><rect fill="#FFFFFF" filter="url(#f1blwi1hdashva)" height="29.1328" style="stroke: #A80036; stroke-width: 1.0;" width="10" x="614" y="396.2266"/><rect fill="#FFFFFF" filter="url(#f1blwi1hdashva)" height="89.1328" style="stroke: #A80036; stroke-width: 1.0;" width="10" x="926" y="248.8281"/><rect fill="#FFFFFF" filter="url(#f1blwi1hdashva)" height="230.7969" style="stroke: #A80036; stroke-width: 1.0;" width="10" x="926" y="425.3594"/><rect fill="#FFFFFF" filter="url(#f1blwi1hdashva)" height="35.1328" style="stroke: #A80036; stroke-width: 1.0;" width="10" x="1238" y="554.8906"/><rect fill="#EEEEEE" filter="url(#f1blwi1hdashva)" height="3" style="stroke: #EEEEEE; stroke-width: 1.0;" width="1479.5" x="3" y="116.8633"/><line style="stroke: #000000; stroke-width: 1.0;" x1="3" x2="1482.5" y1="116.8633" y2="116.8633"/><line style="stroke: #000000; stroke-width: 1.0;" x1="3" x2="1482.5" y1="119.8633" y2="119.8633"/><rect fill="#EEEEEE" filter="url(#f1blwi1hdashva)" height="23.1328" style="stroke: #000000; stroke-width: 2.0;" width="238" x="623.75" y="106.2969"/><text fill="#000000" font-family="sans-serif" font-size="13" font-weight="bold" lengthAdjust="spacingAndGlyphs" textLength="219" x="629.75" y="122.3638">Change Bluetooth status flow</text><polygon fill="#A80036" points="234,156.5625,244,160.5625,234,164.5625,238,160.5625" style="stroke: #A80036; stroke-width: 1.0;"/><line style="stroke: #A80036; stroke-width: 1.0;" x1="27" x2="240" y1="160.5625" y2="160.5625"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacingAndGlyphs" textLength="200" x="34" y="155.4966">Tries to open Bluetooth Window</text><polygon fill="#A80036" points="602,185.6953,612,189.6953,602,193.6953,606,189.6953" style="stroke: #A80036; stroke-width: 1.0;"/><line style="stroke: #A80036; stroke-width: 1.0;" x1="256" x2="608" y1="189.6953" y2="189.6953"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacingAndGlyphs" textLength="160" x="263" y="184.6294">Create Bluetooth Window</text><polygon fill="#A80036" points="914,244.8281,924,248.8281,914,252.8281,918,248.8281" style="stroke: #A80036; stroke-width: 1.0;"/><line style="stroke: #A80036; stroke-width: 1.0;" x1="624" x2="920" y1="248.8281" y2="248.8281"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacingAndGlyphs" textLength="283" x="631" y="243.7622">BluetoothMessage::RequestBluetoothStatus</text><polygon fill="#A80036" points="267,303.9609,257,307.9609,267,311.9609,263,307.9609" style="stroke: #A80036; stroke-width: 1.0;"/><line style="stroke: #A80036; stroke-width: 1.0;" x1="261" x2="925" y1="307.9609" y2="307.9609"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacingAndGlyphs" textLength="293" x="273" y="302.895">BluetoothMessage::ResponseBluetoothStatus</text><ellipse cx="618.5" cy="366.3438" fill="none" rx="4" ry="4" style="stroke: #A80036; stroke-width: 1.5;"/><polygon fill="#A80036" points="601.5,363.0938,611.5,367.0938,601.5,371.0938,605.5,367.0938" style="stroke: #A80036; stroke-width: 1.0;"/><line style="stroke: #A80036; stroke-width: 1.0;" x1="251" x2="607.5" y1="367.0938" y2="367.0938"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacingAndGlyphs" textLength="339" x="258" y="362.0278">Recreate Bluetooth Window with new bluetoothStatus</text><polygon fill="#A80036" points="602,392.2266,612,396.2266,602,400.2266,606,396.2266" style="stroke: #A80036; stroke-width: 1.0;"/><line style="stroke: #A80036; stroke-width: 1.0;" x1="27" x2="608" y1="396.2266" y2="396.2266"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacingAndGlyphs" textLength="156" x="34" y="391.1606">Changes bluetoothState</text><polygon fill="#A80036" points="914,421.3594,924,425.3594,914,429.3594,918,425.3594" style="stroke: #A80036; stroke-width: 1.0;"/><line style="stroke: #A80036; stroke-width: 1.0;" x1="619" x2="920" y1="425.3594" y2="425.3594"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacingAndGlyphs" textLength="253" x="626" y="420.2935">BluetoothMessage::SetBluetoothStatus</text><line style="stroke: #A80036; stroke-width: 1.0;" x1="936" x2="978" y1="454.4922" y2="454.4922"/><line style="stroke: #A80036; stroke-width: 1.0;" x1="978" x2="978" y1="454.4922" y2="467.4922"/><line style="stroke: #A80036; stroke-width: 1.0;" x1="937" x2="978" y1="467.4922" y2="467.4922"/><polygon fill="#A80036" points="947,463.4922,937,467.4922,947,471.4922,943,467.4922" style="stroke: #A80036; stroke-width: 1.0;"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacingAndGlyphs" textLength="288" x="943" y="449.4263">Cache received new value of bluetoothStatus</text><ellipse cx="1430.5" cy="495.875" fill="none" rx="4" ry="4" style="stroke: #A80036; stroke-width: 1.5;"/><polygon fill="#A80036" points="1413.5,492.625,1423.5,496.625,1413.5,500.625,1417.5,496.625" style="stroke: #A80036; stroke-width: 1.0;"/><line style="stroke: #A80036; stroke-width: 1.0;" x1="936" x2="1419.5" y1="496.625" y2="496.625"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacingAndGlyphs" textLength="223" x="943" y="491.5591">Settings::setValue(bluetoothState)</text><ellipse cx="1430.5" cy="525.0078" fill="none" rx="4" ry="4" style="stroke: #A80036; stroke-width: 1.5;"/><polygon fill="#A80036" points="1413.5,521.7578,1423.5,525.7578,1413.5,529.7578,1417.5,525.7578" style="stroke: #A80036; stroke-width: 1.0;"/><line style="stroke: #A80036; stroke-width: 1.0;" x1="936" x2="1419.5" y1="525.7578" y2="525.7578"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacingAndGlyphs" textLength="219" x="943" y="520.6919">Settings::setValue(deviceVisibility)</text><polygon fill="#A80036" points="1226,550.8906,1236,554.8906,1226,558.8906,1230,554.8906" style="stroke: #A80036; stroke-width: 1.0;"/><line style="stroke: #A80036; stroke-width: 1.0;" x1="936" x2="1232" y1="554.8906" y2="554.8906"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacingAndGlyphs" textLength="201" x="943" y="549.8247">Pass cached Bluetooth settings</text><ellipse cx="1241.5" cy="601.2734" fill="none" rx="4" ry="4" style="stroke: #A80036; stroke-width: 1.5;"/><line style="stroke: #A80036; stroke-width: 1.0;" x1="1248" x2="1290" y1="589.0234" y2="589.0234"/><line style="stroke: #A80036; stroke-width: 1.0;" x1="1290" x2="1290" y1="589.0234" y2="602.0234"/><line style="stroke: #A80036; stroke-width: 1.0;" x1="1247" x2="1290" y1="602.0234" y2="602.0234"/><polygon fill="#A80036" points="1257,598.0234,1247,602.0234,1257,606.0234,1253,602.0234" style="stroke: #A80036; stroke-width: 1.0;"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacingAndGlyphs" textLength="164" x="1255" y="583.9575">Reload Bluetooth settings</text><polygon fill="#A80036" points="267,622.1563,257,626.1563,267,630.1563,263,626.1563" style="stroke: #A80036; stroke-width: 1.0;"/><line style="stroke: #A80036; stroke-width: 1.0;" x1="261" x2="925" y1="626.1563" y2="626.1563"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacingAndGlyphs" textLength="293" x="273" y="621.0903">BluetoothMessage::ResponseBluetoothStatus</text><ellipse cx="618.5" cy="684.5391" fill="none" rx="4" ry="4" style="stroke: #A80036; stroke-width: 1.5;"/><polygon fill="#A80036" points="601.5,681.2891,611.5,685.2891,601.5,689.2891,605.5,685.2891" style="stroke: #A80036; stroke-width: 1.0;"/><line style="stroke: #A80036; stroke-width: 1.0;" x1="251" x2="607.5" y1="685.2891" y2="685.2891"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacingAndGlyphs" textLength="339" x="258" y="680.2231">Recreate Bluetooth Window with new bluetoothStatus</text><!--MD5=[f655940fd29eb5eebed74115cd6164db]
@startuml
actor User
participant "Application Settings" as appstgs
participant "Bluetooth Window" as btwndw
participant "Service Bluetooth" as srvbt
participant "Bluetooth Worker" as btwrkr
participant "Service DB" as srvdb

    == Change Bluetooth status flow ==

User ->appstgs : Tries to open Bluetooth Window
activate appstgs
appstgs -> btwndw : Create Bluetooth Window
    activate btwndw
    deactivate appstgs
btwndw -> srvbt : BluetoothMessage::RequestBluetoothStatus
    activate srvbt
    deactivate btwndw
srvbt -> appstgs : BluetoothMessage::ResponseBluetoothStatus
activate appstgs
deactivate srvbt
appstgs ->o btwndw : Recreate Bluetooth Window with new bluetoothStatus
deactivate appstgs

User -> btwndw : Changes bluetoothState
activate btwndw
btwndw -> srvbt : BluetoothMessage::SetBluetoothStatus
deactivate btwndw
activate srvbt
srvbt -> srvbt : Cache received new value of bluetoothStatus
srvbt ->o srvdb : Settings::setValue(bluetoothState)
srvbt ->o srvdb : Settings::setValue(deviceVisibility)
srvbt -> btwrkr : Pass cached Bluetooth settings
activate btwrkr
btwrkr ->o btwrkr : Reload Bluetooth settings
deactivate btwrkr
srvbt -> appstgs : BluetoothMessage::ResponseBluetoothStatus
activate appstgs
deactivate srvbt
appstgs ->o btwndw : Recreate Bluetooth Window with new bluetoothStatus
deactivate appstgs
deactivate btwndw
@enduml

PlantUML version 1.2019.12(Sun Nov 03 10:24:54 UTC 2019)
(GPL source distribution)
Java Runtime: OpenJDK Runtime Environment
JVM: OpenJDK 64-Bit Server VM
Java Version: 1.8.0_232-heroku-b09
Operating System: Linux
Default Encoding: UTF-8
Language: en
Country: US
--></g></svg>

A module-bluetooth/load_bt_settings_from_db_on_service_start_flowchart.puml => module-bluetooth/load_bt_settings_from_db_on_service_start_flowchart.puml +42 -0
@@ 0,0 1,42 @@
@startuml

participant "Service DB" as srvdb
participant "Service Bluetooth" as srvbt
participant "Bluetooth Worker" as btwrkr

    == Load Bluetooth Settings on startup flow ==

[o->srvbt : need Bluetooth Settings
activate srvbt
srvbt -> srvdb : Settings::registerValueChange(bluetoothState)
    activate srvdb
srvbt -> srvdb : Settings::registerValueChange(deviceVisibility)
srvbt -> srvdb : Settings::registerValueChange(deviceName)
srvbt -> srvdb : Settings::registerValueChange(bondedDevices)

deactivate srvbt

srvbt <- srvdb : activate callback with new value (bluetoothState)
activate srvbt
srvbt <- srvdb : activate callback with new value (deviceVisibility)
srvbt <- srvdb : activate callback with new value (deviceName)
srvbt <- srvdb : activate callback with new value (bondedDevices)
deactivate srvdb

srvbt -> srvdb : Settings::unregisterValueChange(bluetoothState)
    activate srvdb
srvbt -> srvdb : Settings::unregisterValueChange(deviceVisibility)
srvbt -> srvdb : Settings::unregisterValueChange(deviceName)
srvbt -> srvdb : Settings::unregisterValueChange(bondedDevices)

deactivate srvdb

srvbt -> btwrkr : Pass cached Bluetooth settings

deactivate srvbt
activate btwrkr
btwrkr -> btwrkr : reload Bluetooth settings

deactivate btwrkr

@enduml

A module-bluetooth/load_bt_settings_from_db_on_service_start_flowchart.svg => module-bluetooth/load_bt_settings_from_db_on_service_start_flowchart.svg +52 -0
@@ 0,0 1,52 @@
<?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="591px" preserveAspectRatio="none" style="width:834px;height:591px;" version="1.1" viewBox="0 0 834 591" width="834px" zoomAndPan="magnify"><defs><filter height="300%" id="f16c6p4usmag08" 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><rect fill="#FFFFFF" filter="url(#f16c6p4usmag08)" height="203.9297" style="stroke: #A80036; stroke-width: 1.0;" width="10" x="49.5" y="141.6953"/><rect fill="#FFFFFF" filter="url(#f16c6p4usmag08)" height="87.3984" style="stroke: #A80036; stroke-width: 1.0;" width="10" x="49.5" y="374.7578"/><rect fill="#FFFFFF" filter="url(#f16c6p4usmag08)" height="116.5313" style="stroke: #A80036; stroke-width: 1.0;" width="10" x="402.5" y="112.5625"/><rect fill="#FFFFFF" filter="url(#f16c6p4usmag08)" height="233.0625" style="stroke: #A80036; stroke-width: 1.0;" width="10" x="402.5" y="258.2266"/><rect fill="#FFFFFF" filter="url(#f16c6p4usmag08)" height="35.1328" style="stroke: #A80036; stroke-width: 1.0;" width="10" x="632.5" y="491.2891"/><line style="stroke: #A80036; stroke-width: 1.0; stroke-dasharray: 5.0,5.0;" x1="54" x2="54" y1="38.2969" y2="551.4219"/><line style="stroke: #A80036; stroke-width: 1.0; stroke-dasharray: 5.0,5.0;" x1="407.5" x2="407.5" y1="38.2969" y2="551.4219"/><line style="stroke: #A80036; stroke-width: 1.0; stroke-dasharray: 5.0,5.0;" x1="637" x2="637" y1="38.2969" y2="551.4219"/><rect fill="#FEFECE" filter="url(#f16c6p4usmag08)" height="30.2969" style="stroke: #A80036; stroke-width: 1.5;" width="89" x="8" y="3"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacingAndGlyphs" textLength="75" x="15" y="22.9951">Service DB</text><rect fill="#FEFECE" filter="url(#f16c6p4usmag08)" height="30.2969" style="stroke: #A80036; stroke-width: 1.5;" width="89" x="8" y="550.4219"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacingAndGlyphs" textLength="75" x="15" y="570.417">Service DB</text><rect fill="#FEFECE" filter="url(#f16c6p4usmag08)" height="30.2969" style="stroke: #A80036; stroke-width: 1.5;" width="136" x="337.5" y="3"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacingAndGlyphs" textLength="122" x="344.5" y="22.9951">Service Bluetooth</text><rect fill="#FEFECE" filter="url(#f16c6p4usmag08)" height="30.2969" style="stroke: #A80036; stroke-width: 1.5;" width="136" x="337.5" y="550.4219"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacingAndGlyphs" textLength="122" x="344.5" y="570.417">Service Bluetooth</text><rect fill="#FEFECE" filter="url(#f16c6p4usmag08)" height="30.2969" style="stroke: #A80036; stroke-width: 1.5;" width="135" x="568" y="3"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacingAndGlyphs" textLength="121" x="575" y="22.9951">Bluetooth Worker</text><rect fill="#FEFECE" filter="url(#f16c6p4usmag08)" height="30.2969" style="stroke: #A80036; stroke-width: 1.5;" width="135" x="568" y="550.4219"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacingAndGlyphs" textLength="121" x="575" y="570.417">Bluetooth Worker</text><rect fill="#FFFFFF" filter="url(#f16c6p4usmag08)" height="203.9297" style="stroke: #A80036; stroke-width: 1.0;" width="10" x="49.5" y="141.6953"/><rect fill="#FFFFFF" filter="url(#f16c6p4usmag08)" height="87.3984" style="stroke: #A80036; stroke-width: 1.0;" width="10" x="49.5" y="374.7578"/><rect fill="#FFFFFF" filter="url(#f16c6p4usmag08)" height="116.5313" style="stroke: #A80036; stroke-width: 1.0;" width="10" x="402.5" y="112.5625"/><rect fill="#FFFFFF" filter="url(#f16c6p4usmag08)" height="233.0625" style="stroke: #A80036; stroke-width: 1.0;" width="10" x="402.5" y="258.2266"/><rect fill="#FFFFFF" filter="url(#f16c6p4usmag08)" height="35.1328" style="stroke: #A80036; stroke-width: 1.0;" width="10" x="632.5" y="491.2891"/><rect fill="#EEEEEE" filter="url(#f16c6p4usmag08)" height="3" style="stroke: #EEEEEE; stroke-width: 1.0;" width="819.5" x="3" y="68.8633"/><line style="stroke: #000000; stroke-width: 1.0;" x1="3" x2="822.5" y1="68.8633" y2="68.8633"/><line style="stroke: #000000; stroke-width: 1.0;" x1="3" x2="822.5" y1="71.8633" y2="71.8633"/><rect fill="#EEEEEE" filter="url(#f16c6p4usmag08)" height="23.1328" style="stroke: #000000; stroke-width: 2.0;" width="315" x="255.25" y="58.2969"/><text fill="#000000" font-family="sans-serif" font-size="13" font-weight="bold" lengthAdjust="spacingAndGlyphs" textLength="296" x="261.25" y="74.3638">Load Bluetooth Settings on startup flow</text><ellipse cx="10.5" cy="111.8125" fill="none" rx="4" ry="4" style="stroke: #A80036; stroke-width: 1.5;"/><polygon fill="#A80036" points="390.5,108.5625,400.5,112.5625,390.5,116.5625,394.5,112.5625" style="stroke: #A80036; stroke-width: 1.0;"/><line style="stroke: #A80036; stroke-width: 1.0;" x1="15" x2="396.5" y1="112.5625" y2="112.5625"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacingAndGlyphs" textLength="155" x="18" y="107.4966">need Bluetooth Settings</text><polygon fill="#A80036" points="70.5,137.6953,60.5,141.6953,70.5,145.6953,66.5,141.6953" style="stroke: #A80036; stroke-width: 1.0;"/><line style="stroke: #A80036; stroke-width: 1.0;" x1="64.5" x2="401.5" y1="141.6953" y2="141.6953"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacingAndGlyphs" textLength="301" x="76.5" y="136.6294">Settings::registerValueChange(bluetoothState)</text><polygon fill="#A80036" points="70.5,166.8281,60.5,170.8281,70.5,174.8281,66.5,170.8281" style="stroke: #A80036; stroke-width: 1.0;"/><line style="stroke: #A80036; stroke-width: 1.0;" x1="64.5" x2="401.5" y1="170.8281" y2="170.8281"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacingAndGlyphs" textLength="297" x="76.5" y="165.7622">Settings::registerValueChange(deviceVisibility)</text><polygon fill="#A80036" points="70.5,195.9609,60.5,199.9609,70.5,203.9609,66.5,199.9609" style="stroke: #A80036; stroke-width: 1.0;"/><line style="stroke: #A80036; stroke-width: 1.0;" x1="64.5" x2="401.5" y1="199.9609" y2="199.9609"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacingAndGlyphs" textLength="285" x="76.5" y="194.895">Settings::registerValueChange(deviceName)</text><polygon fill="#A80036" points="70.5,225.0938,60.5,229.0938,70.5,233.0938,66.5,229.0938" style="stroke: #A80036; stroke-width: 1.0;"/><line style="stroke: #A80036; stroke-width: 1.0;" x1="64.5" x2="406.5" y1="229.0938" y2="229.0938"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacingAndGlyphs" textLength="303" x="76.5" y="224.0278">Settings::registerValueChange(bondedDevices)</text><polygon fill="#A80036" points="390.5,254.2266,400.5,258.2266,390.5,262.2266,394.5,258.2266" style="stroke: #A80036; stroke-width: 1.0;"/><line style="stroke: #A80036; stroke-width: 1.0;" x1="59.5" x2="396.5" y1="258.2266" y2="258.2266"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacingAndGlyphs" textLength="312" x="66.5" y="253.1606">activate callback with new value (bluetoothState)</text><polygon fill="#A80036" points="390.5,283.3594,400.5,287.3594,390.5,291.3594,394.5,287.3594" style="stroke: #A80036; stroke-width: 1.0;"/><line style="stroke: #A80036; stroke-width: 1.0;" x1="59.5" x2="396.5" y1="287.3594" y2="287.3594"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacingAndGlyphs" textLength="308" x="66.5" y="282.2935">activate callback with new value (deviceVisibility)</text><polygon fill="#A80036" points="390.5,312.4922,400.5,316.4922,390.5,320.4922,394.5,316.4922" style="stroke: #A80036; stroke-width: 1.0;"/><line style="stroke: #A80036; stroke-width: 1.0;" x1="59.5" x2="396.5" y1="316.4922" y2="316.4922"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacingAndGlyphs" textLength="296" x="66.5" y="311.4263">activate callback with new value (deviceName)</text><polygon fill="#A80036" points="390.5,341.625,400.5,345.625,390.5,349.625,394.5,345.625" style="stroke: #A80036; stroke-width: 1.0;"/><line style="stroke: #A80036; stroke-width: 1.0;" x1="54.5" x2="396.5" y1="345.625" y2="345.625"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacingAndGlyphs" textLength="314" x="61.5" y="340.5591">activate callback with new value (bondedDevices)</text><polygon fill="#A80036" points="70.5,370.7578,60.5,374.7578,70.5,378.7578,66.5,374.7578" style="stroke: #A80036; stroke-width: 1.0;"/><line style="stroke: #A80036; stroke-width: 1.0;" x1="64.5" x2="401.5" y1="374.7578" y2="374.7578"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacingAndGlyphs" textLength="317" x="76.5" y="369.6919">Settings::unregisterValueChange(bluetoothState)</text><polygon fill="#A80036" points="70.5,399.8906,60.5,403.8906,70.5,407.8906,66.5,403.8906" style="stroke: #A80036; stroke-width: 1.0;"/><line style="stroke: #A80036; stroke-width: 1.0;" x1="64.5" x2="401.5" y1="403.8906" y2="403.8906"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacingAndGlyphs" textLength="313" x="76.5" y="398.8247">Settings::unregisterValueChange(deviceVisibility)</text><polygon fill="#A80036" points="70.5,429.0234,60.5,433.0234,70.5,437.0234,66.5,433.0234" style="stroke: #A80036; stroke-width: 1.0;"/><line style="stroke: #A80036; stroke-width: 1.0;" x1="64.5" x2="401.5" y1="433.0234" y2="433.0234"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacingAndGlyphs" textLength="301" x="76.5" y="427.9575">Settings::unregisterValueChange(deviceName)</text><polygon fill="#A80036" points="65.5,458.1563,55.5,462.1563,65.5,466.1563,61.5,462.1563" style="stroke: #A80036; stroke-width: 1.0;"/><line style="stroke: #A80036; stroke-width: 1.0;" x1="59.5" x2="401.5" y1="462.1563" y2="462.1563"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacingAndGlyphs" textLength="319" x="71.5" y="457.0903">Settings::unregisterValueChange(bondedDevices)</text><polygon fill="#A80036" points="620.5,487.2891,630.5,491.2891,620.5,495.2891,624.5,491.2891" style="stroke: #A80036; stroke-width: 1.0;"/><line style="stroke: #A80036; stroke-width: 1.0;" x1="407.5" x2="626.5" y1="491.2891" y2="491.2891"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacingAndGlyphs" textLength="201" x="414.5" y="486.2231">Pass cached Bluetooth settings</text><line style="stroke: #A80036; stroke-width: 1.0;" x1="642.5" x2="684.5" y1="525.4219" y2="525.4219"/><line style="stroke: #A80036; stroke-width: 1.0;" x1="684.5" x2="684.5" y1="525.4219" y2="538.4219"/><line style="stroke: #A80036; stroke-width: 1.0;" x1="637.5" x2="684.5" y1="538.4219" y2="538.4219"/><polygon fill="#A80036" points="647.5,534.4219,637.5,538.4219,647.5,542.4219,643.5,538.4219" style="stroke: #A80036; stroke-width: 1.0;"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthAdjust="spacingAndGlyphs" textLength="161" x="649.5" y="520.356">reload Bluetooth settings</text><!--MD5=[4d9c8857c780332cca01714f51f346a9]
@startuml
participant "Service DB" as srvdb
participant "Service Bluetooth" as srvbt
participant "Bluetooth Worker" as btwrkr

    == Load Bluetooth Settings on startup flow ==

[o->srvbt : need Bluetooth Settings
activate srvbt
srvbt -> srvdb : Settings::registerValueChange(bluetoothState)
    activate srvdb
srvbt -> srvdb : Settings::registerValueChange(deviceVisibility)
srvbt -> srvdb : Settings::registerValueChange(deviceName)
srvbt -> srvdb : Settings::registerValueChange(bondedDevices)

deactivate srvbt

srvbt <- srvdb : activate callback with new value (bluetoothState)
activate srvbt
srvbt <- srvdb : activate callback with new value (deviceVisibility)
srvbt <- srvdb : activate callback with new value (deviceName)
srvbt <- srvdb : activate callback with new value (bondedDevices)
deactivate srvdb

srvbt -> srvdb : Settings::unregisterValueChange(bluetoothState)
    activate srvdb
srvbt -> srvdb : Settings::unregisterValueChange(deviceVisibility)
srvbt -> srvdb : Settings::unregisterValueChange(deviceName)
srvbt -> srvdb : Settings::unregisterValueChange(bondedDevices)

deactivate srvdb

srvbt -> btwrkr : Pass cached Bluetooth settings

deactivate srvbt
activate btwrkr
btwrkr -> btwrkr : reload Bluetooth settings

deactivate btwrkr
@enduml

PlantUML version 1.2019.12(Sun Nov 03 10:24:54 UTC 2019)
(GPL source distribution)
Java Runtime: OpenJDK Runtime Environment
JVM: OpenJDK 64-Bit Server VM
Java Version: 1.8.0_232-heroku-b09
Operating System: Linux
Default Encoding: UTF-8
Language: en
Country: US
--></g></svg>

A module-bluetooth/service_bt_internals.puml => module-bluetooth/service_bt_internals.puml +13 -0
@@ 0,0 1,13 @@
@startuml

package ServiceBluetooth {
  object BluetoothSettings {
  bluetoothState
  bondedDevices
  deviceVisibilty
  deviceName
}
  class BluetoothWorker{}
}

@enduml

A module-bluetooth/service_bt_internals.svg => module-bluetooth/service_bt_internals.svg +25 -0
@@ 0,0 1,25 @@
<?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="136px" preserveAspectRatio="none" style="width:352px;height:136px;" version="1.1" viewBox="0 0 352 136" width="352px" zoomAndPan="magnify"><defs><filter height="300%" id="fmppo68x28gj4" 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=[0548101af59ed75e13a0ca2991bca20a]
cluster ServiceBluetooth--><polygon fill="#FFFFFF" filter="url(#fmppo68x28gj4)" points="14,16,155,16,162,38.2969,330,38.2969,330,124,14,124,14,16" style="stroke: #000000; stroke-width: 1.5;"/><line style="stroke: #000000; stroke-width: 1.5;" x1="14" x2="162" y1="38.2969" y2="38.2969"/><text fill="#000000" font-family="sans-serif" font-size="14" font-weight="bold" lengthAdjust="spacingAndGlyphs" textLength="135" x="18" y="30.9951">ServiceBluetooth</text><rect fill="#FEFECE" filter="url(#fmppo68x28gj4)" height="72.5313" style="stroke: #A80036; stroke-width: 1.5;" width="127" x="194.5" y="43"/><text fill="#000000" font-family="sans-serif" font-size="12" lengthAdjust="spacingAndGlyphs" textLength="113" x="201.5" y="56.1387">BluetoothSettings</text><line style="stroke: #A80036; stroke-width: 1.5;" x1="195.5" x2="320.5" y1="60.9688" y2="60.9688"/><text fill="#000000" font-family="sans-serif" font-size="10" lengthAdjust="spacingAndGlyphs" textLength="73" x="200.5" y="74.251">bluetoothState</text><text fill="#000000" font-family="sans-serif" font-size="10" lengthAdjust="spacingAndGlyphs" textLength="74" x="200.5" y="85.8916">bondedDevices</text><text fill="#000000" font-family="sans-serif" font-size="10" lengthAdjust="spacingAndGlyphs" textLength="67" x="200.5" y="97.5322">deviceVisibilty</text><text fill="#000000" font-family="sans-serif" font-size="10" lengthAdjust="spacingAndGlyphs" textLength="61" x="200.5" y="109.1729">deviceName</text><!--MD5=[03d44597ab286d6d2e01a8c181857d8a]
class BluetoothWorker--><rect fill="#FEFECE" filter="url(#fmppo68x28gj4)" height="48" id="BluetoothWorker" style="stroke: #A80036; stroke-width: 1.5;" width="137" x="22.5" y="55.5"/><ellipse cx="37.5" cy="71.5" fill="#ADD1B2" rx="11" ry="11" style="stroke: #A80036; stroke-width: 1.0;"/><path d="M40.4688,77.1406 Q39.8906,77.4375 39.25,77.5859 Q38.6094,77.7344 37.9063,77.7344 Q35.4063,77.7344 34.0859,76.0859 Q32.7656,74.4375 32.7656,71.3125 Q32.7656,68.1875 34.0859,66.5313 Q35.4063,64.875 37.9063,64.875 Q38.6094,64.875 39.2578,65.0313 Q39.9063,65.1875 40.4688,65.4844 L40.4688,68.2031 Q39.8438,67.625 39.25,67.3516 Q38.6563,67.0781 38.0313,67.0781 Q36.6875,67.0781 36,68.1484 Q35.3125,69.2188 35.3125,71.3125 Q35.3125,73.4063 36,74.4766 Q36.6875,75.5469 38.0313,75.5469 Q38.6563,75.5469 39.25,75.2734 Q39.8438,75 40.4688,74.4219 L40.4688,77.1406 Z "/><text fill="#000000" font-family="sans-serif" font-size="12" lengthAdjust="spacingAndGlyphs" textLength="105" x="51.5" y="75.6543">BluetoothWorker</text><line style="stroke: #A80036; stroke-width: 1.5;" x1="23.5" x2="158.5" y1="87.5" y2="87.5"/><line style="stroke: #A80036; stroke-width: 1.5;" x1="23.5" x2="158.5" y1="95.5" y2="95.5"/><!--MD5=[c20615217e79f31a2461766256926e8e]
@startuml
package ServiceBluetooth {
  object BluetoothSettings {
  bluetoothState
  bondedDevices
  deviceVisibilty
  deviceName
}
  class BluetoothWorker{}
}
@enduml

PlantUML version 1.2019.12(Sun Nov 03 10:24:54 UTC 2019)
(GPL source distribution)
Java Runtime: OpenJDK Runtime Environment
JVM: OpenJDK 64-Bit Server VM
Java Version: 1.8.0_232-heroku-b09
Operating System: Linux
Default Encoding: UTF-8
Language: en
Country: US
--></g></svg>