Code hardening: introduce const keyword

This commit is contained in:
Thomas Basler
2022-09-05 21:41:45 +02:00
parent 83ca402306
commit 31e56f6c2b
12 changed files with 22 additions and 22 deletions

View File

@@ -29,7 +29,7 @@ void WebApiMqttClass::onMqttStatus(AsyncWebServerRequest* request)
{
AsyncJsonResponse* response = new AsyncJsonResponse(false, MQTT_JSON_DOC_SIZE);
JsonObject root = response->getRoot();
CONFIG_T& config = Configuration.get();
const CONFIG_T& config = Configuration.get();
root[F("mqtt_enabled")] = config.Mqtt_Enabled;
root[F("mqtt_hostname")] = config.Mqtt_Hostname;
@@ -56,7 +56,7 @@ void WebApiMqttClass::onMqttAdminGet(AsyncWebServerRequest* request)
{
AsyncJsonResponse* response = new AsyncJsonResponse(false, MQTT_JSON_DOC_SIZE);
JsonObject root = response->getRoot();
CONFIG_T& config = Configuration.get();
const CONFIG_T& config = Configuration.get();
root[F("mqtt_enabled")] = config.Mqtt_Enabled;
root[F("mqtt_hostname")] = config.Mqtt_Hostname;
@@ -267,7 +267,7 @@ void WebApiMqttClass::onMqttAdminPost(AsyncWebServerRequest* request)
MqttHassPublishing.forceUpdate();
}
String WebApiMqttClass::getRootCaCertInfo(char* cert)
String WebApiMqttClass::getRootCaCertInfo(const char* cert)
{
char rootCaCertInfo[1024] = "";