1919#include < WiFi.h>
2020#endif
2121#include " Default.h"
22+ #if !defined(ARCH_NRF52) || NRF52_USE_JSON
2223#include " serialization/JSON.h"
2324#include " serialization/MeshPacketSerializer.h"
25+ #endif
2426#include < Throttle.h>
2527#include < assert.h>
2628#include < pb_decode.h>
@@ -119,6 +121,7 @@ inline void onReceiveProto(char *topic, byte *payload, size_t length)
119121 router->enqueueReceivedMessage (p.release ());
120122}
121123
124+ #if !defined(ARCH_NRF52) || NRF52_USE_JSON
122125// returns true if this is a valid JSON envelope which we accept on downlink
123126inline bool isValidJsonEnvelope (JSONObject &json)
124127{
@@ -204,6 +207,7 @@ inline void onReceiveJson(byte *payload, size_t length)
204207 LOG_DEBUG (" JSON ignore downlink message with unsupported type" );
205208 }
206209}
210+ #endif
207211
208212// / Determines if the given IPAddress is a private IPv4 address, i.e. not routable on the public internet.
209213bool isPrivateIpAddress (const IPAddress &ip)
@@ -258,6 +262,7 @@ void MQTT::onReceive(char *topic, byte *payload, size_t length)
258262
259263 // check if this is a json payload message by comparing the topic start
260264 if (moduleConfig.mqtt .json_enabled && (strncmp (topic, jsonTopic.c_str (), jsonTopic.length ()) == 0 )) {
265+ #if !defined(ARCH_NRF52) || NRF52_USE_JSON
261266 // parse the channel name from the topic string
262267 // the topic has been checked above for having jsonTopic prefix, so just move past it
263268 char *channelName = topic + jsonTopic.length ();
@@ -271,6 +276,7 @@ void MQTT::onReceive(char *topic, byte *payload, size_t length)
271276 return ;
272277 }
273278 onReceiveJson (payload, length);
279+ #endif
274280 return ;
275281 }
276282
@@ -754,4 +760,4 @@ void MQTT::perhapsReportToMap()
754760
755761 // Update the last report time
756762 last_report_to_map = millis ();
757- }
763+ }
0 commit comments