supla-device
Loading...
Searching...
No Matches
thermal_protection_config.h
1// SPDX-FileCopyrightText: AC SOFTWARE SP. Z O.O.
2// SPDX-License-Identifier: GPL-2.0-or-later
3
4#ifndef SRC_SUPLA_DEVICE_THERMAL_PROTECTION_CONFIG_H_
5#define SRC_SUPLA_DEVICE_THERMAL_PROTECTION_CONFIG_H_
6
7#include <stdint.h>
8
9namespace Supla {
10namespace Device {
11
12#pragma pack(push, 1)
13
15 int16_t threshold = 0; // 0.1 deg C
16 uint8_t enabled = 0;
17 uint8_t reserved[5] = {};
18
19 bool operator==(const ThermalProtectionConfig &other) const {
20 return threshold == other.threshold && enabled == other.enabled;
21 }
22
23 bool operator!=(const ThermalProtectionConfig &other) const {
24 return !(*this == other);
25 }
26};
27
29 int16_t minThreshold = 0; // 0.1 deg C
30 int16_t maxThreshold = 0; // 0.1 deg C
31 uint8_t disableAllowed = 0;
32
33 bool operator==(const ThermalProtectionProperties &other) const {
34 return minThreshold == other.minThreshold &&
35 maxThreshold == other.maxThreshold &&
36 disableAllowed == other.disableAllowed;
37 }
38
39 bool operator!=(const ThermalProtectionProperties &other) const {
40 return !(*this == other);
41 }
42};
43
44#pragma pack(pop)
45
46static_assert(sizeof(ThermalProtectionConfig) == 8);
47
48} // namespace Device
49} // namespace Supla
50
51#endif // SRC_SUPLA_DEVICE_THERMAL_PROTECTION_CONFIG_H_
Definition thermal_protection_config.h:14
Definition thermal_protection_config.h:28