From 08fb28a8ed9dddc90af27e60d58e21ba6f282425 Mon Sep 17 00:00:00 2001 From: Mykyta Dorokhin Date: Sun, 7 Mar 2021 00:15:59 +0200 Subject: Allow building agains jsoncpp 1.9.2 --- src/MTS_IO_ME910C1WWRadio.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/MTS_IO_ME910C1WWRadio.cpp b/src/MTS_IO_ME910C1WWRadio.cpp index 32c64b3..80c2320 100644 --- a/src/MTS_IO_ME910C1WWRadio.cpp +++ b/src/MTS_IO_ME910C1WWRadio.cpp @@ -173,12 +173,21 @@ ICellularRadio::CODE ME910C1WWRadio::doFumoReadConfig(const Json::Value& jArgs, file.read(&buffer[0], size); file.close(); +#if defined(JSONCPP_VERSION_HEXA) && (JSONCPP_VERSION_HEXA > 0x010600) // > 1.6.0 + Json::CharReaderBuilder builder; + std::istringstream ss(buffer); + if (!Json::parseFromStream(builder, ss, &jConfig, NULL)) { + printError("Error parsing FOTA configuration file"); + break; + } +#else Json::Features features = Json::Features::strictMode(); Json::Reader reader(features); if (!reader.parse(buffer, jConfig)) { printError("Error parsing FOTA configuration file"); break; } +#endif // // set default values if missing -- cgit v1.2.3