diff --git a/CHANGELOG.md b/CHANGELOG.md index 4764aa67..7cca702a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,7 +1,8 @@ # Changelog -## [3.4.*] +## [3.4.6] 2024-04-04 - You can optionally include/exclude which generators to build by using the CMake options `-DINCLUDE_GENERATOR_*`. By default, RTCM and SPARTN generators are included and the old SPARTN generator is excluded. +- Added support for control commands in the `example-lpp` when using `osr`, this was previously only available in when using `ssr`. ## [3.4.5] 2024-04-02 - SPARTN generator will not use provided URA epoch-time. This caused issues where only the URA timestamp would be used and because it isn't update vary frequently the corrections data would not be used. diff --git a/CMakeLists.txt b/CMakeLists.txt index 73d5324a..554a74d2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -36,8 +36,8 @@ find_package(OpenSSL REQUIRED) endif (USE_OPENSSL) add_definitions(-D_POSIX_C_SOURCE=200809L) -add_definitions(-DCLIENT_VERSION="3.4.5") -add_definitions(-DCLIENT_VERSION_INT=0x030405) +add_definitions(-DCLIENT_VERSION="3.4.6") +add_definitions(-DCLIENT_VERSION_INT=0x030406) if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU") add_definitions(-DCOMPILER_CANNOT_DEDUCE_UNREACHABLE=1) diff --git a/examples/lpp/osr_example.cpp b/examples/lpp/osr_example.cpp index 379fe4de..daaebf71 100644 --- a/examples/lpp/osr_example.cpp +++ b/examples/lpp/osr_example.cpp @@ -6,6 +6,8 @@ #include #include #include + +#include "control.hpp" #include "location_information.h" #ifdef INCLUDE_GENERATOR_RTCM @@ -22,6 +24,7 @@ static osr_example::Format gFormat; static generator::rtcm::MessageFilter gFilter; static Options gOptions; static bool gPrintRtcm; +static ControlParser gControlParser; static std::unique_ptr gModem; static std::unique_ptr gUbloxReceiver; @@ -43,6 +46,7 @@ static void assistance_data_callback(LPP_Client*, LPP_Transaction*, LPP_Message* auto& ublox_options = gOptions.ublox_options; auto& nmea_options = gOptions.nmea_options; auto& location_information_options = gOptions.location_information_options; + auto& control_options = gOptions.control_options; gConvertConfidence95To39 = location_information_options.convert_confidence_95_to_39; gOverrideHorizontalConfidence = location_information_options.override_horizontal_confidence; @@ -221,12 +225,28 @@ static void assistance_data_callback(LPP_Client*, LPP_Transaction*, LPP_Message* throw std::runtime_error("Unable to request assistance data"); } + if (control_options.interface) { + printf("[control]\n"); + control_options.interface->open(); + control_options.interface->print_info(); + + gControlParser.on_cid = [&](CellID cell) { + printf("[control] cell: %ld:%ld:%ld:%llu\n", cell.mcc, cell.mnc, cell.tac, cell.cell); + gCell = cell; + client.update_assistance_data(request, gCell); + }; + } + for (;;) { struct timespec timeout; timeout.tv_sec = 0; timeout.tv_nsec = 1000000 * 100; // 100 ms nanosleep(&timeout, nullptr); + if (control_options.interface) { + gControlParser.parse(control_options.interface); + } + // client.process() MUST be called at least once every second, otherwise // ProvideLocationInformation messages will not be send to the server. if (!client.process()) {