aquarium_control/relays/actuate_controllino_config.rs
1/* Copyright 2025 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*/
9use serde_derive::Deserialize;
10
11#[derive(Clone, Deserialize, Debug)]
12/// Configuration settings for direct hardware actuation via the Controllino device.
13///
14/// This struct holds all parameters required to establish and manage communication
15/// with the Controllino (e.g., serial port settings) and maps application-level
16/// devices to their specific relay IDs on the Controllino board.
17pub struct ActuateControllinoConfig {
18 /// Disables the functionality - required for certain testing scenarios
19 pub active: bool,
20
21 /// Baud rate for communication via serial port
22 pub baud_rate: u32,
23
24 /// Port name for communication via serial port
25 pub port_name: String,
26
27 /// timeout in milliseconds for serial port communication
28 pub timeout_millis: u64,
29
30 /// time in milliseconds to wait for response
31 pub controllino_processing_millis: u64,
32
33 /// Relay id of the protein skimmer
34 /// - Caution: relay login (true/false) and device logic (off/on) is reverse.
35 pub skimmer_id: u8,
36
37 /// Relay id of the main pump #1
38 /// - Caution: relay login (true/false) and device logic (off/on) is reverse.
39 pub main_pump1_id: u8,
40
41 /// Relay id of the main pump #2
42 /// - Caution: relay login (true/false) and device logic (off/on) is reverse.
43 pub main_pump2_id: u8,
44
45 /// Relay id of the auxiliary pump #1
46 /// - Caution: relay login (true/false) and device logic (off/on) is reverse.
47 pub aux_pump1_id: u8,
48
49 /// Relay id of the auxiliary pump #2
50 /// - Caution: relay login (true/false) and device logic (off/on) is reverse.
51 pub aux_pump2_id: u8,
52
53 /// Relay id of the refill pump
54 pub refill_pump_id: u8,
55
56 /// Relay id of the heater
57 pub heater_id: u8,
58
59 /// Relay id of ventilation
60 pub ventilation_id: u8,
61
62 /// Relay id feeder
63 pub feeder_id: u8,
64
65 /// Relay id of peristaltic pump #1
66 pub peristaltic_pump1_id: u8,
67
68 /// Relay id of peristaltic pump #2
69 pub peristaltic_pump2_id: u8,
70
71 /// Relay id of peristaltic pump #3
72 pub peristaltic_pump3_id: u8,
73
74 /// Relay id of peristaltic pump #4
75 pub peristaltic_pump4_id: u8,
76
77 /// Heartbeat interval
78 pub heartbeat_interval_seconds: u64,
79}