MqttClient can subscribe and receive publishes from distant broker

This commit is contained in:
hsaturn
2021-03-24 01:30:56 +01:00
parent 7b20e7deb5
commit 4020393f90
2 changed files with 70 additions and 12 deletions

View File

@@ -154,15 +154,21 @@ class MqttClient
#ifdef TINY_MQTT_DEBUG
void dump()
{
uint32_t ms=millis();
Serial << "MqttClient (" << clientId.c_str() << ") p=" << (int32_t) parent
<< " c=" << (int32_t)client << (connected() ? " ON " : " OFF");
Serial << ", alive=" << (uint32_t)alive << '/' << ms << ", ka=" << keep_alive;
Serial << " cnx " << (client && client->connected());
Serial << " [";
message.hexdump("entrant msg");
bool c=false;
for(auto s: subscriptions)
{
Serial << (c?", ": "")<< s.str().c_str();
c=true;
}
Serial << "]" << endl;
}
#endif