summaryrefslogtreecommitdiffstats
path: root/src/hvac-led-helper.hpp
diff options
context:
space:
mode:
authorScott Murray <scott.murray@konsulko.com>2022-06-16 00:28:36 -0400
committerScott Murray <scott.murray@konsulko.com>2022-06-17 17:44:47 -0400
commit096908375ecbfc6388d0aec69a35b2a8ffc53d47 (patch)
tree4f346d772fcdcbfc112d5aba4d379d1db175979a /src/hvac-led-helper.hpp
parent7f647062d889b299a4dd521148a4970bf6c8e75a (diff)
Repurpose repository for a spiritual successor of the previous binding. The replacement is a daemon that demonstrates servicing HVAC actuators from the VSS schema via VIS signals from KUKSA.val. Currently the connection to KUKSA.val is websocket based using the boost::asio framework, but the plan is to migrate to grpc as that becomes more robust in KUKSA.val. Notable changes: - New code is completely C++, partly to leverage using Boost, but also to futureproof future work with grpc. - Switch from CMake to meson for ease of development and some degree of futureproofing. - Use with systemd is assumed; behavior follows the systemd daemon guidelines barring the use of journald logging prefixes, which may be addressed with future work. A systemd unit is also installed as part of the build. - SPDX license headers using SPDX "short identifiers" are used in source files rather than the full copyright headers used in the previous codebase. This follows the direction that projects such as the Linux kernel are going in. - The JSON configuration file for the LED control files for the demo platform has been migrated to a INI format configuration file matching what has been done for the VIS client configuration in other recent work. Bug-AGL: SPEC-4409 Signed-off-by: Scott Murray <scott.murray@konsulko.com> Change-Id: Ic2061bca9670b1e461d6f1e6591471e257fff5b9
Diffstat (limited to 'src/hvac-led-helper.hpp')
-rw-r--r--src/hvac-led-helper.hpp34
1 files changed, 34 insertions, 0 deletions
diff --git a/src/hvac-led-helper.hpp b/src/hvac-led-helper.hpp
new file mode 100644
index 0000000..8fe41f7
--- /dev/null
+++ b/src/hvac-led-helper.hpp
@@ -0,0 +1,34 @@
+// SPDX-License-Identifier: Apache-2.0
+
+#ifndef _HVAC_LED_HELPER_HPP
+#define _HVAC_LED_HELPER_HPP
+
+#include <string>
+#include <iostream>
+#include <fstream>
+
+class HvacLedHelper
+{
+public:
+ HvacLedHelper();
+
+ void set_left_temperature(uint8_t temp);
+
+ void set_right_temperature(uint8_t temp);
+
+private:
+ void read_config();
+
+ void led_update();
+
+ std::string m_led_path_red;
+ std::string m_led_path_green;
+ std::string m_led_path_blue;
+ unsigned m_verbose;
+ bool m_config_valid;
+
+ uint8_t m_temp_left;
+ uint8_t m_temp_right;
+};
+
+#endif // _HVAC_LED_HELPER_HPP