Add const keyword to methods
This commit is contained in:
parent
d6494fa791
commit
8fb43fedf8
@ -19,7 +19,7 @@ public:
|
||||
void subscribe(const String& topic, const uint8_t qos, const espMqttClientTypes::OnMessageCallback& cb);
|
||||
void unsubscribe(const String& topic);
|
||||
|
||||
String getPrefix();
|
||||
String getPrefix() const;
|
||||
|
||||
private:
|
||||
void NetworkEvent(network_event event);
|
||||
|
||||
@ -42,16 +42,16 @@ public:
|
||||
void init(Scheduler* scheduler);
|
||||
void applyConfig();
|
||||
void enableAdminMode();
|
||||
String getApName();
|
||||
String getApName() const;
|
||||
|
||||
IPAddress localIP();
|
||||
IPAddress subnetMask();
|
||||
IPAddress gatewayIP();
|
||||
IPAddress dnsIP(const uint8_t dns_no = 0);
|
||||
String macAddress();
|
||||
IPAddress localIP() const;
|
||||
IPAddress subnetMask() const;
|
||||
IPAddress gatewayIP() const;
|
||||
IPAddress dnsIP(const uint8_t dns_no = 0) const;
|
||||
String macAddress() const;
|
||||
static String getHostname();
|
||||
bool isConnected();
|
||||
network_mode NetworkMode();
|
||||
bool isConnected() const;
|
||||
network_mode NetworkMode() const;
|
||||
|
||||
bool onEvent(NetworkEventCb cbEvent, const network_event event = network_event::NETWORK_EVENT_MAX);
|
||||
void raiseEvent(const network_event event);
|
||||
|
||||
@ -47,9 +47,9 @@ public:
|
||||
bool init(const String& deviceMapping);
|
||||
PinMapping_t& get();
|
||||
|
||||
bool isValidNrf24Config();
|
||||
bool isValidCmt2300Config();
|
||||
bool isValidEthConfig();
|
||||
bool isValidNrf24Config() const;
|
||||
bool isValidCmt2300Config() const;
|
||||
bool isValidEthConfig() const;
|
||||
|
||||
private:
|
||||
PinMapping_t _pinMapping;
|
||||
|
||||
@ -10,17 +10,17 @@ public:
|
||||
SunPositionClass();
|
||||
void init(Scheduler* scheduler);
|
||||
|
||||
bool isDayPeriod();
|
||||
bool isSunsetAvailable();
|
||||
bool sunsetTime(struct tm* info);
|
||||
bool sunriseTime(struct tm* info);
|
||||
bool isDayPeriod() const;
|
||||
bool isSunsetAvailable() const;
|
||||
bool sunsetTime(struct tm* info) const;
|
||||
bool sunriseTime(struct tm* info) const;
|
||||
void setDoRecalc(const bool doRecalc);
|
||||
|
||||
private:
|
||||
void loop();
|
||||
void updateSunData();
|
||||
bool checkRecalcDayChanged();
|
||||
bool getSunTime(struct tm* info, const uint32_t offset);
|
||||
bool checkRecalcDayChanged() const;
|
||||
bool getSunTime(struct tm* info, const uint32_t offset) const;
|
||||
|
||||
Task _loopTask;
|
||||
|
||||
|
||||
@ -232,7 +232,7 @@ void HoymilesClass::removeInverterBySerial(const uint64_t serial)
|
||||
}
|
||||
}
|
||||
|
||||
size_t HoymilesClass::getNumInverters()
|
||||
size_t HoymilesClass::getNumInverters() const
|
||||
{
|
||||
return _inverters.size();
|
||||
}
|
||||
@ -247,12 +247,12 @@ HoymilesRadio_CMT* HoymilesClass::getRadioCmt()
|
||||
return _radioCmt.get();
|
||||
}
|
||||
|
||||
bool HoymilesClass::isAllRadioIdle()
|
||||
bool HoymilesClass::isAllRadioIdle() const
|
||||
{
|
||||
return _radioNrf.get()->isIdle() && _radioCmt.get()->isIdle();
|
||||
}
|
||||
|
||||
uint32_t HoymilesClass::PollInterval()
|
||||
uint32_t HoymilesClass::PollInterval() const
|
||||
{
|
||||
return _pollInterval;
|
||||
}
|
||||
|
||||
@ -28,15 +28,15 @@ public:
|
||||
std::shared_ptr<InverterAbstract> getInverterBySerial(const uint64_t serial);
|
||||
std::shared_ptr<InverterAbstract> getInverterByFragment(const fragment_t* fragment);
|
||||
void removeInverterBySerial(const uint64_t serial);
|
||||
size_t getNumInverters();
|
||||
size_t getNumInverters() const;
|
||||
|
||||
HoymilesRadio_NRF* getRadioNrf();
|
||||
HoymilesRadio_CMT* getRadioCmt();
|
||||
|
||||
uint32_t PollInterval();
|
||||
uint32_t PollInterval() const;
|
||||
void setPollInterval(const uint32_t interval);
|
||||
|
||||
bool isAllRadioIdle();
|
||||
bool isAllRadioIdle() const;
|
||||
|
||||
private:
|
||||
std::vector<std::shared_ptr<InverterAbstract>> _inverters;
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
#include "Hoymiles.h"
|
||||
#include "crc.h"
|
||||
|
||||
serial_u HoymilesRadio::DtuSerial()
|
||||
serial_u HoymilesRadio::DtuSerial() const
|
||||
{
|
||||
return _dtuSerial;
|
||||
}
|
||||
@ -28,7 +28,7 @@ serial_u HoymilesRadio::convertSerialToRadioId(const serial_u serial)
|
||||
return radioId;
|
||||
}
|
||||
|
||||
bool HoymilesRadio::checkFragmentCrc(const fragment_t* fragment)
|
||||
bool HoymilesRadio::checkFragmentCrc(const fragment_t* fragment) const
|
||||
{
|
||||
const uint8_t crc = crc8(fragment->fragment, fragment->len - 1);
|
||||
return (crc == fragment->fragment[fragment->len - 1]);
|
||||
@ -124,17 +124,17 @@ void HoymilesRadio::dumpBuf(const uint8_t buf[], const uint8_t len, const bool a
|
||||
}
|
||||
}
|
||||
|
||||
bool HoymilesRadio::isInitialized()
|
||||
bool HoymilesRadio::isInitialized() const
|
||||
{
|
||||
return _isInitialized;
|
||||
}
|
||||
|
||||
bool HoymilesRadio::isIdle()
|
||||
bool HoymilesRadio::isIdle() const
|
||||
{
|
||||
return !_busyFlag;
|
||||
}
|
||||
|
||||
bool HoymilesRadio::isQueueEmpty()
|
||||
bool HoymilesRadio::isQueueEmpty() const
|
||||
{
|
||||
return _commandQueue.size() == 0;
|
||||
}
|
||||
|
||||
@ -9,12 +9,12 @@
|
||||
|
||||
class HoymilesRadio {
|
||||
public:
|
||||
serial_u DtuSerial();
|
||||
serial_u DtuSerial() const;
|
||||
virtual void setDtuSerial(const uint64_t serial);
|
||||
|
||||
bool isIdle();
|
||||
bool isQueueEmpty();
|
||||
bool isInitialized();
|
||||
bool isIdle() const;
|
||||
bool isQueueEmpty() const;
|
||||
bool isInitialized() const;
|
||||
|
||||
void enqueCommand(std::shared_ptr<CommandAbstract> cmd)
|
||||
{
|
||||
@ -31,7 +31,7 @@ protected:
|
||||
static serial_u convertSerialToRadioId(const serial_u serial);
|
||||
static void dumpBuf(const uint8_t buf[], const uint8_t len, const bool appendNewline = true);
|
||||
|
||||
bool checkFragmentCrc(const fragment_t* fragment);
|
||||
bool checkFragmentCrc(const fragment_t* fragment) const;
|
||||
virtual void sendEsbPacket(CommandAbstract* cmd) = 0;
|
||||
void sendRetransmitPacket(const uint8_t fragment_id);
|
||||
void sendLastPacketAgain();
|
||||
|
||||
@ -178,12 +178,12 @@ void HoymilesRadio_CMT::setInverterTargetFrequency(const uint32_t frequency)
|
||||
cmtSwitchDtuFreq(_inverterTargetFrequency);
|
||||
}
|
||||
|
||||
uint32_t HoymilesRadio_CMT::getInverterTargetFrequency()
|
||||
uint32_t HoymilesRadio_CMT::getInverterTargetFrequency() const
|
||||
{
|
||||
return _inverterTargetFrequency;
|
||||
}
|
||||
|
||||
bool HoymilesRadio_CMT::isConnected()
|
||||
bool HoymilesRadio_CMT::isConnected() const
|
||||
{
|
||||
if (!_isInitialized) {
|
||||
return false;
|
||||
|
||||
@ -22,9 +22,9 @@ public:
|
||||
void loop();
|
||||
void setPALevel(const int8_t paLevel);
|
||||
void setInverterTargetFrequency(const uint32_t frequency);
|
||||
uint32_t getInverterTargetFrequency();
|
||||
uint32_t getInverterTargetFrequency() const;
|
||||
|
||||
bool isConnected();
|
||||
bool isConnected() const;
|
||||
|
||||
static uint32_t getMinFrequency();
|
||||
static uint32_t getMaxFrequency();
|
||||
|
||||
@ -115,7 +115,7 @@ void HoymilesRadio_NRF::setDtuSerial(const uint64_t serial)
|
||||
openReadingPipe();
|
||||
}
|
||||
|
||||
bool HoymilesRadio_NRF::isConnected()
|
||||
bool HoymilesRadio_NRF::isConnected() const
|
||||
{
|
||||
if (!_isInitialized) {
|
||||
return false;
|
||||
@ -123,7 +123,7 @@ bool HoymilesRadio_NRF::isConnected()
|
||||
return _radio->isChipConnected();
|
||||
}
|
||||
|
||||
bool HoymilesRadio_NRF::isPVariant()
|
||||
bool HoymilesRadio_NRF::isPVariant() const
|
||||
{
|
||||
if (!_isInitialized) {
|
||||
return false;
|
||||
|
||||
@ -19,8 +19,8 @@ public:
|
||||
|
||||
virtual void setDtuSerial(const uint64_t serial);
|
||||
|
||||
bool isConnected();
|
||||
bool isPVariant();
|
||||
bool isConnected() const;
|
||||
bool isPVariant() const;
|
||||
|
||||
private:
|
||||
void ARDUINO_ISR_ATTR handleIntr();
|
||||
|
||||
@ -42,7 +42,7 @@ ActivePowerControlCommand::ActivePowerControlCommand(const uint64_t target_addre
|
||||
setTimeout(2000);
|
||||
}
|
||||
|
||||
String ActivePowerControlCommand::getCommandName()
|
||||
String ActivePowerControlCommand::getCommandName() const
|
||||
{
|
||||
return "ActivePowerControl";
|
||||
}
|
||||
@ -83,7 +83,7 @@ bool ActivePowerControlCommand::handleResponse(InverterAbstract* inverter, const
|
||||
return true;
|
||||
}
|
||||
|
||||
float ActivePowerControlCommand::getLimit()
|
||||
float ActivePowerControlCommand::getLimit() const
|
||||
{
|
||||
const uint16_t l = (((uint16_t)_payload[12] << 8) | _payload[13]);
|
||||
return l / 10;
|
||||
|
||||
@ -14,12 +14,12 @@ class ActivePowerControlCommand : public DevControlCommand {
|
||||
public:
|
||||
explicit ActivePowerControlCommand(const uint64_t target_address = 0, const uint64_t router_address = 0);
|
||||
|
||||
virtual String getCommandName();
|
||||
virtual String getCommandName() const;
|
||||
|
||||
virtual bool handleResponse(InverterAbstract* inverter, const fragment_t fragment[], const uint8_t max_fragment_id);
|
||||
virtual void gotTimeout(InverterAbstract* inverter);
|
||||
|
||||
void setActivePowerLimit(const float limit, const PowerLimitControlType type = RelativNonPersistent);
|
||||
float getLimit();
|
||||
float getLimit() const;
|
||||
PowerLimitControlType getType();
|
||||
};
|
||||
@ -31,7 +31,7 @@ AlarmDataCommand::AlarmDataCommand(const uint64_t target_address, const uint64_t
|
||||
setTimeout(750);
|
||||
}
|
||||
|
||||
String AlarmDataCommand::getCommandName()
|
||||
String AlarmDataCommand::getCommandName() const
|
||||
{
|
||||
return "AlarmData";
|
||||
}
|
||||
|
||||
@ -7,7 +7,7 @@ class AlarmDataCommand : public MultiDataCommand {
|
||||
public:
|
||||
explicit AlarmDataCommand(const uint64_t target_address = 0, const uint64_t router_address = 0, const time_t time = 0);
|
||||
|
||||
virtual String getCommandName();
|
||||
virtual String getCommandName() const;
|
||||
|
||||
virtual bool handleResponse(InverterAbstract* inverter, const fragment_t fragment[], const uint8_t max_fragment_id);
|
||||
virtual void gotTimeout(InverterAbstract* inverter);
|
||||
|
||||
@ -32,7 +32,7 @@ ChannelChangeCommand::ChannelChangeCommand(const uint64_t target_address, const
|
||||
setTimeout(10);
|
||||
}
|
||||
|
||||
String ChannelChangeCommand::getCommandName()
|
||||
String ChannelChangeCommand::getCommandName() const
|
||||
{
|
||||
return "ChannelChangeCommand";
|
||||
}
|
||||
@ -42,7 +42,7 @@ void ChannelChangeCommand::setChannel(const uint8_t channel)
|
||||
_payload[12] = channel;
|
||||
}
|
||||
|
||||
uint8_t ChannelChangeCommand::getChannel()
|
||||
uint8_t ChannelChangeCommand::getChannel() const
|
||||
{
|
||||
return _payload[12];
|
||||
}
|
||||
|
||||
@ -7,10 +7,10 @@ class ChannelChangeCommand : public CommandAbstract {
|
||||
public:
|
||||
explicit ChannelChangeCommand(const uint64_t target_address = 0, const uint64_t router_address = 0, const uint8_t channel = 0);
|
||||
|
||||
virtual String getCommandName();
|
||||
virtual String getCommandName() const;
|
||||
|
||||
void setChannel(const uint8_t channel);
|
||||
uint8_t getChannel();
|
||||
uint8_t getChannel() const;
|
||||
|
||||
virtual bool handleResponse(InverterAbstract* inverter, const fragment_t fragment[], const uint8_t max_fragment_id);
|
||||
|
||||
|
||||
@ -56,7 +56,7 @@ void CommandAbstract::dumpDataPayload(Print* stream)
|
||||
stream->println("");
|
||||
}
|
||||
|
||||
uint8_t CommandAbstract::getDataSize()
|
||||
uint8_t CommandAbstract::getDataSize() const
|
||||
{
|
||||
return _payload_size + 1; // Original payload plus crc8
|
||||
}
|
||||
@ -66,7 +66,7 @@ void CommandAbstract::setTargetAddress(const uint64_t address)
|
||||
convertSerialToPacketId(&_payload[1], address);
|
||||
_targetAddress = address;
|
||||
}
|
||||
uint64_t CommandAbstract::getTargetAddress()
|
||||
uint64_t CommandAbstract::getTargetAddress() const
|
||||
{
|
||||
return _targetAddress;
|
||||
}
|
||||
@ -77,7 +77,7 @@ void CommandAbstract::setRouterAddress(const uint64_t address)
|
||||
_routerAddress = address;
|
||||
}
|
||||
|
||||
uint64_t CommandAbstract::getRouterAddress()
|
||||
uint64_t CommandAbstract::getRouterAddress() const
|
||||
{
|
||||
return _routerAddress;
|
||||
}
|
||||
@ -87,7 +87,7 @@ void CommandAbstract::setTimeout(const uint32_t timeout)
|
||||
_timeout = timeout;
|
||||
}
|
||||
|
||||
uint32_t CommandAbstract::getTimeout()
|
||||
uint32_t CommandAbstract::getTimeout() const
|
||||
{
|
||||
return _timeout;
|
||||
}
|
||||
@ -97,7 +97,7 @@ void CommandAbstract::setSendCount(const uint8_t count)
|
||||
_sendCount = count;
|
||||
}
|
||||
|
||||
uint8_t CommandAbstract::getSendCount()
|
||||
uint8_t CommandAbstract::getSendCount() const
|
||||
{
|
||||
return _sendCount;
|
||||
}
|
||||
@ -126,12 +126,12 @@ void CommandAbstract::gotTimeout(InverterAbstract* inverter)
|
||||
{
|
||||
}
|
||||
|
||||
uint8_t CommandAbstract::getMaxResendCount()
|
||||
uint8_t CommandAbstract::getMaxResendCount() const
|
||||
{
|
||||
return MAX_RESEND_COUNT;
|
||||
}
|
||||
|
||||
uint8_t CommandAbstract::getMaxRetransmitCount()
|
||||
uint8_t CommandAbstract::getMaxRetransmitCount() const
|
||||
{
|
||||
return MAX_RETRANSMIT_COUNT;
|
||||
}
|
||||
|
||||
@ -19,21 +19,21 @@ public:
|
||||
const uint8_t* getDataPayload();
|
||||
void dumpDataPayload(Print* stream);
|
||||
|
||||
uint8_t getDataSize();
|
||||
uint8_t getDataSize() const;
|
||||
|
||||
void setTargetAddress(const uint64_t address);
|
||||
uint64_t getTargetAddress();
|
||||
uint64_t getTargetAddress() const;
|
||||
|
||||
void setRouterAddress(const uint64_t address);
|
||||
uint64_t getRouterAddress();
|
||||
uint64_t getRouterAddress() const;
|
||||
|
||||
void setTimeout(const uint32_t timeout);
|
||||
uint32_t getTimeout();
|
||||
uint32_t getTimeout() const;
|
||||
|
||||
virtual String getCommandName() = 0;
|
||||
virtual String getCommandName() const = 0;
|
||||
|
||||
void setSendCount(const uint8_t count);
|
||||
uint8_t getSendCount();
|
||||
uint8_t getSendCount() const;
|
||||
uint8_t incrementSendCount();
|
||||
|
||||
virtual CommandAbstract* getRequestFrameCommand(const uint8_t frame_no);
|
||||
@ -42,10 +42,10 @@ public:
|
||||
virtual void gotTimeout(InverterAbstract* inverter);
|
||||
|
||||
// Sets the amount how often the specific command is resent if all fragments where missing
|
||||
virtual uint8_t getMaxResendCount();
|
||||
virtual uint8_t getMaxResendCount() const;
|
||||
|
||||
// Sets the amount how often a missing fragment is re-requested if it was not available
|
||||
virtual uint8_t getMaxRetransmitCount();
|
||||
virtual uint8_t getMaxRetransmitCount() const;
|
||||
|
||||
protected:
|
||||
uint8_t _payload[RF_LEN];
|
||||
|
||||
@ -29,7 +29,7 @@ DevInfoAllCommand::DevInfoAllCommand(const uint64_t target_address, const uint64
|
||||
setTimeout(200);
|
||||
}
|
||||
|
||||
String DevInfoAllCommand::getCommandName()
|
||||
String DevInfoAllCommand::getCommandName() const
|
||||
{
|
||||
return "DevInfoAll";
|
||||
}
|
||||
|
||||
@ -7,7 +7,7 @@ class DevInfoAllCommand : public MultiDataCommand {
|
||||
public:
|
||||
explicit DevInfoAllCommand(const uint64_t target_address = 0, const uint64_t router_address = 0, const time_t time = 0);
|
||||
|
||||
virtual String getCommandName();
|
||||
virtual String getCommandName() const;
|
||||
|
||||
virtual bool handleResponse(InverterAbstract* inverter, const fragment_t fragment[], const uint8_t max_fragment_id);
|
||||
};
|
||||
@ -29,7 +29,7 @@ DevInfoSimpleCommand::DevInfoSimpleCommand(const uint64_t target_address, const
|
||||
setTimeout(200);
|
||||
}
|
||||
|
||||
String DevInfoSimpleCommand::getCommandName()
|
||||
String DevInfoSimpleCommand::getCommandName() const
|
||||
{
|
||||
return "DevInfoSimple";
|
||||
}
|
||||
|
||||
@ -7,7 +7,7 @@ class DevInfoSimpleCommand : public MultiDataCommand {
|
||||
public:
|
||||
explicit DevInfoSimpleCommand(const uint64_t target_address = 0, const uint64_t router_address = 0, const time_t time = 0);
|
||||
|
||||
virtual String getCommandName();
|
||||
virtual String getCommandName() const;
|
||||
|
||||
virtual bool handleResponse(InverterAbstract* inverter, const fragment_t fragment[], const uint8_t max_fragment_id);
|
||||
};
|
||||
@ -30,7 +30,7 @@ GridOnProFilePara::GridOnProFilePara(const uint64_t target_address, const uint64
|
||||
setTimeout(500);
|
||||
}
|
||||
|
||||
String GridOnProFilePara::getCommandName()
|
||||
String GridOnProFilePara::getCommandName() const
|
||||
{
|
||||
return "GridOnProFilePara";
|
||||
}
|
||||
|
||||
@ -7,7 +7,7 @@ class GridOnProFilePara : public MultiDataCommand {
|
||||
public:
|
||||
explicit GridOnProFilePara(const uint64_t target_address = 0, const uint64_t router_address = 0, const time_t time = 0);
|
||||
|
||||
virtual String getCommandName();
|
||||
virtual String getCommandName() const;
|
||||
|
||||
virtual bool handleResponse(InverterAbstract* inverter, const fragment_t fragment[], const uint8_t max_fragment_id);
|
||||
};
|
||||
@ -55,7 +55,7 @@ void MultiDataCommand::setDataType(const uint8_t data_type)
|
||||
_payload[10] = data_type;
|
||||
udpateCRC();
|
||||
}
|
||||
uint8_t MultiDataCommand::getDataType()
|
||||
uint8_t MultiDataCommand::getDataType() const
|
||||
{
|
||||
return _payload[10];
|
||||
}
|
||||
@ -69,7 +69,7 @@ void MultiDataCommand::setTime(const time_t time)
|
||||
udpateCRC();
|
||||
}
|
||||
|
||||
time_t MultiDataCommand::getTime()
|
||||
time_t MultiDataCommand::getTime() const
|
||||
{
|
||||
return (time_t)(_payload[12] << 24)
|
||||
| (time_t)(_payload[13] << 16)
|
||||
|
||||
@ -10,7 +10,7 @@ public:
|
||||
explicit MultiDataCommand(const uint64_t target_address = 0, const uint64_t router_address = 0, const uint8_t data_type = 0, const time_t time = 0);
|
||||
|
||||
void setTime(const time_t time);
|
||||
time_t getTime();
|
||||
time_t getTime() const;
|
||||
|
||||
CommandAbstract* getRequestFrameCommand(const uint8_t frame_no);
|
||||
|
||||
@ -18,7 +18,7 @@ public:
|
||||
|
||||
protected:
|
||||
void setDataType(const uint8_t data_type);
|
||||
uint8_t getDataType();
|
||||
uint8_t getDataType() const;
|
||||
void udpateCRC();
|
||||
static uint8_t getTotalFragmentSize(const fragment_t fragment[], const uint8_t max_fragment_id);
|
||||
|
||||
|
||||
@ -39,7 +39,7 @@ PowerControlCommand::PowerControlCommand(const uint64_t target_address, const ui
|
||||
setTimeout(2000);
|
||||
}
|
||||
|
||||
String PowerControlCommand::getCommandName()
|
||||
String PowerControlCommand::getCommandName() const
|
||||
{
|
||||
return "PowerControl";
|
||||
}
|
||||
|
||||
@ -7,7 +7,7 @@ class PowerControlCommand : public DevControlCommand {
|
||||
public:
|
||||
explicit PowerControlCommand(const uint64_t target_address = 0, const uint64_t router_address = 0);
|
||||
|
||||
virtual String getCommandName();
|
||||
virtual String getCommandName() const;
|
||||
|
||||
virtual bool handleResponse(InverterAbstract* inverter, const fragment_t fragment[], const uint8_t max_fragment_id);
|
||||
virtual void gotTimeout(InverterAbstract* inverter);
|
||||
|
||||
@ -30,7 +30,7 @@ RealTimeRunDataCommand::RealTimeRunDataCommand(const uint64_t target_address, co
|
||||
setTimeout(500);
|
||||
}
|
||||
|
||||
String RealTimeRunDataCommand::getCommandName()
|
||||
String RealTimeRunDataCommand::getCommandName() const
|
||||
{
|
||||
return "RealTimeRunData";
|
||||
}
|
||||
|
||||
@ -7,7 +7,7 @@ class RealTimeRunDataCommand : public MultiDataCommand {
|
||||
public:
|
||||
explicit RealTimeRunDataCommand(const uint64_t target_address = 0, const uint64_t router_address = 0, const time_t time = 0);
|
||||
|
||||
virtual String getCommandName();
|
||||
virtual String getCommandName() const;
|
||||
|
||||
virtual bool handleResponse(InverterAbstract* inverter, const fragment_t fragment[], const uint8_t max_fragment_id);
|
||||
virtual void gotTimeout(InverterAbstract* inverter);
|
||||
|
||||
@ -32,7 +32,7 @@ RequestFrameCommand::RequestFrameCommand(const uint64_t target_address, const ui
|
||||
_payload_size = 10;
|
||||
}
|
||||
|
||||
String RequestFrameCommand::getCommandName()
|
||||
String RequestFrameCommand::getCommandName() const
|
||||
{
|
||||
return "RequestFrame";
|
||||
}
|
||||
@ -42,7 +42,7 @@ void RequestFrameCommand::setFrameNo(const uint8_t frame_no)
|
||||
_payload[9] = frame_no | 0x80;
|
||||
}
|
||||
|
||||
uint8_t RequestFrameCommand::getFrameNo()
|
||||
uint8_t RequestFrameCommand::getFrameNo() const
|
||||
{
|
||||
return _payload[9] & (~0x80);
|
||||
}
|
||||
|
||||
@ -7,10 +7,10 @@ class RequestFrameCommand : public SingleDataCommand {
|
||||
public:
|
||||
explicit RequestFrameCommand(const uint64_t target_address = 0, const uint64_t router_address = 0, uint8_t frame_no = 0);
|
||||
|
||||
virtual String getCommandName();
|
||||
virtual String getCommandName() const;
|
||||
|
||||
void setFrameNo(const uint8_t frame_no);
|
||||
uint8_t getFrameNo();
|
||||
uint8_t getFrameNo() const;
|
||||
|
||||
virtual bool handleResponse(InverterAbstract* inverter, const fragment_t fragment[], const uint8_t max_fragment_id);
|
||||
};
|
||||
@ -30,7 +30,7 @@ SystemConfigParaCommand::SystemConfigParaCommand(const uint64_t target_address,
|
||||
setTimeout(200);
|
||||
}
|
||||
|
||||
String SystemConfigParaCommand::getCommandName()
|
||||
String SystemConfigParaCommand::getCommandName() const
|
||||
{
|
||||
return "SystemConfigPara";
|
||||
}
|
||||
|
||||
@ -7,7 +7,7 @@ class SystemConfigParaCommand : public MultiDataCommand {
|
||||
public:
|
||||
explicit SystemConfigParaCommand(const uint64_t target_address = 0, const uint64_t router_address = 0, const time_t time = 0);
|
||||
|
||||
virtual String getCommandName();
|
||||
virtual String getCommandName() const;
|
||||
|
||||
virtual bool handleResponse(InverterAbstract* inverter, const fragment_t fragment[], const uint8_t max_fragment_id);
|
||||
virtual void gotTimeout(InverterAbstract* inverter);
|
||||
|
||||
@ -38,17 +38,17 @@ bool HMS_1CH::isValidSerial(const uint64_t serial)
|
||||
return preSerial == 0x1124;
|
||||
}
|
||||
|
||||
String HMS_1CH::typeName()
|
||||
String HMS_1CH::typeName() const
|
||||
{
|
||||
return "HMS-300/350/400/450/500-1T";
|
||||
}
|
||||
|
||||
const byteAssign_t* HMS_1CH::getByteAssignment()
|
||||
const byteAssign_t* HMS_1CH::getByteAssignment() const
|
||||
{
|
||||
return byteAssignment;
|
||||
}
|
||||
|
||||
uint8_t HMS_1CH::getByteAssignmentSize()
|
||||
uint8_t HMS_1CH::getByteAssignmentSize() const
|
||||
{
|
||||
return sizeof(byteAssignment) / sizeof(byteAssignment[0]);
|
||||
}
|
||||
@ -8,7 +8,7 @@ class HMS_1CH : public HMS_Abstract {
|
||||
public:
|
||||
explicit HMS_1CH(HoymilesRadio* radio, const uint64_t serial);
|
||||
static bool isValidSerial(const uint64_t serial);
|
||||
String typeName();
|
||||
const byteAssign_t* getByteAssignment();
|
||||
uint8_t getByteAssignmentSize();
|
||||
String typeName() const;
|
||||
const byteAssign_t* getByteAssignment() const;
|
||||
uint8_t getByteAssignmentSize() const;
|
||||
};
|
||||
@ -38,17 +38,17 @@ bool HMS_1CHv2::isValidSerial(const uint64_t serial)
|
||||
return preSerial == 0x1125;
|
||||
}
|
||||
|
||||
String HMS_1CHv2::typeName()
|
||||
String HMS_1CHv2::typeName() const
|
||||
{
|
||||
return "HMS-500-1T v2";
|
||||
}
|
||||
|
||||
const byteAssign_t* HMS_1CHv2::getByteAssignment()
|
||||
const byteAssign_t* HMS_1CHv2::getByteAssignment() const
|
||||
{
|
||||
return byteAssignment;
|
||||
}
|
||||
|
||||
uint8_t HMS_1CHv2::getByteAssignmentSize()
|
||||
uint8_t HMS_1CHv2::getByteAssignmentSize() const
|
||||
{
|
||||
return sizeof(byteAssignment) / sizeof(byteAssignment[0]);
|
||||
}
|
||||
@ -8,7 +8,7 @@ class HMS_1CHv2 : public HMS_Abstract {
|
||||
public:
|
||||
explicit HMS_1CHv2(HoymilesRadio* radio, const uint64_t serial);
|
||||
static bool isValidSerial(const uint64_t serial);
|
||||
String typeName();
|
||||
const byteAssign_t* getByteAssignment();
|
||||
uint8_t getByteAssignmentSize();
|
||||
String typeName() const;
|
||||
const byteAssign_t* getByteAssignment() const;
|
||||
uint8_t getByteAssignmentSize() const;
|
||||
};
|
||||
@ -45,17 +45,17 @@ bool HMS_2CH::isValidSerial(const uint64_t serial)
|
||||
return preSerial == 0x1144;
|
||||
}
|
||||
|
||||
String HMS_2CH::typeName()
|
||||
String HMS_2CH::typeName() const
|
||||
{
|
||||
return "HMS-600/700/800/900/1000-2T";
|
||||
}
|
||||
|
||||
const byteAssign_t* HMS_2CH::getByteAssignment()
|
||||
const byteAssign_t* HMS_2CH::getByteAssignment() const
|
||||
{
|
||||
return byteAssignment;
|
||||
}
|
||||
|
||||
uint8_t HMS_2CH::getByteAssignmentSize()
|
||||
uint8_t HMS_2CH::getByteAssignmentSize() const
|
||||
{
|
||||
return sizeof(byteAssignment) / sizeof(byteAssignment[0]);
|
||||
}
|
||||
@ -8,7 +8,7 @@ class HMS_2CH : public HMS_Abstract {
|
||||
public:
|
||||
explicit HMS_2CH(HoymilesRadio* radio, const uint64_t serial);
|
||||
static bool isValidSerial(const uint64_t serial);
|
||||
String typeName();
|
||||
const byteAssign_t* getByteAssignment();
|
||||
uint8_t getByteAssignmentSize();
|
||||
String typeName() const;
|
||||
const byteAssign_t* getByteAssignment() const;
|
||||
uint8_t getByteAssignmentSize() const;
|
||||
};
|
||||
@ -59,17 +59,17 @@ bool HMS_4CH::isValidSerial(const uint64_t serial)
|
||||
return preSerial == 0x1164;
|
||||
}
|
||||
|
||||
String HMS_4CH::typeName()
|
||||
String HMS_4CH::typeName() const
|
||||
{
|
||||
return "HMS-1600/1800/2000-4T";
|
||||
}
|
||||
|
||||
const byteAssign_t* HMS_4CH::getByteAssignment()
|
||||
const byteAssign_t* HMS_4CH::getByteAssignment() const
|
||||
{
|
||||
return byteAssignment;
|
||||
}
|
||||
|
||||
uint8_t HMS_4CH::getByteAssignmentSize()
|
||||
uint8_t HMS_4CH::getByteAssignmentSize() const
|
||||
{
|
||||
return sizeof(byteAssignment) / sizeof(byteAssignment[0]);
|
||||
}
|
||||
@ -7,7 +7,7 @@ class HMS_4CH : public HMS_Abstract {
|
||||
public:
|
||||
explicit HMS_4CH(HoymilesRadio* radio, const uint64_t serial);
|
||||
static bool isValidSerial(const uint64_t serial);
|
||||
String typeName();
|
||||
const byteAssign_t* getByteAssignment();
|
||||
uint8_t getByteAssignmentSize();
|
||||
String typeName() const;
|
||||
const byteAssign_t* getByteAssignment() const;
|
||||
uint8_t getByteAssignmentSize() const;
|
||||
};
|
||||
@ -68,17 +68,17 @@ bool HMT_4CH::isValidSerial(const uint64_t serial)
|
||||
return preSerial == 0x1361;
|
||||
}
|
||||
|
||||
String HMT_4CH::typeName()
|
||||
String HMT_4CH::typeName() const
|
||||
{
|
||||
return F("HMT-1600/1800/2000-4T");
|
||||
}
|
||||
|
||||
const byteAssign_t* HMT_4CH::getByteAssignment()
|
||||
const byteAssign_t* HMT_4CH::getByteAssignment() const
|
||||
{
|
||||
return byteAssignment;
|
||||
}
|
||||
|
||||
uint8_t HMT_4CH::getByteAssignmentSize()
|
||||
uint8_t HMT_4CH::getByteAssignmentSize() const
|
||||
{
|
||||
return sizeof(byteAssignment) / sizeof(byteAssignment[0]);
|
||||
}
|
||||
|
||||
@ -7,7 +7,7 @@ class HMT_4CH : public HMT_Abstract {
|
||||
public:
|
||||
explicit HMT_4CH(HoymilesRadio* radio, const uint64_t serial);
|
||||
static bool isValidSerial(const uint64_t serial);
|
||||
String typeName();
|
||||
const byteAssign_t* getByteAssignment();
|
||||
uint8_t getByteAssignmentSize();
|
||||
String typeName() const;
|
||||
const byteAssign_t* getByteAssignment() const;
|
||||
uint8_t getByteAssignmentSize() const;
|
||||
};
|
||||
@ -82,17 +82,17 @@ bool HMT_6CH::isValidSerial(const uint64_t serial)
|
||||
return preSerial == 0x1382;
|
||||
}
|
||||
|
||||
String HMT_6CH::typeName()
|
||||
String HMT_6CH::typeName() const
|
||||
{
|
||||
return F("HMT-1800/2250-6T");
|
||||
}
|
||||
|
||||
const byteAssign_t* HMT_6CH::getByteAssignment()
|
||||
const byteAssign_t* HMT_6CH::getByteAssignment() const
|
||||
{
|
||||
return byteAssignment;
|
||||
}
|
||||
|
||||
uint8_t HMT_6CH::getByteAssignmentSize()
|
||||
uint8_t HMT_6CH::getByteAssignmentSize() const
|
||||
{
|
||||
return sizeof(byteAssignment) / sizeof(byteAssignment[0]);
|
||||
}
|
||||
|
||||
@ -7,7 +7,7 @@ class HMT_6CH : public HMT_Abstract {
|
||||
public:
|
||||
explicit HMT_6CH(HoymilesRadio* radio, const uint64_t serial);
|
||||
static bool isValidSerial(const uint64_t serial);
|
||||
String typeName();
|
||||
const byteAssign_t* getByteAssignment();
|
||||
uint8_t getByteAssignmentSize();
|
||||
String typeName() const;
|
||||
const byteAssign_t* getByteAssignment() const;
|
||||
uint8_t getByteAssignmentSize() const;
|
||||
};
|
||||
@ -51,17 +51,17 @@ bool HM_1CH::isValidSerial(const uint64_t serial)
|
||||
return false;
|
||||
}
|
||||
|
||||
String HM_1CH::typeName()
|
||||
String HM_1CH::typeName() const
|
||||
{
|
||||
return "HM-300/350/400-1T";
|
||||
}
|
||||
|
||||
const byteAssign_t* HM_1CH::getByteAssignment()
|
||||
const byteAssign_t* HM_1CH::getByteAssignment() const
|
||||
{
|
||||
return byteAssignment;
|
||||
}
|
||||
|
||||
uint8_t HM_1CH::getByteAssignmentSize()
|
||||
uint8_t HM_1CH::getByteAssignmentSize() const
|
||||
{
|
||||
return sizeof(byteAssignment) / sizeof(byteAssignment[0]);
|
||||
}
|
||||
@ -8,7 +8,7 @@ class HM_1CH : public HM_Abstract {
|
||||
public:
|
||||
explicit HM_1CH(HoymilesRadio* radio, const uint64_t serial);
|
||||
static bool isValidSerial(const uint64_t serial);
|
||||
String typeName();
|
||||
const byteAssign_t* getByteAssignment();
|
||||
uint8_t getByteAssignmentSize();
|
||||
String typeName() const;
|
||||
const byteAssign_t* getByteAssignment() const;
|
||||
uint8_t getByteAssignmentSize() const;
|
||||
};
|
||||
@ -59,17 +59,17 @@ bool HM_2CH::isValidSerial(const uint64_t serial)
|
||||
return false;
|
||||
}
|
||||
|
||||
String HM_2CH::typeName()
|
||||
String HM_2CH::typeName() const
|
||||
{
|
||||
return "HM-600/700/800-2T";
|
||||
}
|
||||
|
||||
const byteAssign_t* HM_2CH::getByteAssignment()
|
||||
const byteAssign_t* HM_2CH::getByteAssignment() const
|
||||
{
|
||||
return byteAssignment;
|
||||
}
|
||||
|
||||
uint8_t HM_2CH::getByteAssignmentSize()
|
||||
uint8_t HM_2CH::getByteAssignmentSize() const
|
||||
{
|
||||
return sizeof(byteAssignment) / sizeof(byteAssignment[0]);
|
||||
}
|
||||
@ -7,7 +7,7 @@ class HM_2CH : public HM_Abstract {
|
||||
public:
|
||||
explicit HM_2CH(HoymilesRadio* radio, const uint64_t serial);
|
||||
static bool isValidSerial(const uint64_t serial);
|
||||
String typeName();
|
||||
const byteAssign_t* getByteAssignment();
|
||||
uint8_t getByteAssignmentSize();
|
||||
String typeName() const;
|
||||
const byteAssign_t* getByteAssignment() const;
|
||||
uint8_t getByteAssignmentSize() const;
|
||||
};
|
||||
@ -72,17 +72,17 @@ bool HM_4CH::isValidSerial(const uint64_t serial)
|
||||
return false;
|
||||
}
|
||||
|
||||
String HM_4CH::typeName()
|
||||
String HM_4CH::typeName() const
|
||||
{
|
||||
return "HM-1000/1200/1500-4T";
|
||||
}
|
||||
|
||||
const byteAssign_t* HM_4CH::getByteAssignment()
|
||||
const byteAssign_t* HM_4CH::getByteAssignment() const
|
||||
{
|
||||
return byteAssignment;
|
||||
}
|
||||
|
||||
uint8_t HM_4CH::getByteAssignmentSize()
|
||||
uint8_t HM_4CH::getByteAssignmentSize() const
|
||||
{
|
||||
return sizeof(byteAssignment) / sizeof(byteAssignment[0]);
|
||||
}
|
||||
@ -7,7 +7,7 @@ class HM_4CH : public HM_Abstract {
|
||||
public:
|
||||
explicit HM_4CH(HoymilesRadio* radio, const uint64_t serial);
|
||||
static bool isValidSerial(const uint64_t serial);
|
||||
String typeName();
|
||||
const byteAssign_t* getByteAssignment();
|
||||
uint8_t getByteAssignmentSize();
|
||||
String typeName() const;
|
||||
const byteAssign_t* getByteAssignment() const;
|
||||
uint8_t getByteAssignmentSize() const;
|
||||
};
|
||||
@ -35,12 +35,12 @@ void InverterAbstract::init()
|
||||
_statisticsParser.get()->setByteAssignment(getByteAssignment(), getByteAssignmentSize());
|
||||
}
|
||||
|
||||
uint64_t InverterAbstract::serial()
|
||||
uint64_t InverterAbstract::serial() const
|
||||
{
|
||||
return _serial.u64;
|
||||
}
|
||||
|
||||
const String& InverterAbstract::serialString()
|
||||
const String& InverterAbstract::serialString() const
|
||||
{
|
||||
return _serialString;
|
||||
}
|
||||
@ -55,7 +55,7 @@ void InverterAbstract::setName(const char* name)
|
||||
_name[len] = '\0';
|
||||
}
|
||||
|
||||
const char* InverterAbstract::name()
|
||||
const char* InverterAbstract::name() const
|
||||
{
|
||||
return _name;
|
||||
}
|
||||
@ -82,7 +82,7 @@ void InverterAbstract::setEnablePolling(const bool enabled)
|
||||
_enablePolling = enabled;
|
||||
}
|
||||
|
||||
bool InverterAbstract::getEnablePolling()
|
||||
bool InverterAbstract::getEnablePolling() const
|
||||
{
|
||||
return _enablePolling;
|
||||
}
|
||||
@ -92,7 +92,7 @@ void InverterAbstract::setEnableCommands(const bool enabled)
|
||||
_enableCommands = enabled;
|
||||
}
|
||||
|
||||
bool InverterAbstract::getEnableCommands()
|
||||
bool InverterAbstract::getEnableCommands() const
|
||||
{
|
||||
return _enableCommands;
|
||||
}
|
||||
@ -102,7 +102,7 @@ void InverterAbstract::setReachableThreshold(const uint8_t threshold)
|
||||
_reachableThreshold = threshold;
|
||||
}
|
||||
|
||||
uint8_t InverterAbstract::getReachableThreshold()
|
||||
uint8_t InverterAbstract::getReachableThreshold() const
|
||||
{
|
||||
return _reachableThreshold;
|
||||
}
|
||||
@ -112,7 +112,7 @@ void InverterAbstract::setZeroValuesIfUnreachable(const bool enabled)
|
||||
_zeroValuesIfUnreachable = enabled;
|
||||
}
|
||||
|
||||
bool InverterAbstract::getZeroValuesIfUnreachable()
|
||||
bool InverterAbstract::getZeroValuesIfUnreachable() const
|
||||
{
|
||||
return _zeroValuesIfUnreachable;
|
||||
}
|
||||
@ -122,7 +122,7 @@ void InverterAbstract::setZeroYieldDayOnMidnight(const bool enabled)
|
||||
_zeroYieldDayOnMidnight = enabled;
|
||||
}
|
||||
|
||||
bool InverterAbstract::getZeroYieldDayOnMidnight()
|
||||
bool InverterAbstract::getZeroYieldDayOnMidnight() const
|
||||
{
|
||||
return _zeroYieldDayOnMidnight;
|
||||
}
|
||||
|
||||
@ -32,31 +32,31 @@ class InverterAbstract {
|
||||
public:
|
||||
explicit InverterAbstract(HoymilesRadio* radio, const uint64_t serial);
|
||||
void init();
|
||||
uint64_t serial();
|
||||
const String& serialString();
|
||||
uint64_t serial() const;
|
||||
const String& serialString() const;
|
||||
void setName(const char* name);
|
||||
const char* name();
|
||||
virtual String typeName() = 0;
|
||||
virtual const byteAssign_t* getByteAssignment() = 0;
|
||||
virtual uint8_t getByteAssignmentSize() = 0;
|
||||
const char* name() const;
|
||||
virtual String typeName() const = 0;
|
||||
virtual const byteAssign_t* getByteAssignment() const = 0;
|
||||
virtual uint8_t getByteAssignmentSize() const = 0;
|
||||
|
||||
bool isProducing();
|
||||
bool isReachable();
|
||||
|
||||
void setEnablePolling(const bool enabled);
|
||||
bool getEnablePolling();
|
||||
bool getEnablePolling() const;
|
||||
|
||||
void setEnableCommands(const bool enabled);
|
||||
bool getEnableCommands();
|
||||
bool getEnableCommands() const;
|
||||
|
||||
void setReachableThreshold(const uint8_t threshold);
|
||||
uint8_t getReachableThreshold();
|
||||
uint8_t getReachableThreshold() const;
|
||||
|
||||
void setZeroValuesIfUnreachable(const bool enabled);
|
||||
bool getZeroValuesIfUnreachable();
|
||||
bool getZeroValuesIfUnreachable() const;
|
||||
|
||||
void setZeroYieldDayOnMidnight(const bool enabled);
|
||||
bool getZeroYieldDayOnMidnight();
|
||||
bool getZeroYieldDayOnMidnight() const;
|
||||
|
||||
void clearRxFragmentBuffer();
|
||||
void addRxFragment(const uint8_t fragment[], const uint8_t len);
|
||||
|
||||
@ -191,7 +191,7 @@ void AlarmLogParser::appendFragment(const uint8_t offset, const uint8_t* payload
|
||||
_alarmLogLength += len;
|
||||
}
|
||||
|
||||
uint8_t AlarmLogParser::getEntryCount()
|
||||
uint8_t AlarmLogParser::getEntryCount() const
|
||||
{
|
||||
if (_alarmLogLength < 2) {
|
||||
return 0;
|
||||
@ -204,7 +204,7 @@ void AlarmLogParser::setLastAlarmRequestSuccess(const LastCommandSuccess status)
|
||||
_lastAlarmRequestSuccess = status;
|
||||
}
|
||||
|
||||
LastCommandSuccess AlarmLogParser::getLastAlarmRequestSuccess()
|
||||
LastCommandSuccess AlarmLogParser::getLastAlarmRequestSuccess() const
|
||||
{
|
||||
return _lastAlarmRequestSuccess;
|
||||
}
|
||||
@ -266,7 +266,7 @@ void AlarmLogParser::getLogEntry(const uint8_t entryId, AlarmLogEntry_t* entry,
|
||||
}
|
||||
}
|
||||
|
||||
String AlarmLogParser::getLocaleMessage(const AlarmMessage_t* msg, const AlarmMessageLocale_t locale)
|
||||
String AlarmLogParser::getLocaleMessage(const AlarmMessage_t* msg, const AlarmMessageLocale_t locale) const
|
||||
{
|
||||
if (locale == AlarmMessageLocale_t::DE) {
|
||||
return msg->Message_de[0] != '\0' ? msg->Message_de : msg->Message_en;
|
||||
|
||||
@ -42,17 +42,17 @@ public:
|
||||
void clearBuffer();
|
||||
void appendFragment(const uint8_t offset, const uint8_t* payload, const uint8_t len);
|
||||
|
||||
uint8_t getEntryCount();
|
||||
uint8_t getEntryCount() const;
|
||||
void getLogEntry(const uint8_t entryId, AlarmLogEntry_t* entry, const AlarmMessageLocale_t locale = AlarmMessageLocale_t::EN);
|
||||
|
||||
void setLastAlarmRequestSuccess(const LastCommandSuccess status);
|
||||
LastCommandSuccess getLastAlarmRequestSuccess();
|
||||
LastCommandSuccess getLastAlarmRequestSuccess() const;
|
||||
|
||||
void setMessageType(const AlarmMessageType_t type);
|
||||
|
||||
private:
|
||||
static int getTimezoneOffset();
|
||||
String getLocaleMessage(const AlarmMessage_t* msg, const AlarmMessageLocale_t locale);
|
||||
String getLocaleMessage(const AlarmMessage_t* msg, const AlarmMessageLocale_t locale) const;
|
||||
|
||||
uint8_t _payloadAlarmLog[ALARM_LOG_PAYLOAD_SIZE];
|
||||
uint8_t _alarmLogLength = 0;
|
||||
|
||||
@ -91,7 +91,7 @@ void DevInfoParser::appendFragmentSimple(const uint8_t offset, const uint8_t* pa
|
||||
_devInfoSimpleLength += len;
|
||||
}
|
||||
|
||||
uint32_t DevInfoParser::getLastUpdateAll()
|
||||
uint32_t DevInfoParser::getLastUpdateAll() const
|
||||
{
|
||||
return _lastUpdateAll;
|
||||
}
|
||||
@ -102,7 +102,7 @@ void DevInfoParser::setLastUpdateAll(const uint32_t lastUpdate)
|
||||
setLastUpdate(lastUpdate);
|
||||
}
|
||||
|
||||
uint32_t DevInfoParser::getLastUpdateSimple()
|
||||
uint32_t DevInfoParser::getLastUpdateSimple() const
|
||||
{
|
||||
return _lastUpdateSimple;
|
||||
}
|
||||
@ -113,7 +113,7 @@ void DevInfoParser::setLastUpdateSimple(const uint32_t lastUpdate)
|
||||
setLastUpdate(lastUpdate);
|
||||
}
|
||||
|
||||
uint16_t DevInfoParser::getFwBuildVersion()
|
||||
uint16_t DevInfoParser::getFwBuildVersion() const
|
||||
{
|
||||
HOY_SEMAPHORE_TAKE();
|
||||
const uint16_t ret = (((uint16_t)_payloadDevInfoAll[0]) << 8) | _payloadDevInfoAll[1];
|
||||
@ -121,7 +121,7 @@ uint16_t DevInfoParser::getFwBuildVersion()
|
||||
return ret;
|
||||
}
|
||||
|
||||
time_t DevInfoParser::getFwBuildDateTime()
|
||||
time_t DevInfoParser::getFwBuildDateTime() const
|
||||
{
|
||||
struct tm timeinfo = {};
|
||||
HOY_SEMAPHORE_TAKE();
|
||||
@ -137,7 +137,7 @@ time_t DevInfoParser::getFwBuildDateTime()
|
||||
return timegm(&timeinfo);
|
||||
}
|
||||
|
||||
uint16_t DevInfoParser::getFwBootloaderVersion()
|
||||
uint16_t DevInfoParser::getFwBootloaderVersion() const
|
||||
{
|
||||
HOY_SEMAPHORE_TAKE();
|
||||
const uint16_t ret = (((uint16_t)_payloadDevInfoAll[8]) << 8) | _payloadDevInfoAll[9];
|
||||
@ -145,7 +145,7 @@ uint16_t DevInfoParser::getFwBootloaderVersion()
|
||||
return ret;
|
||||
}
|
||||
|
||||
uint32_t DevInfoParser::getHwPartNumber()
|
||||
uint32_t DevInfoParser::getHwPartNumber() const
|
||||
{
|
||||
HOY_SEMAPHORE_TAKE();
|
||||
const uint16_t hwpn_h = (((uint16_t)_payloadDevInfoSimple[2]) << 8) | _payloadDevInfoSimple[3];
|
||||
@ -155,7 +155,7 @@ uint32_t DevInfoParser::getHwPartNumber()
|
||||
return ((uint32_t)hwpn_h << 16) | ((uint32_t)hwpn_l);
|
||||
}
|
||||
|
||||
String DevInfoParser::getHwVersion()
|
||||
String DevInfoParser::getHwVersion() const
|
||||
{
|
||||
char buf[8];
|
||||
HOY_SEMAPHORE_TAKE();
|
||||
@ -164,7 +164,7 @@ String DevInfoParser::getHwVersion()
|
||||
return buf;
|
||||
}
|
||||
|
||||
uint16_t DevInfoParser::getMaxPower()
|
||||
uint16_t DevInfoParser::getMaxPower() const
|
||||
{
|
||||
const uint8_t idx = getDevIdx();
|
||||
if (idx == 0xff) {
|
||||
@ -173,7 +173,7 @@ uint16_t DevInfoParser::getMaxPower()
|
||||
return devInfo[idx].maxPower;
|
||||
}
|
||||
|
||||
String DevInfoParser::getHwModelName()
|
||||
String DevInfoParser::getHwModelName() const
|
||||
{
|
||||
const uint8_t idx = getDevIdx();
|
||||
if (idx == 0xff) {
|
||||
@ -182,7 +182,7 @@ String DevInfoParser::getHwModelName()
|
||||
return devInfo[idx].modelName;
|
||||
}
|
||||
|
||||
bool DevInfoParser::containsValidData()
|
||||
bool DevInfoParser::containsValidData() const
|
||||
{
|
||||
const time_t t = getFwBuildDateTime();
|
||||
|
||||
@ -192,7 +192,7 @@ bool DevInfoParser::containsValidData()
|
||||
return info.tm_year > (2016 - 1900);
|
||||
}
|
||||
|
||||
uint8_t DevInfoParser::getDevIdx()
|
||||
uint8_t DevInfoParser::getDevIdx() const
|
||||
{
|
||||
uint8_t ret = 0xff;
|
||||
uint8_t pos;
|
||||
|
||||
@ -13,27 +13,27 @@ public:
|
||||
void clearBufferSimple();
|
||||
void appendFragmentSimple(const uint8_t offset, const uint8_t* payload, const uint8_t len);
|
||||
|
||||
uint32_t getLastUpdateAll();
|
||||
uint32_t getLastUpdateAll() const;
|
||||
void setLastUpdateAll(const uint32_t lastUpdate);
|
||||
|
||||
uint32_t getLastUpdateSimple();
|
||||
uint32_t getLastUpdateSimple() const;
|
||||
void setLastUpdateSimple(const uint32_t lastUpdate);
|
||||
|
||||
uint16_t getFwBuildVersion();
|
||||
time_t getFwBuildDateTime();
|
||||
uint16_t getFwBootloaderVersion();
|
||||
uint16_t getFwBuildVersion() const;
|
||||
time_t getFwBuildDateTime() const;
|
||||
uint16_t getFwBootloaderVersion() const;
|
||||
|
||||
uint32_t getHwPartNumber();
|
||||
String getHwVersion();
|
||||
uint32_t getHwPartNumber() const;
|
||||
String getHwVersion() const;
|
||||
|
||||
uint16_t getMaxPower();
|
||||
String getHwModelName();
|
||||
uint16_t getMaxPower() const;
|
||||
String getHwModelName() const;
|
||||
|
||||
bool containsValidData();
|
||||
bool containsValidData() const;
|
||||
|
||||
private:
|
||||
time_t timegm(const struct tm* tm);
|
||||
uint8_t getDevIdx();
|
||||
static time_t timegm(const struct tm* tm);
|
||||
uint8_t getDevIdx() const;
|
||||
|
||||
uint32_t _lastUpdateAll = 0;
|
||||
uint32_t _lastUpdateSimple = 0;
|
||||
|
||||
@ -297,7 +297,7 @@ void GridProfileParser::appendFragment(const uint8_t offset, const uint8_t* payl
|
||||
_gridProfileLength += len;
|
||||
}
|
||||
|
||||
String GridProfileParser::getProfileName()
|
||||
String GridProfileParser::getProfileName() const
|
||||
{
|
||||
for (auto& ptype : _profileTypes) {
|
||||
if (ptype.lIdx == _payloadGridProfile[0] && ptype.hIdx == _payloadGridProfile[1]) {
|
||||
@ -307,7 +307,7 @@ String GridProfileParser::getProfileName()
|
||||
return "Unknown";
|
||||
}
|
||||
|
||||
String GridProfileParser::getProfileVersion()
|
||||
String GridProfileParser::getProfileVersion() const
|
||||
{
|
||||
char buffer[10];
|
||||
HOY_SEMAPHORE_TAKE();
|
||||
@ -316,7 +316,7 @@ String GridProfileParser::getProfileVersion()
|
||||
return buffer;
|
||||
}
|
||||
|
||||
std::vector<uint8_t> GridProfileParser::getRawData()
|
||||
std::vector<uint8_t> GridProfileParser::getRawData() const
|
||||
{
|
||||
std::vector<uint8_t> ret;
|
||||
HOY_SEMAPHORE_TAKE();
|
||||
@ -327,7 +327,7 @@ std::vector<uint8_t> GridProfileParser::getRawData()
|
||||
return ret;
|
||||
}
|
||||
|
||||
std::list<GridProfileSection_t> GridProfileParser::getProfile()
|
||||
std::list<GridProfileSection_t> GridProfileParser::getProfile() const
|
||||
{
|
||||
std::list<GridProfileSection_t> l;
|
||||
|
||||
|
||||
@ -36,12 +36,12 @@ public:
|
||||
void clearBuffer();
|
||||
void appendFragment(const uint8_t offset, const uint8_t* payload, const uint8_t len);
|
||||
|
||||
String getProfileName();
|
||||
String getProfileVersion();
|
||||
String getProfileName() const;
|
||||
String getProfileVersion() const;
|
||||
|
||||
std::vector<uint8_t> getRawData();
|
||||
std::vector<uint8_t> getRawData() const;
|
||||
|
||||
std::list<GridProfileSection_t> getProfile();
|
||||
std::list<GridProfileSection_t> getProfile() const;
|
||||
|
||||
private:
|
||||
static uint8_t getSectionSize(const uint8_t section_id, const uint8_t section_version);
|
||||
|
||||
@ -10,7 +10,7 @@ Parser::Parser()
|
||||
HOY_SEMAPHORE_GIVE(); // release before first use
|
||||
}
|
||||
|
||||
uint32_t Parser::getLastUpdate()
|
||||
uint32_t Parser::getLastUpdate() const
|
||||
{
|
||||
return _lastUpdate;
|
||||
}
|
||||
|
||||
@ -17,7 +17,7 @@ typedef enum {
|
||||
class Parser {
|
||||
public:
|
||||
Parser();
|
||||
uint32_t getLastUpdate();
|
||||
uint32_t getLastUpdate() const;
|
||||
void setLastUpdate(const uint32_t lastUpdate);
|
||||
|
||||
void beginAppendFragment();
|
||||
|
||||
@ -9,12 +9,12 @@ void PowerCommandParser::setLastPowerCommandSuccess(const LastCommandSuccess sta
|
||||
_lastLimitCommandSuccess = status;
|
||||
}
|
||||
|
||||
LastCommandSuccess PowerCommandParser::getLastPowerCommandSuccess()
|
||||
LastCommandSuccess PowerCommandParser::getLastPowerCommandSuccess() const
|
||||
{
|
||||
return _lastLimitCommandSuccess;
|
||||
}
|
||||
|
||||
uint32_t PowerCommandParser::getLastUpdateCommand()
|
||||
uint32_t PowerCommandParser::getLastUpdateCommand() const
|
||||
{
|
||||
return _lastUpdateCommand;
|
||||
}
|
||||
|
||||
@ -5,8 +5,8 @@
|
||||
class PowerCommandParser : public Parser {
|
||||
public:
|
||||
void setLastPowerCommandSuccess(const LastCommandSuccess status);
|
||||
LastCommandSuccess getLastPowerCommandSuccess();
|
||||
uint32_t getLastUpdateCommand();
|
||||
LastCommandSuccess getLastPowerCommandSuccess() const;
|
||||
uint32_t getLastUpdateCommand() const;
|
||||
void setLastUpdateCommand(const uint32_t lastUpdate);
|
||||
|
||||
private:
|
||||
|
||||
@ -121,7 +121,7 @@ void StatisticsParser::endAppendFragment()
|
||||
}
|
||||
}
|
||||
|
||||
const byteAssign_t* StatisticsParser::getAssignmentByChannelField(const ChannelType_t type, const ChannelNum_t channel, const FieldId_t fieldId)
|
||||
const byteAssign_t* StatisticsParser::getAssignmentByChannelField(const ChannelType_t type, const ChannelNum_t channel, const FieldId_t fieldId) const
|
||||
{
|
||||
for (uint8_t i = 0; i < _byteAssignmentSize; i++) {
|
||||
if (_byteAssignment[i].type == type && _byteAssignment[i].ch == channel && _byteAssignment[i].fieldId == fieldId) {
|
||||
@ -233,25 +233,25 @@ String StatisticsParser::getChannelFieldValueString(const ChannelType_t type, co
|
||||
static_cast<unsigned int>(getChannelFieldDigits(type, channel, fieldId)));
|
||||
}
|
||||
|
||||
bool StatisticsParser::hasChannelFieldValue(const ChannelType_t type, const ChannelNum_t channel, const FieldId_t fieldId)
|
||||
bool StatisticsParser::hasChannelFieldValue(const ChannelType_t type, const ChannelNum_t channel, const FieldId_t fieldId) const
|
||||
{
|
||||
const byteAssign_t* pos = getAssignmentByChannelField(type, channel, fieldId);
|
||||
return pos != nullptr;
|
||||
}
|
||||
|
||||
const char* StatisticsParser::getChannelFieldUnit(const ChannelType_t type, const ChannelNum_t channel, const FieldId_t fieldId)
|
||||
const char* StatisticsParser::getChannelFieldUnit(const ChannelType_t type, const ChannelNum_t channel, const FieldId_t fieldId) const
|
||||
{
|
||||
const byteAssign_t* pos = getAssignmentByChannelField(type, channel, fieldId);
|
||||
return units[pos->unitId];
|
||||
}
|
||||
|
||||
const char* StatisticsParser::getChannelFieldName(const ChannelType_t type, const ChannelNum_t channel, const FieldId_t fieldId)
|
||||
const char* StatisticsParser::getChannelFieldName(const ChannelType_t type, const ChannelNum_t channel, const FieldId_t fieldId) const
|
||||
{
|
||||
const byteAssign_t* pos = getAssignmentByChannelField(type, channel, fieldId);
|
||||
return fields[pos->fieldId];
|
||||
}
|
||||
|
||||
uint8_t StatisticsParser::getChannelFieldDigits(const ChannelType_t type, const ChannelNum_t channel, const FieldId_t fieldId)
|
||||
uint8_t StatisticsParser::getChannelFieldDigits(const ChannelType_t type, const ChannelNum_t channel, const FieldId_t fieldId) const
|
||||
{
|
||||
const byteAssign_t* pos = getAssignmentByChannelField(type, channel, fieldId);
|
||||
return pos->digits;
|
||||
@ -276,7 +276,7 @@ void StatisticsParser::setChannelFieldOffset(const ChannelType_t type, const Cha
|
||||
}
|
||||
}
|
||||
|
||||
std::list<ChannelType_t> StatisticsParser::getChannelTypes()
|
||||
std::list<ChannelType_t> StatisticsParser::getChannelTypes() const
|
||||
{
|
||||
return {
|
||||
TYPE_AC,
|
||||
@ -285,12 +285,12 @@ std::list<ChannelType_t> StatisticsParser::getChannelTypes()
|
||||
};
|
||||
}
|
||||
|
||||
const char* StatisticsParser::getChannelTypeName(const ChannelType_t type)
|
||||
const char* StatisticsParser::getChannelTypeName(const ChannelType_t type) const
|
||||
{
|
||||
return channelsTypes[type];
|
||||
}
|
||||
|
||||
std::list<ChannelNum_t> StatisticsParser::getChannelsByType(const ChannelType_t type)
|
||||
std::list<ChannelNum_t> StatisticsParser::getChannelsByType(const ChannelType_t type) const
|
||||
{
|
||||
std::list<ChannelNum_t> l;
|
||||
for (uint8_t i = 0; i < _byteAssignmentSize; i++) {
|
||||
@ -302,7 +302,7 @@ std::list<ChannelNum_t> StatisticsParser::getChannelsByType(const ChannelType_t
|
||||
return l;
|
||||
}
|
||||
|
||||
uint16_t StatisticsParser::getStringMaxPower(const uint8_t channel)
|
||||
uint16_t StatisticsParser::getStringMaxPower(const uint8_t channel) const
|
||||
{
|
||||
return _stringMaxPower[channel];
|
||||
}
|
||||
@ -324,7 +324,7 @@ void StatisticsParser::incrementRxFailureCount()
|
||||
_rxFailureCount++;
|
||||
}
|
||||
|
||||
uint32_t StatisticsParser::getRxFailureCount()
|
||||
uint32_t StatisticsParser::getRxFailureCount() const
|
||||
{
|
||||
return _rxFailureCount;
|
||||
}
|
||||
@ -345,7 +345,7 @@ void StatisticsParser::setLastUpdate(const uint32_t lastUpdate)
|
||||
setLastUpdateFromInternal(lastUpdate);
|
||||
}
|
||||
|
||||
uint32_t StatisticsParser::getLastUpdateFromInternal()
|
||||
uint32_t StatisticsParser::getLastUpdateFromInternal() const
|
||||
{
|
||||
return _lastUpdateFromInternal;
|
||||
}
|
||||
@ -355,7 +355,7 @@ void StatisticsParser::setLastUpdateFromInternal(const uint32_t lastUpdate)
|
||||
_lastUpdateFromInternal = lastUpdate;
|
||||
}
|
||||
|
||||
bool StatisticsParser::getYieldDayCorrection()
|
||||
bool StatisticsParser::getYieldDayCorrection() const
|
||||
{
|
||||
return _enableYieldDayCorrection;
|
||||
}
|
||||
|
||||
@ -113,31 +113,31 @@ public:
|
||||
// Returns 1 based amount of expected bytes of statistic data
|
||||
uint8_t getExpectedByteCount();
|
||||
|
||||
const byteAssign_t* getAssignmentByChannelField(const ChannelType_t type, const ChannelNum_t channel, const FieldId_t fieldId);
|
||||
const byteAssign_t* getAssignmentByChannelField(const ChannelType_t type, const ChannelNum_t channel, const FieldId_t fieldId) const;
|
||||
fieldSettings_t* getSettingByChannelField(const ChannelType_t type, const ChannelNum_t channel, const FieldId_t fieldId);
|
||||
|
||||
float getChannelFieldValue(const ChannelType_t type, const ChannelNum_t channel, const FieldId_t fieldId);
|
||||
String getChannelFieldValueString(const ChannelType_t type, const ChannelNum_t channel, const FieldId_t fieldId);
|
||||
bool hasChannelFieldValue(const ChannelType_t type, const ChannelNum_t channel, const FieldId_t fieldId);
|
||||
const char* getChannelFieldUnit(const ChannelType_t type, const ChannelNum_t channel, const FieldId_t fieldId);
|
||||
const char* getChannelFieldName(const ChannelType_t type, const ChannelNum_t channel, const FieldId_t fieldId);
|
||||
uint8_t getChannelFieldDigits(const ChannelType_t type, const ChannelNum_t channel, const FieldId_t fieldId);
|
||||
bool hasChannelFieldValue(const ChannelType_t type, const ChannelNum_t channel, const FieldId_t fieldId) const;
|
||||
const char* getChannelFieldUnit(const ChannelType_t type, const ChannelNum_t channel, const FieldId_t fieldId) const;
|
||||
const char* getChannelFieldName(const ChannelType_t type, const ChannelNum_t channel, const FieldId_t fieldId) const;
|
||||
uint8_t getChannelFieldDigits(const ChannelType_t type, const ChannelNum_t channel, const FieldId_t fieldId) const;
|
||||
|
||||
bool setChannelFieldValue(const ChannelType_t type, const ChannelNum_t channel, const FieldId_t fieldId, float value);
|
||||
|
||||
float getChannelFieldOffset(const ChannelType_t type, const ChannelNum_t channel, const FieldId_t fieldId);
|
||||
void setChannelFieldOffset(const ChannelType_t type, const ChannelNum_t channel, const FieldId_t fieldId, const float offset);
|
||||
|
||||
std::list<ChannelType_t> getChannelTypes();
|
||||
const char* getChannelTypeName(const ChannelType_t type);
|
||||
std::list<ChannelNum_t> getChannelsByType(const ChannelType_t type);
|
||||
std::list<ChannelType_t> getChannelTypes() const;
|
||||
const char* getChannelTypeName(const ChannelType_t type) const;
|
||||
std::list<ChannelNum_t> getChannelsByType(const ChannelType_t type) const;
|
||||
|
||||
uint16_t getStringMaxPower(const uint8_t channel);
|
||||
uint16_t getStringMaxPower(const uint8_t channel) const;
|
||||
void setStringMaxPower(const uint8_t channel, const uint16_t power);
|
||||
|
||||
void resetRxFailureCount();
|
||||
void incrementRxFailureCount();
|
||||
uint32_t getRxFailureCount();
|
||||
uint32_t getRxFailureCount() const;
|
||||
|
||||
void zeroRuntimeData();
|
||||
void zeroDailyData();
|
||||
@ -147,10 +147,10 @@ public:
|
||||
void setLastUpdate(const uint32_t lastUpdate);
|
||||
|
||||
// Update time when internal data structure changes (from inverter and by internal manipulation)
|
||||
uint32_t getLastUpdateFromInternal();
|
||||
uint32_t getLastUpdateFromInternal() const;
|
||||
void setLastUpdateFromInternal(const uint32_t lastUpdate);
|
||||
|
||||
bool getYieldDayCorrection();
|
||||
bool getYieldDayCorrection() const;
|
||||
void setYieldDayCorrection(const bool enabled);
|
||||
private:
|
||||
void zeroFields(const FieldId_t* fields);
|
||||
|
||||
@ -28,7 +28,7 @@ void SystemConfigParaParser::appendFragment(const uint8_t offset, const uint8_t*
|
||||
_payloadLength += len;
|
||||
}
|
||||
|
||||
float SystemConfigParaParser::getLimitPercent()
|
||||
float SystemConfigParaParser::getLimitPercent() const
|
||||
{
|
||||
HOY_SEMAPHORE_TAKE();
|
||||
const float ret = ((((uint16_t)_payload[2]) << 8) | _payload[3]) / 10.0;
|
||||
@ -49,12 +49,12 @@ void SystemConfigParaParser::setLastLimitCommandSuccess(const LastCommandSuccess
|
||||
_lastLimitCommandSuccess = status;
|
||||
}
|
||||
|
||||
LastCommandSuccess SystemConfigParaParser::getLastLimitCommandSuccess()
|
||||
LastCommandSuccess SystemConfigParaParser::getLastLimitCommandSuccess() const
|
||||
{
|
||||
return _lastLimitCommandSuccess;
|
||||
}
|
||||
|
||||
uint32_t SystemConfigParaParser::getLastUpdateCommand()
|
||||
uint32_t SystemConfigParaParser::getLastUpdateCommand() const
|
||||
{
|
||||
return _lastUpdateCommand;
|
||||
}
|
||||
@ -70,12 +70,12 @@ void SystemConfigParaParser::setLastLimitRequestSuccess(const LastCommandSuccess
|
||||
_lastLimitRequestSuccess = status;
|
||||
}
|
||||
|
||||
LastCommandSuccess SystemConfigParaParser::getLastLimitRequestSuccess()
|
||||
LastCommandSuccess SystemConfigParaParser::getLastLimitRequestSuccess() const
|
||||
{
|
||||
return _lastLimitRequestSuccess;
|
||||
}
|
||||
|
||||
uint32_t SystemConfigParaParser::getLastUpdateRequest()
|
||||
uint32_t SystemConfigParaParser::getLastUpdateRequest() const
|
||||
{
|
||||
return _lastUpdateRequest;
|
||||
}
|
||||
@ -86,7 +86,7 @@ void SystemConfigParaParser::setLastUpdateRequest(const uint32_t lastUpdate)
|
||||
setLastUpdate(lastUpdate);
|
||||
}
|
||||
|
||||
uint8_t SystemConfigParaParser::getExpectedByteCount()
|
||||
uint8_t SystemConfigParaParser::getExpectedByteCount() const
|
||||
{
|
||||
return SYSTEM_CONFIG_PARA_SIZE;
|
||||
}
|
||||
|
||||
@ -10,21 +10,21 @@ public:
|
||||
void clearBuffer();
|
||||
void appendFragment(const uint8_t offset, const uint8_t* payload, const uint8_t len);
|
||||
|
||||
float getLimitPercent();
|
||||
float getLimitPercent() const;
|
||||
void setLimitPercent(const float value);
|
||||
|
||||
void setLastLimitCommandSuccess(const LastCommandSuccess status);
|
||||
LastCommandSuccess getLastLimitCommandSuccess();
|
||||
uint32_t getLastUpdateCommand();
|
||||
LastCommandSuccess getLastLimitCommandSuccess() const;
|
||||
uint32_t getLastUpdateCommand() const;
|
||||
void setLastUpdateCommand(const uint32_t lastUpdate);
|
||||
|
||||
void setLastLimitRequestSuccess(const LastCommandSuccess status);
|
||||
LastCommandSuccess getLastLimitRequestSuccess();
|
||||
uint32_t getLastUpdateRequest();
|
||||
LastCommandSuccess getLastLimitRequestSuccess() const;
|
||||
uint32_t getLastUpdateRequest() const;
|
||||
void setLastUpdateRequest(const uint32_t lastUpdate);
|
||||
|
||||
// Returns 1 based amount of expected bytes of data
|
||||
uint8_t getExpectedByteCount();
|
||||
uint8_t getExpectedByteCount() const;
|
||||
|
||||
private:
|
||||
uint8_t _payload[SYSTEM_CONFIG_PARA_SIZE];
|
||||
|
||||
@ -27,7 +27,7 @@ void TimeoutHelper::reset()
|
||||
startMillis = millis();
|
||||
}
|
||||
|
||||
bool TimeoutHelper::occured()
|
||||
bool TimeoutHelper::occured() const
|
||||
{
|
||||
return millis() > (startMillis + timeout);
|
||||
}
|
||||
@ -9,7 +9,7 @@ public:
|
||||
void set(const uint32_t ms);
|
||||
void extend(const uint32_t ms);
|
||||
void reset();
|
||||
bool occured();
|
||||
bool occured() const;
|
||||
|
||||
private:
|
||||
uint32_t startMillis;
|
||||
|
||||
@ -175,7 +175,7 @@ bool MqttSettingsClass::getConnected()
|
||||
return mqttClient->connected();
|
||||
}
|
||||
|
||||
String MqttSettingsClass::getPrefix()
|
||||
String MqttSettingsClass::getPrefix() const
|
||||
{
|
||||
return Configuration.get().Mqtt.Topic;
|
||||
}
|
||||
|
||||
@ -179,7 +179,7 @@ void NetworkSettingsClass::enableAdminMode()
|
||||
setupMode();
|
||||
}
|
||||
|
||||
String NetworkSettingsClass::getApName()
|
||||
String NetworkSettingsClass::getApName() const
|
||||
{
|
||||
return String(ACCESS_POINT_NAME + String(Utils::getChipId()));
|
||||
}
|
||||
@ -335,7 +335,7 @@ void NetworkSettingsClass::setStaticIp()
|
||||
}
|
||||
}
|
||||
|
||||
IPAddress NetworkSettingsClass::localIP()
|
||||
IPAddress NetworkSettingsClass::localIP() const
|
||||
{
|
||||
switch (_networkMode) {
|
||||
case network_mode::Ethernet:
|
||||
@ -349,7 +349,7 @@ IPAddress NetworkSettingsClass::localIP()
|
||||
}
|
||||
}
|
||||
|
||||
IPAddress NetworkSettingsClass::subnetMask()
|
||||
IPAddress NetworkSettingsClass::subnetMask() const
|
||||
{
|
||||
switch (_networkMode) {
|
||||
case network_mode::Ethernet:
|
||||
@ -363,7 +363,7 @@ IPAddress NetworkSettingsClass::subnetMask()
|
||||
}
|
||||
}
|
||||
|
||||
IPAddress NetworkSettingsClass::gatewayIP()
|
||||
IPAddress NetworkSettingsClass::gatewayIP() const
|
||||
{
|
||||
switch (_networkMode) {
|
||||
case network_mode::Ethernet:
|
||||
@ -377,7 +377,7 @@ IPAddress NetworkSettingsClass::gatewayIP()
|
||||
}
|
||||
}
|
||||
|
||||
IPAddress NetworkSettingsClass::dnsIP(const uint8_t dns_no)
|
||||
IPAddress NetworkSettingsClass::dnsIP(const uint8_t dns_no) const
|
||||
{
|
||||
switch (_networkMode) {
|
||||
case network_mode::Ethernet:
|
||||
@ -391,7 +391,7 @@ IPAddress NetworkSettingsClass::dnsIP(const uint8_t dns_no)
|
||||
}
|
||||
}
|
||||
|
||||
String NetworkSettingsClass::macAddress()
|
||||
String NetworkSettingsClass::macAddress() const
|
||||
{
|
||||
switch (_networkMode) {
|
||||
case network_mode::Ethernet:
|
||||
@ -444,12 +444,12 @@ String NetworkSettingsClass::getHostname()
|
||||
return resultHostname;
|
||||
}
|
||||
|
||||
bool NetworkSettingsClass::isConnected()
|
||||
bool NetworkSettingsClass::isConnected() const
|
||||
{
|
||||
return WiFi.localIP()[0] != 0 || ETH.localIP()[0] != 0;
|
||||
}
|
||||
|
||||
network_mode NetworkSettingsClass::NetworkMode()
|
||||
network_mode NetworkSettingsClass::NetworkMode() const
|
||||
{
|
||||
return _networkMode;
|
||||
}
|
||||
|
||||
@ -195,7 +195,7 @@ bool PinMappingClass::init(const String& deviceMapping)
|
||||
return false;
|
||||
}
|
||||
|
||||
bool PinMappingClass::isValidNrf24Config()
|
||||
bool PinMappingClass::isValidNrf24Config() const
|
||||
{
|
||||
return _pinMapping.nrf24_clk >= 0
|
||||
&& _pinMapping.nrf24_cs >= 0
|
||||
@ -205,7 +205,7 @@ bool PinMappingClass::isValidNrf24Config()
|
||||
&& _pinMapping.nrf24_mosi >= 0;
|
||||
}
|
||||
|
||||
bool PinMappingClass::isValidCmt2300Config()
|
||||
bool PinMappingClass::isValidCmt2300Config() const
|
||||
{
|
||||
return _pinMapping.cmt_clk >= 0
|
||||
&& _pinMapping.cmt_cs >= 0
|
||||
@ -213,7 +213,7 @@ bool PinMappingClass::isValidCmt2300Config()
|
||||
&& _pinMapping.cmt_sdio >= 0;
|
||||
}
|
||||
|
||||
bool PinMappingClass::isValidEthConfig()
|
||||
bool PinMappingClass::isValidEthConfig() const
|
||||
{
|
||||
return _pinMapping.eth_enabled;
|
||||
}
|
||||
@ -29,7 +29,7 @@ void SunPositionClass::loop()
|
||||
}
|
||||
}
|
||||
|
||||
bool SunPositionClass::isDayPeriod()
|
||||
bool SunPositionClass::isDayPeriod() const
|
||||
{
|
||||
if (!_isValidInfo) {
|
||||
return true;
|
||||
@ -41,7 +41,7 @@ bool SunPositionClass::isDayPeriod()
|
||||
return (minutesPastMidnight >= _sunriseMinutes) && (minutesPastMidnight < _sunsetMinutes);
|
||||
}
|
||||
|
||||
bool SunPositionClass::isSunsetAvailable()
|
||||
bool SunPositionClass::isSunsetAvailable() const
|
||||
{
|
||||
return _isSunsetAvailable;
|
||||
}
|
||||
@ -51,7 +51,7 @@ void SunPositionClass::setDoRecalc(const bool doRecalc)
|
||||
_doRecalc = doRecalc;
|
||||
}
|
||||
|
||||
bool SunPositionClass::checkRecalcDayChanged()
|
||||
bool SunPositionClass::checkRecalcDayChanged() const
|
||||
{
|
||||
time_t now;
|
||||
struct tm timeinfo;
|
||||
@ -124,7 +124,7 @@ void SunPositionClass::updateSunData()
|
||||
_isValidInfo = true;
|
||||
}
|
||||
|
||||
bool SunPositionClass::getSunTime(struct tm* info, const uint32_t offset)
|
||||
bool SunPositionClass::getSunTime(struct tm* info, const uint32_t offset) const
|
||||
{
|
||||
// Get today's date
|
||||
time_t aTime = time(NULL);
|
||||
@ -142,12 +142,12 @@ bool SunPositionClass::getSunTime(struct tm* info, const uint32_t offset)
|
||||
return _isValidInfo;
|
||||
}
|
||||
|
||||
bool SunPositionClass::sunsetTime(struct tm* info)
|
||||
bool SunPositionClass::sunsetTime(struct tm* info) const
|
||||
{
|
||||
return getSunTime(info, _sunsetMinutes);
|
||||
}
|
||||
|
||||
bool SunPositionClass::sunriseTime(struct tm* info)
|
||||
bool SunPositionClass::sunriseTime(struct tm* info) const
|
||||
{
|
||||
return getSunTime(info, _sunriseMinutes);
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user