Skip to content

Commit

Permalink
deploy: 220c2a4
Browse files Browse the repository at this point in the history
  • Loading branch information
cziter15 committed May 28, 2024
1 parent 91f378d commit 29c0d5a
Show file tree
Hide file tree
Showing 33 changed files with 72 additions and 65 deletions.
3 changes: 2 additions & 1 deletion doxygen_crawl.html
Original file line number Diff line number Diff line change
Expand Up @@ -445,6 +445,7 @@
<a href="index.html#autotoc_md15"/>
<a href="index.html#autotoc_md16"/>
<a href="index.html#autotoc_md17"/>
<a href="index.html#autotoc_md18"/>
<a href="index.html#autotoc_md3"/>
<a href="index.html#autotoc_md4"/>
<a href="index.html#autotoc_md5"/>
Expand Down Expand Up @@ -477,9 +478,9 @@
<a href="md_examples_2readme.html"/>
<a href="md_examples_2readme.html#autotoc_md1"/>
<a href="md_tutorials_2readme.html"/>
<a href="md_tutorials_2readme.html#autotoc_md19"/>
<a href="md_tutorials_2readme.html#autotoc_md20"/>
<a href="md_tutorials_2readme.html#autotoc_md21"/>
<a href="md_tutorials_2readme.html#autotoc_md22"/>
<a href="ota_webpage_8h_source.html"/>
<a href="structksf_1_1comps_1_1ks_config_parameter.html"/>
</body>
Expand Down
29 changes: 17 additions & 12 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,11 @@ <h1><a class="anchor" id="autotoc_md4"></a>
<li>Detailed documentation can be found on <a href="https://cziter15.github.io/ksIotFrameworkLib">here</a>.</li>
</ul>
<h1><a class="anchor" id="autotoc_md5"></a>
📚 Examples</h1>
<ul>
<li>Soome people prefer to learn by example. In this, open the [examples directory](examples).</li>
</ul>
<h1><a class="anchor" id="autotoc_md6"></a>
ℹ️ Architecture</h1>
<div class="fragment"><div class="line">flowchart TD</div>
<div class="line"> AppState{AppState}</div>
Expand Down Expand Up @@ -141,23 +146,23 @@ <h1><a class="anchor" id="autotoc_md5"></a>
<li>Each component has init, postInit, and loop methods.</li>
<li>Components can be marked for removal, and they will be safely released in the next tick.</li>
</ul>
<h1><a class="anchor" id="autotoc_md6"></a>
<h1><a class="anchor" id="autotoc_md7"></a>
📏 Utilities</h1>
<p><img src="https://github.com/cziter15/ksIotFrameworkLib/assets/5003708/1b144cdf-e345-4865-8ae7-92f0eaf31992" alt="image" class="inline"/></p>
<h1><a class="anchor" id="autotoc_md7"></a>
<h1><a class="anchor" id="autotoc_md8"></a>
🔨 Components</h1>
<p><img src="https://github.com/cziter15/ksIotFrameworkLib/assets/5003708/c27aba37-4e54-49f5-9ad5-97439e7baf33" alt="image" class="inline"/></p>
<h2><a class="anchor" id="autotoc_md8"></a>
<h2><a class="anchor" id="autotoc_md9"></a>
🔅 Rules:</h2>
<ul>
<li>Components should be added in the app's <b>init</b> method, so they will be available for <b>postInit</b> methods. (you can add them later, in loop() but that's another case)</li>
<li>The <b>init</b> method is the best place to add dependent components, setup initial pin values etc.</li>
<li>The <b>postInit</b> method is the best place to obtain a weak pointer to another component by calling <b>findComponent</b>. This will handle cases when other components were added via init method.</li>
</ul>
<h1><a class="anchor" id="autotoc_md9"></a>
<h1><a class="anchor" id="autotoc_md10"></a>
🌱 Building the application</h1>
<p>To build an application, simply create a new class inherited from ksApplication and add your initial components inside the init method. See projects like <b>emon_fw</b> for reference.</p>
<h2><a class="anchor" id="autotoc_md10"></a>
<h2><a class="anchor" id="autotoc_md11"></a>
🔎 How does it work under the hood?</h2>
<ul>
<li>The application is created, followed by the invocation of its init() method. If false is returned from the init method, the subsequent execution of the loop will be skipped, resulting in no iteration over the components. The App Rotator will then try to run next apllication.</li>
Expand Down Expand Up @@ -190,42 +195,42 @@ <h2><a class="anchor" id="autotoc_md10"></a>
<div class="line"> <span class="comment">/* Application finished initialization, return true as it succedeed. */</span></div>
<div class="line"> <span class="keywordflow">return</span> <span class="keyword">true</span>;</div>
<div class="line">}</div>
</div><!-- fragment --><h1><a class="anchor" id="autotoc_md11"></a>
</div><!-- fragment --><h1><a class="anchor" id="autotoc_md12"></a>
🔁 Application rotator</h1>
<p>The library implements one very useful utility named ksAppRotator. This object can wrap application instantiation logic into something like carousel or rotator.</p>
<p>Typically the device hosts two applications. First application is running core device logic while the second one is dedicated to help the user with the device configuration.</p>
<p>Each application has it's own loop method taking care of all underlying logic. In case of fail (which can happen anytime, even when creating the application object), the rotator will spawn next application and start processing it's logic until fail or break.</p>
<p>This is very flexible, because you can even raise fail (false) from application's init method and then go directly into the configuration mode (for example there's no WiFi credentials provided by the user).</p>
<h1><a class="anchor" id="autotoc_md12"></a>
<h1><a class="anchor" id="autotoc_md13"></a>
🔣 Compiler flags</h1>
<ul>
<li>Bare Arduino projects need to have <code>gnu++2a</code> enabled via <code>compiler.cpp.extra_flags=</code> option in the <code>board.txt</code> file.</li>
</ul>
<h1><a class="anchor" id="autotoc_md13"></a>
<h1><a class="anchor" id="autotoc_md14"></a>
#️⃣ Custom RTTI</h1>
<ul>
<li>Use the KSF_RTTI_DECLARATIONS macro to provide proper runtime type information generation for proper casting of components.</li>
<li>See <a class="el" href="ks_config_provider_8h_source.html">ksConfigProvider.h</a> for an example. Your application components should use this macro, otherwise the component finding mechanism won't work.</li>
</ul>
<h1><a class="anchor" id="autotoc_md14"></a>
<h1><a class="anchor" id="autotoc_md15"></a>
🔥 Saving power</h1>
<ul>
<li>By default, this framework supports enables power saving for the modem.</li>
<li>Automatic modem sleep requires the DTIM to be set on the access point.</li>
<li>The best value for was 3. It allows the ESP32 to go down from around 100mA to 20mA.</li>
</ul>
<h1><a class="anchor" id="autotoc_md15"></a>
<h1><a class="anchor" id="autotoc_md16"></a>
📑 Dependencies</h1>
<ul>
<li><b>It is highly recommended to use PlatformIO as it will automatically download dependencies!</b></li>
</ul>
<h2><a class="anchor" id="autotoc_md16"></a>
<h2><a class="anchor" id="autotoc_md17"></a>
🔡 Frameworks</h2>
<ul>
<li>Arduino for ESP32 [ <a href="https://github.com/espressif/arduino-esp32">https://github.com/espressif/arduino-esp32</a> ]</li>
<li>Arduino for ESP8266 [ <a href="https://github.com/esp8266/Arduino">https://github.com/esp8266/Arduino</a> ]</li>
</ul>
<h2><a class="anchor" id="autotoc_md17"></a>
<h2><a class="anchor" id="autotoc_md18"></a>
🔡 Libraries</h2>
<ul>
<li>PubSubClient [ <a href="https://github.com/knolleary/pubsubclient">https://github.com/knolleary/pubsubclient</a> ]</li>
Expand Down
8 changes: 4 additions & 4 deletions md_tutorials_2readme.html
Original file line number Diff line number Diff line change
Expand Up @@ -87,9 +87,9 @@
<div class="headertitle"><div class="title">Tutorials</div></div>
</div><!--header-->
<div class="contents">
<div class="textblock"><p><a class="anchor" id="autotoc_md18"></a>In this directory, you will find step-by-step tutorials that guide you through building various firmware applications.</p>
<div class="textblock"><p><a class="anchor" id="autotoc_md19"></a>In this directory, you will find step-by-step tutorials that guide you through building various firmware applications.</p>
<p><b>Before you start, read this page to ensure you are familiar with PlatformIO and have the correct IDE setup.</b></p>
<h1><a class="anchor" id="autotoc_md19"></a>
<h1><a class="anchor" id="autotoc_md20"></a>
IDE Preparation</h1>
<p><b>When using PlatformIO, no additional setup is required, and you don't need to install the Arduino IDE separately. This library can be used with the Arduino IDE, though it may be suboptimal.</b></p>
<ul>
Expand All @@ -99,14 +99,14 @@ <h1><a class="anchor" id="autotoc_md19"></a>
<li>Install PlatformIO IDE extension.</li>
</ul>
<p><img src="https://github.com/cziter15/ksIotFrameworkLib/assets/5003708/18dfb3a2-866c-4308-a197-5a90bbb13b90" alt="image" class="inline"/></p>
<h1><a class="anchor" id="autotoc_md20"></a>
<h1><a class="anchor" id="autotoc_md21"></a>
Opening existing projects</h1>
<ul>
<li>If properly configured, the project should contain a <code>platformio.ini</code> file in its main directory.</li>
<li>To open a project, use the <code>Open Folder</code> option from the File menu.</li>
<li>Dependencies will be automatically installed, which may take some time.</li>
</ul>
<h1><a class="anchor" id="autotoc_md21"></a>
<h1><a class="anchor" id="autotoc_md22"></a>
Creating your first application</h1>
<ol type="1">
<li>Open PlatformIO UI.</li>
Expand Down
6 changes: 3 additions & 3 deletions search/all_0.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion search/all_1.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@ var searchData=
['breakapp_5',['breakApp',['../classksf_1_1comps_1_1ks_device_portal.html#a573eb03602ce8a4352af1963ff80b748',1,'ksf::comps::ksDevicePortal']]],
['broadcast_6',['broadcast',['../classksf_1_1evt_1_1ks_event.html#ac672facd2bd8e5084f8251b228d2cf4f',1,'ksf::evt::ksEvent']]],
['broker_7',['broker',['../classksf_1_1comps_1_1ks_mqtt_connector.html#ae97565fa36122cb841acbb418928da1a',1,'ksf::comps::ksMqttConnector']]],
['building_20the_20application_8',['🌱 Building the application',['../index.html#autotoc_md9',1,'']]]
['building_20the_20application_8',['🌱 Building the application',['../index.html#autotoc_md10',1,'']]]
];
4 changes: 2 additions & 2 deletions search/all_10.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
var searchData=
[
['the_20application_0',['🌱 Building the application',['../index.html#autotoc_md9',1,'']]],
['the_20hood_1',['🔎 How does it work under the hood?',['../index.html#autotoc_md10',1,'']]],
['the_20application_0',['🌱 Building the application',['../index.html#autotoc_md10',1,'']]],
['the_20hood_1',['🔎 How does it work under the hood?',['../index.html#autotoc_md11',1,'']]],
['triggered_2',['triggered',['../classksf_1_1ks_simple_timer.html#a5d12020dc37e1836c9c98ec92eade407',1,'ksf::ksSimpleTimer']]],
['triggerstate_3',['triggerState',['../classksf_1_1comps_1_1ks_reset_button.html#a19333b9f885a6e61c27e04f206b75cb7',1,'ksf::comps::ksResetButton']]],
['tutorials_4',['Tutorials',['../md_tutorials_2readme.html',1,'']]]
Expand Down
4 changes: 2 additions & 2 deletions search/all_11.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
var searchData=
[
['unbind_0',['unbind',['../classksf_1_1evt_1_1ks_event.html#a28b95e555a1da1bf15b72467f6c133bc',1,'ksf::evt::ksEvent::unbind()'],['../classksf_1_1evt_1_1ks_event_interface.html#a9da6e0357176b359db6f5004f66caf7a',1,'ksf::evt::ksEventInterface::unbind()']]],
['under_20the_20hood_1',['🔎 How does it work under the hood?',['../index.html#autotoc_md10',1,'']]],
['under_20the_20hood_1',['🔎 How does it work under the hood?',['../index.html#autotoc_md11',1,'']]],
['unsubscribe_2',['unsubscribe',['../classksf_1_1comps_1_1ks_mqtt_connector.html#aa0371f700a74e710804fc4e7c99e75e4',1,'ksf::comps::ksMqttConnector']]],
['updatefinished_3',['updateFinished',['../classksf_1_1comps_1_1ks_device_portal.html#a2febff831199e81498a8bbf8b91f0e4b',1,'ksf::comps::ksDevicePortal']]],
['usepersistentsession_4',['usePersistentSession',['../classksf_1_1comps_1_1ks_mqtt_connector.html#a8e80106d4063007faf9f1bc7eb1c889c',1,'ksf::comps::ksMqttConnector']]],
['utilities_5',['📏 Utilities',['../index.html#autotoc_md6',1,'']]]
['utilities_5',['📏 Utilities',['../index.html#autotoc_md7',1,'']]]
];
2 changes: 1 addition & 1 deletion search/all_13.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion search/all_14.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
var searchData=
[
['your_20first_20application_0',['Creating your first application',['../md_tutorials_2readme.html#autotoc_md21',1,'']]]
['your_20first_20application_0',['Creating your first application',['../md_tutorials_2readme.html#autotoc_md22',1,'']]]
];
2 changes: 1 addition & 1 deletion search/all_16.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
var searchData=
[
['ℹ️_20architecture_0',['ℹ️ Architecture',['../index.html#autotoc_md5',1,'']]]
['ℹ️_20architecture_0',['ℹ️ Architecture',['../index.html#autotoc_md6',1,'']]]
];
2 changes: 1 addition & 1 deletion search/all_17.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
var searchData=
[
['️⃣_20custom_20rtti_0',['#️⃣ Custom RTTI',['../index.html#autotoc_md13',1,'']]]
['️⃣_20custom_20rtti_0',['#️⃣ Custom RTTI',['../index.html#autotoc_md14',1,'']]]
];
2 changes: 1 addition & 1 deletion search/all_18.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
var searchData=
[
['🌱_20building_20the_20application_0',['🌱 Building the application',['../index.html#autotoc_md9',1,'']]],
['🌱_20building_20the_20application_0',['🌱 Building the application',['../index.html#autotoc_md10',1,'']]],
['🌱_20motivation_1',['🌱 Motivation',['../index.html#autotoc_md3',1,'']]]
];
2 changes: 1 addition & 1 deletion search/all_19.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
var searchData=
[
['📏_20utilities_0',['📏 Utilities',['../index.html#autotoc_md6',1,'']]]
['📏_20utilities_0',['📏 Utilities',['../index.html#autotoc_md7',1,'']]]
];
2 changes: 1 addition & 1 deletion search/all_1a.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
var searchData=
[
['📑_20dependencies_0',['📑 Dependencies',['../index.html#autotoc_md15',1,'']]]
['📑_20dependencies_0',['📑 Dependencies',['../index.html#autotoc_md16',1,'']]]
];
3 changes: 2 additions & 1 deletion search/all_1b.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
var searchData=
[
['📚_20doxygen_0',['📚 Doxygen',['../index.html#autotoc_md4',1,'']]]
['📚_20doxygen_0',['📚 Doxygen',['../index.html#autotoc_md4',1,'']]],
['📚_20examples_1',['📚 Examples',['../index.html#autotoc_md5',1,'']]]
];
2 changes: 1 addition & 1 deletion search/all_1c.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
var searchData=
[
['🔁_20application_20rotator_0',['🔁 Application rotator',['../index.html#autotoc_md11',1,'']]]
['🔁_20application_20rotator_0',['🔁 Application rotator',['../index.html#autotoc_md12',1,'']]]
];
2 changes: 1 addition & 1 deletion search/all_1d.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
var searchData=
[
['🔅_20rules_3a_0',['🔅 Rules:',['../index.html#autotoc_md8',1,'']]]
['🔅_20rules_3a_0',['🔅 Rules:',['../index.html#autotoc_md9',1,'']]]
];
2 changes: 1 addition & 1 deletion search/all_1e.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
var searchData=
[
['🔎_20how_20does_20it_20work_20under_20the_20hood_0',['🔎 How does it work under the hood?',['../index.html#autotoc_md10',1,'']]]
['🔎_20how_20does_20it_20work_20under_20the_20hood_0',['🔎 How does it work under the hood?',['../index.html#autotoc_md11',1,'']]]
];
4 changes: 2 additions & 2 deletions search/all_1f.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
var searchData=
[
['🔡_20frameworks_0',['🔡 Frameworks',['../index.html#autotoc_md16',1,'']]],
['🔡_20libraries_1',['🔡 Libraries',['../index.html#autotoc_md17',1,'']]]
['🔡_20frameworks_0',['🔡 Frameworks',['../index.html#autotoc_md17',1,'']]],
['🔡_20libraries_1',['🔡 Libraries',['../index.html#autotoc_md18',1,'']]]
];
8 changes: 4 additions & 4 deletions search/all_2.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ var searchData=
['callbacks_0',['callbacks',['../classksf_1_1evt_1_1ks_event.html#a17a698a1e1f7be8ac6213e6e145850e5',1,'ksf::evt::ksEvent']]],
['callbackuid_1',['callbackUID',['../classksf_1_1evt_1_1ks_event_handle.html#a275a07831b53b56d77b3b579cb6f7117',1,'ksf::evt::ksEventHandle']]],
['certfingerprint_2',['certFingerprint',['../classksf_1_1comps_1_1ks_mqtt_connector.html#a72c01e2f4d6d2115d5b11f7330f75971',1,'ksf::comps::ksMqttConnector']]],
['compiler_20flags_3',['🔣 Compiler flags',['../index.html#autotoc_md12',1,'']]],
['components_4',['🔨 Components',['../index.html#autotoc_md7',1,'']]],
['compiler_20flags_3',['🔣 Compiler flags',['../index.html#autotoc_md13',1,'']]],
['components_4',['🔨 Components',['../index.html#autotoc_md8',1,'']]],
['components_5',['components',['../classksf_1_1ks_application.html#a06c3c117592fa39614d331dd5bc89660',1,'ksf::ksApplication']]],
['componentstate_6',['componentState',['../classksf_1_1ks_component.html#ac946b878dc913d67a11492db06afbb5d',1,'ksf::ksComponent']]],
['config_7',['[basic-config](basic-config)',['../md_examples_2readme.html#autotoc_md1',1,'']]],
Expand All @@ -15,6 +15,6 @@ var searchData=
['configtimeout_12',['configTimeout',['../classksf_1_1comps_1_1ks_wifi_configurator.html#a22af6cd1c821587c9147383287fa4d13',1,'ksf::comps::ksWifiConfigurator']]],
['connecttobroker_13',['connectToBroker',['../classksf_1_1comps_1_1ks_mqtt_connector.html#ad3410bf2428ffe086fad10bbffb5384c',1,'ksf::comps::ksMqttConnector']]],
['conneventhandle_14',['connEventHandle',['../classksf_1_1comps_1_1ks_dev_stat_mqtt_reporter.html#a9941dae7a03633582619f2bf6973f7e4',1,'ksf::comps::ksDevStatMqttReporter']]],
['creating_20your_20first_20application_15',['Creating your first application',['../md_tutorials_2readme.html#autotoc_md21',1,'']]],
['custom_20rtti_16',['#️⃣ Custom RTTI',['../index.html#autotoc_md13',1,'']]]
['creating_20your_20first_20application_15',['Creating your first application',['../md_tutorials_2readme.html#autotoc_md22',1,'']]],
['custom_20rtti_16',['#️⃣ Custom RTTI',['../index.html#autotoc_md14',1,'']]]
];
2 changes: 1 addition & 1 deletion search/all_20.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
var searchData=
[
['🔣_20compiler_20flags_0',['🔣 Compiler flags',['../index.html#autotoc_md12',1,'']]]
['🔣_20compiler_20flags_0',['🔣 Compiler flags',['../index.html#autotoc_md13',1,'']]]
];
2 changes: 1 addition & 1 deletion search/all_21.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
var searchData=
[
['🔥_20saving_20power_0',['🔥 Saving power',['../index.html#autotoc_md14',1,'']]]
['🔥_20saving_20power_0',['🔥 Saving power',['../index.html#autotoc_md15',1,'']]]
];
2 changes: 1 addition & 1 deletion search/all_22.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
var searchData=
[
['🔨_20components_0',['🔨 Components',['../index.html#autotoc_md7',1,'']]]
['🔨_20components_0',['🔨 Components',['../index.html#autotoc_md8',1,'']]]
];
Loading

0 comments on commit 29c0d5a

Please sign in to comment.