Add const keyword to methods

This commit is contained in:
Thomas Basler
2023-12-12 01:30:40 +01:00
parent d6494fa791
commit 8fb43fedf8
76 changed files with 259 additions and 259 deletions

View File

@@ -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);

View File

@@ -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);

View File

@@ -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;

View File

@@ -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;