Skip to content

Commit

Permalink
fix mqttlogger path
Browse files Browse the repository at this point in the history
  • Loading branch information
technyon committed Jun 7, 2023
1 parent f568051 commit aac4f90
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
3 changes: 2 additions & 1 deletion networkDevices/EthLan8720Device.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,8 @@ EthLan8720Device::EthLan8720Device(const String& hostname, Preferences* preferen
_path = new char[200];
memset(_path, 0, sizeof(_path));

String pathStr = preferences->getString(preference_mqtt_lock_path);
String pathStr = "/";
pathStr.concat(preferences->getString(preference_mqtt_lock_path));
pathStr.concat(mqtt_topic_log);
strcpy(_path, pathStr.c_str());
Log = new MqttLogger(this, _path, MqttLoggerMode::MqttAndSerial);
Expand Down
3 changes: 2 additions & 1 deletion networkDevices/W5500Device.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,8 @@ void W5500Device::initialize()

if(_preferences->getBool(preference_mqtt_log_enabled))
{
String pathStr = _preferences->getString(preference_mqtt_lock_path);
String pathStr = "/";
pathStr.concat(_preferences->getString(preference_mqtt_lock_path));
pathStr.concat(mqtt_topic_log);
_path = new char[pathStr.length() + 1];
memset(_path, 0, sizeof(_path));
Expand Down
3 changes: 2 additions & 1 deletion networkDevices/WifiDevice.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,8 @@ WifiDevice::WifiDevice(const String& hostname, Preferences* _preferences, const
_path = new char[200];
memset(_path, 0, sizeof(_path));

String pathStr = _preferences->getString(preference_mqtt_lock_path);
String pathStr = "/";
pathStr.concat(_preferences->getString(preference_mqtt_lock_path));
pathStr.concat(mqtt_topic_log);
strcpy(_path, pathStr.c_str());
Log = new MqttLogger(this, _path, MqttLoggerMode::MqttAndSerial);
Expand Down

0 comments on commit aac4f90

Please sign in to comment.