Skip to content

Commit

Permalink
feat(protocol-next): initial support for additional heatpump protocol…
Browse files Browse the repository at this point in the history
… E/E
  • Loading branch information
tspopp committed Dec 4, 2024
1 parent 9d69677 commit 6e0377a
Show file tree
Hide file tree
Showing 64 changed files with 5,066 additions and 2,164 deletions.
1 change: 1 addition & 0 deletions AquaMQTT/.clang-format
Original file line number Diff line number Diff line change
Expand Up @@ -135,3 +135,4 @@ PenaltyBreakFirstLessLess: 120
PenaltyBreakString: 1000
PenaltyExcessCharacter: 1000000
PenaltyReturnTypeOnItsOwnLine: 200
SeparateDefinitionBlocks: Always
1 change: 1 addition & 0 deletions AquaMQTT/.gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
.pio
include/config/CustomConfiguration.h
include/config/CustomConfigurationProd.h
.vscode
8 changes: 0 additions & 8 deletions AquaMQTT/.idea/modules.xml

This file was deleted.

2 changes: 1 addition & 1 deletion AquaMQTT/include/Version.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace aquamqtt
{
constexpr char VERSION[] = "v1.4.2";
constexpr char VERSION[] = "v1.5.0";
}
2 changes: 2 additions & 0 deletions AquaMQTT/include/buffer/FrameBuffer.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ class FrameBuffer
uint64_t getHandledCount() const;

private:
aquamqtt::message::ProtocolVersion mLockedProtocol;

int handleFrame();

bool isSync();
Expand Down
3 changes: 2 additions & 1 deletion AquaMQTT/include/config/Configuration.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ namespace aquamqtt
{
namespace config
{

/**
* Defines the network name of your esp32 device in your network
*/
Expand Down Expand Up @@ -74,7 +75,7 @@ constexpr bool MQTT_PUBLISH_SERIAL_STATISTICS = true;
* enable this, if you are customizing the NTP timezone or server or even trying to
* use the RTC module from the AquaMQTT board.
*/
constexpr bool MQTT_PUBLISH_HEATPUMP_TIME_AND_DATE = false;
constexpr bool MQTT_PUBLISH_HEATPUMP_TIME_AND_DATE = true;

/**
* Change the time interval where all known attributes are re-published to the MQTT broker.
Expand Down
56 changes: 0 additions & 56 deletions AquaMQTT/include/message/ErrorMessage.h

This file was deleted.

148 changes: 0 additions & 148 deletions AquaMQTT/include/message/HMIMessage.h

This file was deleted.

50 changes: 50 additions & 0 deletions AquaMQTT/include/message/IEnergyMessage.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
#ifndef AQUAMQTT_IENERGYMESSAGE_H
#define AQUAMQTT_IENERGYMESSAGE_H

#include "MessageConstants.h"

namespace aquamqtt::message
{

enum class ENERGY_ATTR_U16
{
POWER_HEATPUMP,
POWER_HEATELEMENT,
POWER_TOTAL,
WATER_TOTAL
};

enum class ENERGY_ATTR_U32
{
TOTAL_HEATPUMP_HOURS,
TOTAL_HEATING_ELEMENT_HOURS,
TOTAL_HOURS,
};

enum class ENERGY_ATTR_U64
{
TOTAL_ENERGY,
};

class IEnergyMessage
{
public:
virtual ~IEnergyMessage() = default;

virtual uint8_t getLength() = 0;

virtual uint64_t getAttr(ENERGY_ATTR_U64 attr) = 0;
virtual uint32_t getAttr(ENERGY_ATTR_U32 attr) = 0;
virtual uint16_t getAttr(ENERGY_ATTR_U16 attr) = 0;

virtual bool hasAttr(ENERGY_ATTR_U64 attr) const = 0;
virtual bool hasAttr(ENERGY_ATTR_U32 attr) const = 0;
virtual bool hasAttr(ENERGY_ATTR_U16 attr) const = 0;

virtual bool hasChanged(ENERGY_ATTR_U64 attr) const = 0;
virtual bool hasChanged(ENERGY_ATTR_U32 attr) const = 0;
virtual bool hasChanged(ENERGY_ATTR_U16 attr) const = 0;
};
} // namespace aquamqtt::message

#endif // AQUAMQTT_IENERGYMESSAGE_H
55 changes: 55 additions & 0 deletions AquaMQTT/include/message/IErrorMessage.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
#ifndef AQUAMQTT_IERRORMESSAGE_H
#define AQUAMQTT_IERRORMESSAGE_H

#include "MessageConstants.h"

namespace aquamqtt::message
{

enum class ERROR_ATTR_U8
{
ERROR_REQUEST_ID,
ERROR_ERROR_CODE,
ERROR_TIME_MINUTES,
ERROR_TIME_HOURS,
ERROR_DATE_DAY,
ERROR_DATE_MONTH,
ERROR_DATE_YEAR
};

enum class ERROR_ATTR_FLOAT
{
ERROR_WATER_TEMPERATURE,
ERROR_AIR_TEMPERATURE,
ERROR_EVAPORATOR_UPPER_TEMPERATURE,
ERROR_EVAPORATOR_LOWER_TEMPERATURE,
ERROR_COMPRESSOR_OUTLET_TEMPERATURE,
ERROR_FAN_SPEED_PWM,
};

enum class ERROR_ATTR_U16
{
ERROR_TOTAL_HEATPUMP_HOURS,
ERROR_TOTAL_HEATING_ELEMENT_HOURS,
};

class IErrorMessage
{
public:
virtual ~IErrorMessage() = default;

virtual uint8_t getLength() = 0;

virtual bool isEmpty() = 0;

virtual uint8_t getAttr(ERROR_ATTR_U8 attr) = 0;
virtual uint16_t getAttr(ERROR_ATTR_U16 attr) = 0;
virtual float getAttr(ERROR_ATTR_FLOAT attr) = 0;

virtual bool hasAttr(ERROR_ATTR_U8 attr) const = 0;
virtual bool hasAttr(ERROR_ATTR_U16 attr) const = 0;
virtual bool hasAttr(ERROR_ATTR_FLOAT attr) const = 0;
};
} // namespace aquamqtt::message

#endif // AQUAMQTT_IERRORMESSAGE_H
Loading

0 comments on commit 6e0377a

Please sign in to comment.