possible fix for stuck MQTT handler.

pull/1822/head
Thomas Göttgens 2022-10-18 21:51:40 +02:00
rodzic c1381b9ebd
commit ea87193c8f
2 zmienionych plików z 4 dodań i 4 usunięć

Wyświetl plik

@ -253,7 +253,7 @@ void MQTT::onSend(const MeshPacket &mp, ChannelIndex chIndex)
}
// converts a downstream packet into a json message
String MQTT::downstreamPacketToJson(MeshPacket *mp)
std::string MQTT::downstreamPacketToJson(MeshPacket *mp)
{
using namespace json11;
@ -398,8 +398,8 @@ String MQTT::downstreamPacketToJson(MeshPacket *mp)
};
// serialize and return it
static std::string jsonStr = jsonObj.dump();
std::string jsonStr = jsonObj.dump();
DEBUG_MSG("serialized json message: %s\n", jsonStr.c_str());
return jsonStr.c_str();
return jsonStr;
}

Wyświetl plik

@ -58,7 +58,7 @@ class MQTT : private concurrency::OSThread
void onPublish(char *topic, byte *payload, unsigned int length);
/// Called when a new publish arrives from the MQTT server
String downstreamPacketToJson(MeshPacket *mp);
std::string downstreamPacketToJson(MeshPacket *mp);
/// Return 0 if sleep is okay, veto sleep if we are connected to pubsub server
// int preflightSleepCb(void *unused = NULL) { return pubSub.connected() ? 1 : 0; }