mirror of
https://github.com/meshtastic/firmware.git
synced 2025-02-02 10:50:40 +00:00
possible fix for stuck MQTT handler.
This commit is contained in:
parent
c1381b9ebd
commit
ea87193c8f
@ -253,7 +253,7 @@ void MQTT::onSend(const MeshPacket &mp, ChannelIndex chIndex)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// converts a downstream packet into a json message
|
// converts a downstream packet into a json message
|
||||||
String MQTT::downstreamPacketToJson(MeshPacket *mp)
|
std::string MQTT::downstreamPacketToJson(MeshPacket *mp)
|
||||||
{
|
{
|
||||||
using namespace json11;
|
using namespace json11;
|
||||||
|
|
||||||
@ -398,8 +398,8 @@ String MQTT::downstreamPacketToJson(MeshPacket *mp)
|
|||||||
};
|
};
|
||||||
|
|
||||||
// serialize and return it
|
// 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());
|
DEBUG_MSG("serialized json message: %s\n", jsonStr.c_str());
|
||||||
|
|
||||||
return jsonStr.c_str();
|
return jsonStr;
|
||||||
}
|
}
|
||||||
|
@ -58,7 +58,7 @@ class MQTT : private concurrency::OSThread
|
|||||||
void onPublish(char *topic, byte *payload, unsigned int length);
|
void onPublish(char *topic, byte *payload, unsigned int length);
|
||||||
|
|
||||||
/// Called when a new publish arrives from the MQTT server
|
/// 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
|
/// 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; }
|
// int preflightSleepCb(void *unused = NULL) { return pubSub.connected() ? 1 : 0; }
|
||||||
|
Loading…
Reference in New Issue
Block a user