Merge pull request #161 from lora-aprs/peterus-patch-1

Update TaskMQTT.cpp
This commit is contained in:
Peter Buchegger 2022-02-24 16:54:34 +01:00 committed by GitHub
commit 1b3c5c0cb7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -30,13 +30,13 @@ bool MQTTTask::loop(System &system) {
std::shared_ptr<APRSMessage> msg = _toMQTT.getElement();
DynamicJsonDocument data(1024);
data["Source"] = msg->getSource();
data["Destination"] = msg->getDestination();
data["Path"] = msg->getPath();
data["Type"] = msg->getType().toString();
data["source"] = msg->getSource();
data["destination"] = msg->getDestination();
data["path"] = msg->getPath();
data["type"] = msg->getType().toString();
String body = msg->getBody()->encode();
body.replace("\n", "");
data["Data"] = body;
data["data"] = body;
String r;
serializeJson(data, r);