From 8169e09d1e7a39e7021dfadfa51eec371083f39f Mon Sep 17 00:00:00 2001 From: technyon Date: Sun, 15 Jan 2023 12:37:39 +0100 Subject: [PATCH] remove unnecessare set_buffer_size --- NetworkLock.cpp | 3 +-- lib/pubsubclient/src/PubSubClient.cpp | 2 ++ networkDevices/W5500Device.cpp | 2 -- networkDevices/WifiDevice.cpp | 2 -- 4 files changed, 3 insertions(+), 6 deletions(-) diff --git a/NetworkLock.cpp b/NetworkLock.cpp index 4a6e996..ed80674 100644 --- a/NetworkLock.cpp +++ b/NetworkLock.cpp @@ -472,8 +472,7 @@ bool NetworkLock::comparePrefixedPath(const char *fullPath, const char *subPath) return strcmp(fullPath, prefixedPath) == 0; } -void -NetworkLock::publishHASSConfig(char *deviceType, const char *baseTopic, char *name, char *uidString, char *lockAction, +void NetworkLock::publishHASSConfig(char *deviceType, const char *baseTopic, char *name, char *uidString, char *lockAction, char *unlockAction, char *openAction, char *lockedState, char *unlockedState) { _network->publishHASSConfig(deviceType, baseTopic, name, uidString, lockAction, unlockAction, openAction, lockedState, unlockedState); diff --git a/lib/pubsubclient/src/PubSubClient.cpp b/lib/pubsubclient/src/PubSubClient.cpp index 2b48d2b..5c46df1 100755 --- a/lib/pubsubclient/src/PubSubClient.cpp +++ b/lib/pubsubclient/src/PubSubClient.cpp @@ -743,8 +743,10 @@ boolean PubSubClient::setBufferSize(uint16_t size) { return false; } if (this->bufferSize == 0) { + Serial.print("MALLOC: "); Serial.println(size); this->buffer = (uint8_t*)malloc(size); } else { + Serial.print("REALLOC: "); Serial.println(size); uint8_t* newBuffer = (uint8_t*)realloc(this->buffer, size); if (newBuffer != NULL) { this->buffer = newBuffer; diff --git a/networkDevices/W5500Device.cpp b/networkDevices/W5500Device.cpp index 5ce2361..18454a4 100644 --- a/networkDevices/W5500Device.cpp +++ b/networkDevices/W5500Device.cpp @@ -40,8 +40,6 @@ void W5500Device::initialize() Ethernet.init(ETHERNET_CS_PIN); _ethClient = new EthernetClient(); _mqttClient = new PubSubClient(*_ethClient); - _mqttClient->setBufferSize(_mqttMaxBufferSize); - if(_preferences->getBool(preference_mqtt_log_enabled)) { diff --git a/networkDevices/WifiDevice.cpp b/networkDevices/WifiDevice.cpp index 3b49bb4..d1075ca 100644 --- a/networkDevices/WifiDevice.cpp +++ b/networkDevices/WifiDevice.cpp @@ -98,8 +98,6 @@ void WifiDevice::initialize() onDisconnected(); }); } - - _mqttClient->setBufferSize(_mqttMaxBufferSize); } void WifiDevice::reconfigure()