aquarium_control/
utilities.rs

1/* Copyright 2024 Uwe Martin
2
3Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
4
5The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
6
7THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
8*/
9
10/// Defines enums and structs for inter-thread communication via channels.
11pub mod channel_content;
12
13/// Provides common, shared functions and constants used across multiple modules.
14pub mod common;
15
16/// Handles the loading and parsing of the main application configuration from a TOML file.
17pub mod config;
18
19/// Defines error types related to reading and parsing the configuration file.
20pub mod config_error;
21
22/// Defines error types for structural or semantic issues within the configuration file.
23pub mod config_file_definition_error;
24
25/// Implements a simple Infinite Impulse Response (IIR) filter for smoothing sensor data.
26pub mod iir_filter;
27
28/// Contains setup and configuration for the application-wide logging framework.
29pub mod logger;
30
31/// Defines a trait for processing external requests, such as commands from the signal handler.
32pub mod proc_ext_req;
33
34/// Manages the creation of a PID file to make the process ID available to external scripts.
35pub mod publish_pid;
36
37/// Implements a sawtooth wave generator for creating low-frequency PWM-like signals.
38pub mod sawtooth_profile;
39
40/// Manages system signals (e.g., SIGINT, SIGTERM) to ensure graceful application shutdown.
41pub mod signal_handler;
42
43/// Provides access to the application's version information from the build environment.
44pub mod version_information;
45
46/// Container for channels used by signal handler
47pub mod signal_handler_channels;
48
49/// Trait for multiple threads which have to wait for termination signal
50pub mod wait_for_termination;
51
52/// Configuration of Logger
53pub mod logger_config;
54
55/// Configuration of PublishPid
56pub mod publish_pid_config;
57
58/// Trait incl. implementation for checking maximum permissible access duration
59pub mod check_mutex_access_duration;
60
61/// Trait incl. implementation for acknowledging to signal handler
62pub mod acknowledge_signal_handler;
63
64/// A trait for components that need to periodically ping a `Pingable` resource.
65pub mod database_ping_trait;
66
67/// Macro for performing schedule check
68mod perform_schedule_check;
69
70/// Macro for updating set values for heating and ventilation
71mod update_thermal_set_values;
72
73/// Macro to handle common end-of-loop tasks for Balling and Feed
74mod check_quit_increment_counter_ping_database;