diff options
author | Mykyta Dorokhin <mykyta.dorokhin@globallogic.com> | 2021-03-07 00:15:59 +0200 |
---|---|---|
committer | Mykyta Dorokhin <mykyta.dorokhin@globallogic.com> | 2021-03-07 00:15:59 +0200 |
commit | 08fb28a8ed9dddc90af27e60d58e21ba6f282425 (patch) | |
tree | 73fdf3f6ab42e58cc2f2bd1ba604564f8e0c78f5 | |
parent | 89f84b81da3b94e9b099debbe63b87b85e5697b6 (diff) | |
download | libmts-io-08fb28a8ed9dddc90af27e60d58e21ba6f282425.tar.gz libmts-io-08fb28a8ed9dddc90af27e60d58e21ba6f282425.tar.bz2 libmts-io-08fb28a8ed9dddc90af27e60d58e21ba6f282425.zip |
Allow building agains jsoncpp 1.9.2
-rw-r--r-- | src/MTS_IO_ME910C1WWRadio.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
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 |