Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implemented parsing of advanced diagnosis menu contents #20

Merged
merged 12 commits into from
May 28, 2024
3 changes: 2 additions & 1 deletion AquaMQTT/include/buffer/FrameBuffer.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
class FrameBuffer
{
public:
explicit FrameBuffer(bool handle194, bool handle193, bool handle67, std::string name);
explicit FrameBuffer(bool handle194, bool handle193, bool handle67, bool handle74, std::string name);

~FrameBuffer() = default;

Expand All @@ -36,6 +36,7 @@ class FrameBuffer
bool mHandle194;
bool mHandle193;
bool mHandle67;
bool mHandle74;
std::string mName;

uint64_t mDroppedCount;
Expand Down
17 changes: 16 additions & 1 deletion AquaMQTT/include/config/Configuration.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,26 @@ constexpr EOperationMode OPERATION_MODE = EOperationMode::MITM;
*/
constexpr bool OVERRIDE_TIME_AND_DATE_IN_MITM = true;


/**
* Choose to publish raw messages represented as hex-string on debug mqtt topics
*/
constexpr bool DEBUG_RAW_SERIAL_MESSAGES = false;

/**
* Change the time interval where all known attributes are re-published to the MQTT broker.
*/
constexpr uint32_t MQTT_FULL_UPDATE_MS = 1000*60*30;

/**
* Change the fixed time interval where the attributes published to the stats topic are updated.
*/
constexpr uint16_t MQTT_STATS_UPDATE_MS = 5000;

/**
* Self explanatory internal settings: most probably you don't want to change them.
*/
constexpr uint8_t WATCHDOG_TIMEOUT_S = 60;
constexpr uint16_t MQTT_STATS_UPDATE_MS = 5000;
constexpr uint8_t MQTT_MAX_TOPIC_SIZE = 80;
constexpr uint8_t MQTT_MAX_PAYLOAD_SIZE = 255;

Expand Down
56 changes: 56 additions & 0 deletions AquaMQTT/include/message/ErrorMessage.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
#ifndef AQUAMQTT_ERRORMESSAGE_H
#define AQUAMQTT_ERRORMESSAGE_H

#include <cstring>

#include "MessageConstants.h"

namespace aquamqtt
{
namespace message
{
class ErrorMessage
{
public:
explicit ErrorMessage(uint8_t* data);

~ErrorMessage() = default;

uint8_t errorRequestId();

uint8_t errorCode();

float hotWaterTemp();

float airTemp();

float evaporatorLowerAirTemp();

float evaporatorUpperAirTemp();

float fanSpeedPwm();

uint16_t totalHeatpumpHours();

uint16_t totalHeatingElemHours();

uint8_t timeHours();

uint8_t timeMinutes();

uint16_t dateYear();

uint8_t dateMonth();

uint8_t dateDay();

bool isEmpty();

private:
uint8_t* mData;
};

} // namespace message
} // namespace aquamqtt

#endif // AQUAMQTT_ERRORMESSAGE_H
45 changes: 45 additions & 0 deletions AquaMQTT/include/message/HMIMessage.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ class HMIMessage

void enableHeatingElement(bool enabled);

bool isPVInputActivated();

HMISetup setupMode();

uint8_t antiLegionellaModePerMonth();
Expand Down Expand Up @@ -84,7 +86,50 @@ class HMIMessage

void setInstallationMode(HMIInstallation mode);

bool waterTempTargetChanged() const;

bool operationTypeOrModeChanged() const;

bool timeChanged() const;

bool dateChanged() const;

bool emergencyModeChanged() const;

bool heatingElemOrSetupStateOrPVActiveChanged() const;

bool legionellaOrAirductChanged() const;

bool testModeChanged() const;

bool installationConfigChanged() const;

bool timerModeOneChanged() const;

bool timerModeTwoChanged() const;

void compareWith(uint8_t* data);

uint8_t errorRequestId() const;

uint8_t errorNumberRequested() const;

bool errorRequestChanged() const;

private:
bool mTargetTempChanged;
bool mOperationModeChanged;
bool mLegionellaAirductChanged;
bool mEmergencyModeChanged;
bool mInstallConfigChanged;
bool mHeatingElemOrSetupStateOrPVActiveChanged;
bool mTimerModeOneChanged;
bool mTimerModeTwoChanged;
bool mTimeChanged;
bool mDateChanged;
bool mTestModeChanged;
bool mErrorRequestChanged;

uint8_t* mData;
};

Expand Down
28 changes: 25 additions & 3 deletions AquaMQTT/include/message/MainEnergyMessage.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,7 @@ namespace message
class MainEnergyMessage
{
public:
explicit MainEnergyMessage(uint8_t* data) : mData(data)
{
}
explicit MainEnergyMessage(uint8_t* data);

~MainEnergyMessage() = default;

Expand All @@ -30,8 +28,32 @@ class MainEnergyMessage

uint16_t powerOverall();

void compareWith(uint8_t* data);

bool totalHeatpumpHoursChanged() const;

bool totalHeatingElemHoursChanged() const;

bool totalHoursChanged() const;

bool totalEnergyCounterChanged() const;

bool powerHeatpumpChanged() const;

bool powerHeatElementChanged() const;

bool powerOverallChanged() const;

private:
uint8_t* mData;

bool mPowerHeatpumpChanged;
bool mPowerHeatelementChanged;
bool mPowerOverallChanged;
bool mTotalHeatpumpHoursChanged;
bool mTotalHeatElementHoursChanged;
bool mTotalHoursChanged;
bool mTotalEnergyChanged;
};

} // namespace message
Expand Down
91 changes: 87 additions & 4 deletions AquaMQTT/include/message/MainStatusMessage.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,16 @@
#include <cstring>
#include <memory>

#include "MessageConstants.h"

namespace aquamqtt
{
namespace message
{
class MainStatusMessage
{
public:
explicit MainStatusMessage(uint8_t* data) : mData(data)
{
}
explicit MainStatusMessage(uint8_t* data);

~MainStatusMessage() = default;

Expand All @@ -25,7 +25,7 @@ class MainStatusMessage

float evaporatorUpperAirTemp();

uint16_t fanSpeed();
float fanSpeedPwm();

bool stateHeatingElement();

Expand All @@ -37,8 +37,91 @@ class MainStatusMessage

bool stateDefrost();

bool statePV();

uint8_t settingPwmFirst();

uint8_t settingPwmSecond();

uint8_t settingPwmThird();

uint8_t settingMinTTarget();

uint8_t settingLegionellaTTarget();

uint16_t settingWattageHeatingElement();

uint16_t settingBoilerCapacity();

MAINBrands settingBrand();

bool capabilityHasHeatExchanger();

bool capabilityHasCirculation();

bool capabilityHasPVInput();

bool capabilityHasCommunication();

bool capabilityHasAntiDryHeating();

void compareWith(uint8_t* data);

bool hotWaterTempChanged() const;

bool airTempChanged() const;

bool evaporatorLowerAirTempChanged() const;

bool evaporatorUpperAirTempChanged() const;

bool fanSpeedChanged() const;

bool statesChanged() const;

bool statePVChanged() const;

uint8_t errorCode() const;

bool settingPwmFirstChanged() const;

bool settingPwmSecondChanged() const;

bool settingPwmThirdChanged() const;

bool settingMinTTargetChanged() const;

bool settingLegionellaTTargetChanged() const;

bool settingWattageHeatingElementChanged() const;

bool settingBoilerCapacityChanged() const;

bool settingBrandChanged() const;

bool settingCapabilitiesChanged() const;

bool errorCodeChanged() const;

private:
uint8_t* mData;
bool mHotWaterTempChanged;
bool mAirTempChanged;
bool mEvaporatorLowerChanged;
bool mEvaporatorUpperChanged;
bool mFanSpeedChanged;
bool mStatesChanged;
bool mSettingMinTChanged;
bool mSettingPwmFirstChanged;
bool mSettingPwmSecondChanged;
bool mSettingPwmThirdChanged;
bool mSettingAntiLegionellaTargetChanged;
bool mSettingWattageHeatElementChanged;
bool mSettingBoilerCapacityChanged;
bool mSettingBoilerBrandChanged;
bool mSettingCapabilitiesChanged;
bool mPVStateChanged;
bool mErrorCodeChanged;
};

} // namespace message
Expand Down
Loading
Loading