knolleary / pubsubclient

A client library for the Arduino Ethernet Shield that provides support for MQTT.
http://pubsubclient.knolleary.net/
MIT License
3.78k stars 1.46k forks source link

"MQTT_MAX_PACKET_SIZE" problem #972

Open savagerex opened 1 year ago

savagerex commented 1 year ago

if i chage "MQTT_MAX_PACKET_SIZE" from 256 to 72000.

how to modified this function (as below)???

boolean PubSubClient::setBufferSize(uint16_t size) { if (size == 0) { // Cannot set it back to 0 return false; } if (this->bufferSize == 0) { this->buffer = (uint8_t)malloc(size); } else { uint8_t newBuffer = (uint8_t*)realloc(this->buffer, size); if (newBuffer != NULL) { this->buffer = newBuffer; } else { return false; } } this->bufferSize = size; return (this->buffer != NULL); }

simogaspa84 commented 1 year ago

Hi @savagerex .. I have the same issue.. I would like to understand if it is possible to increase the packet size chaning the lib.. Did you get any results?