Speed and stability improved
This commit is contained in:
@@ -311,6 +311,12 @@ using ClientFunction = void(*)(std::string& cmd, MqttClient* publish);
|
||||
|
||||
void loop()
|
||||
{
|
||||
static long count;
|
||||
if (MqttClient::counter != count)
|
||||
{
|
||||
Serial << "# " << MqttClient::counter << endl;
|
||||
count = MqttClient::counter;
|
||||
}
|
||||
for(auto it: brokers)
|
||||
it.second->loop();
|
||||
|
||||
|
||||
@@ -522,9 +522,16 @@ void MqttMessage::incoming(char in_byte)
|
||||
vheader = buffer.length();
|
||||
if (size==0)
|
||||
state = Complete;
|
||||
else if (size > 500) // TODO magic
|
||||
{
|
||||
state = Error;
|
||||
}
|
||||
else
|
||||
{
|
||||
buffer.reserve(size);
|
||||
state = VariableHeader;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case VariableHeader:
|
||||
case PayLoad:
|
||||
|
||||
Reference in New Issue
Block a user