Update TaskMQTT.cpp

This commit is contained in:
Peter Buchegger 2022-02-24 16:52:52 +01:00 committed by GitHub
parent 4f0b843cf6
commit fb806206ac
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(); std::shared_ptr<APRSMessage> msg = _toMQTT.getElement();
DynamicJsonDocument data(1024); DynamicJsonDocument data(1024);
data["Source"] = msg->getSource(); data["source"] = msg->getSource();
data["Destination"] = msg->getDestination(); data["destination"] = msg->getDestination();
data["Path"] = msg->getPath(); data["path"] = msg->getPath();
data["Type"] = msg->getType().toString(); data["type"] = msg->getType().toString();
String body = msg->getBody()->encode(); String body = msg->getBody()->encode();
body.replace("\n", ""); body.replace("\n", "");
data["Data"] = body; data["data"] = body;
String r; String r;
serializeJson(data, r); serializeJson(data, r);