Skip to content

Commit

Permalink
release: 3.4.9
Browse files Browse the repository at this point in the history
  • Loading branch information
ewasjon committed May 3, 2024
1 parent d6bda15 commit cd06909
Show file tree
Hide file tree
Showing 16 changed files with 798 additions and 339 deletions.
11 changes: 10 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
# Changelog

## [3.4.9] 2024-05-03
- Added a few options to controll how SPARTN messages are generated:
- `--sf055-default` to set the default value for the ionospheric quality if not available.
- `--sf042-override` to force the tropospheric quality to a specific value (previous `--ura-override` was also used for this).
- `--sf042-default` to set the default value for the tropospheric quality if not available.
- `--filter-by-ocb` to filter out ionopsheric residuals for satellites not in the OCB.
- `--ignore-l2l` to ignore L2L biases.
- Fixed a bug where parsing NMEA GGA would fail if age of corrections was not provided.

## [3.4.8] 2024-04-26
- Added support for age of correction when using NMEA.

Expand All @@ -9,7 +18,7 @@
- Added new format option `lrf-uper` to output RTCM framed UPER encoded 3GPP LPP messages.
- Updated 3GPP LPP version from Release 16.4.0 to Release 18.1.0.
- HA-GNSS-Metrics data is now included in the `ProvideLocationInformation` message.
- Fix memory leak from ProvideLocationInformation.
- Fixed memory leak from ProvideLocationInformation.

## [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.
Expand Down
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ find_package(OpenSSL REQUIRED)
endif (USE_OPENSSL)

add_definitions(-D_POSIX_C_SOURCE=200809L)
add_definitions(-DCLIENT_VERSION="3.4.8")
add_definitions(-DCLIENT_VERSION_INT=0x030408)
add_definitions(-DCLIENT_VERSION="3.4.9")
add_definitions(-DCLIENT_VERSION_INT=0x030409)

if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
add_definitions(-DCOMPILER_CANNOT_DEDUCE_UNREACHABLE=1)
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# SUPL 3GPP LPP client

![version](https://img.shields.io/badge/version-3.4.8-green)
![version](https://img.shields.io/badge/version-3.4.9-green)
![license](https://img.shields.io/badge/license-MXM-blue)

This project is a set of libraries, examples and tools to facilitate the development of 3GPP LPP clients.
Expand Down
85 changes: 77 additions & 8 deletions examples/lpp/ssr_example.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,12 @@ static bool gForceIodeContinuity;
static bool gAverageZenithDelay;
static bool gEnableIodeShift;
static int gSf055Override;
static int gSf055Default;
static int gSf042Override;
static int gSf042Default;
static bool gIncreasingSiou;
static bool gFilterByOcb;
static bool gIgnoreL2L;
static bool gPrintRtcm;
static Options gOptions;
static ControlParser gControlParser;
Expand All @@ -57,7 +62,9 @@ static void assistance_data_callback(LPP_Client*, LPP_Transaction*, LPP_Message*
[[noreturn]] void execute(Options options, ssr_example::Format format, int ura_override,
bool ublox_clock_correction, bool force_continuity,
bool average_zenith_delay, bool enable_iode_shift, int sf055_override,
bool increasing_siou, bool print_rtcm) {
int sf055_default, int sf042_override, int sf042_default,
bool increasing_siou, bool filter_by_ocb, bool ignore_l2l,
bool print_rtcm) {
gOptions = std::move(options);
gFormat = format;
gUraOverride = ura_override;
Expand All @@ -66,7 +73,12 @@ static void assistance_data_callback(LPP_Client*, LPP_Transaction*, LPP_Message*
gAverageZenithDelay = average_zenith_delay;
gEnableIodeShift = enable_iode_shift;
gSf055Override = sf055_override;
gSf055Default = sf055_default;
gSf042Override = sf042_override;
gSf042Default = sf042_default;
gIncreasingSiou = increasing_siou;
gFilterByOcb = filter_by_ocb;
gIgnoreL2L = ignore_l2l;
gPrintRtcm = print_rtcm;

auto& cell_options = gOptions.cell_options;
Expand Down Expand Up @@ -159,12 +171,15 @@ static void assistance_data_callback(LPP_Client*, LPP_Transaction*, LPP_Message*
} else {
gSpartnGeneratorNew.set_iode_shift(false);
}
if (gSf055Override >= 0) {
gSpartnGeneratorNew.set_ionosphere_quality_override(gSf055Override);
}
if (gIncreasingSiou) {
gSpartnGeneratorNew.set_increasing_siou(true);
}
if (gSf055Override >= 0) gSpartnGeneratorNew.set_sf055_override(gSf055Override);
if (gSf055Default >= 0) gSpartnGeneratorNew.set_sf055_default(gSf055Default);
if (gSf042Override >= 0) gSpartnGeneratorNew.set_sf042_override(gSf042Override);
if (gSf042Default >= 0) gSpartnGeneratorNew.set_sf042_default(gSf042Default);

if (gIncreasingSiou) gSpartnGeneratorNew.set_increasing_siou(true);
if (gFilterByOcb) gSpartnGeneratorNew.set_filter_by_ocb(true);
if (gIgnoreL2L) gSpartnGeneratorNew.set_ignore_l2l(true);

#endif

LPP_Client client{false /* experimental segmentation support */};
Expand Down Expand Up @@ -405,7 +420,12 @@ void SsrCommand::parse(args::Subparser& parser) {
delete mAverageZenithDelayArg;
delete mEnableIodeShift;
delete mSf055Override;
delete mSf055Default;
delete mSf042Override;
delete mSf042Default;
delete mIncreasingSiou;
delete mFilterByOcb;
delete mIgnoreL2L;
delete mPrintRTCMArg;

mFormatArg = new args::ValueFlag<std::string>(parser, "format", "Format of the output",
Expand Down Expand Up @@ -452,10 +472,27 @@ void SsrCommand::parse(args::Subparser& parser) {
"Override the SF055 value, value will be clamped between 0-15. "
"Where 0 indicates that the value is invalid.",
{"sf055-override"}, args::Options::Single);
mSf055Default =
new args::ValueFlag<int>(parser, "sf055-default",
"Set the default SF055 value, value will be clamped between 0-15. "
"Where 0 indicates that the value is invalid.",
{"sf055-default"}, args::Options::Single);

mSf042Override = new args::ValueFlag<int>(
parser, "sf042-override", "Override the SF042 value, value will be clamped between 0-7.",
{"sf042-override"}, args::Options::Single);
mSf042Default = new args::ValueFlag<int>(
parser, "sf042-default", "Set the default SF042 value, value will be clamped between 0-7.",
{"sf042-default"}, args::Options::Single);

mIncreasingSiou =
new args::Flag(parser, "increasing-siou", "Enable the increasing SIoU feature for SPARTN",
{"increasing-siou"});
mFilterByOcb = new args::Flag(
parser, "filter-by-ocb",
"Only include ionospheric residual satellites that also have OCB corrections",
{"filter-by-ocb"});
mIgnoreL2L = new args::Flag(parser, "ignore-l2l", "Ignore L2L biases", {"ignore-l2l"});

mPrintRTCMArg =
new args::Flag(parser, "print_rtcm", "Print RTCM messages info (only used for LRF-UPER)",
Expand Down Expand Up @@ -522,18 +559,50 @@ void SsrCommand::execute(Options options) {
if (sf055_override > 15) sf055_override = 15;
}

auto sf055_default = -1;
if (*mSf055Default) {
sf055_default = mSf055Default->Get();
if (sf055_default < 0) sf055_default = 0;
if (sf055_default > 15) sf055_default = 15;
}

auto sf042_override = -1;
if (*mSf042Override) {
sf042_override = mSf042Override->Get();
if (sf042_override < 0) sf042_override = 0;
if (sf042_override > 7) sf042_override = 7;
}

auto sf042_default = -1;
if (*mSf042Default) {
sf042_default = mSf042Default->Get();
if (sf042_default < 0) sf042_default = 0;
if (sf042_default > 7) sf042_default = 7;
}

auto increasing_siou = false;
if (*mIncreasingSiou) {
increasing_siou = mIncreasingSiou->Get();
}

auto filter_by_ocb = false;
if (*mFilterByOcb) {
filter_by_ocb = mFilterByOcb->Get();
}

auto ignore_l2l = false;
if (*mIgnoreL2L) {
ignore_l2l = mIgnoreL2L->Get();
}

auto print_rtcm = false;
if (*mPrintRTCMArg) {
print_rtcm = true;
}

::execute(std::move(options), format, ura_override, ublox_clock_correction, force_continuity,
average_zenith_delay, iode_shift, sf055_override, increasing_siou, print_rtcm);
average_zenith_delay, iode_shift, sf055_override, sf055_default, sf042_override,
sf042_default, increasing_siou, filter_by_ocb, ignore_l2l, print_rtcm);
}

} // namespace ssr_example
14 changes: 13 additions & 1 deletion examples/lpp/ssr_example.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@ class SsrCommand final : public Command {
: Command("ssr", "Request State-space Representation (SSR) data from the location server"),
mFormatArg(nullptr), mUraOverrideArg(nullptr), mUbloxClockCorrectionArg(nullptr),
mForceContinuityArg(nullptr), mAverageZenithDelayArg(nullptr), mEnableIodeShift(nullptr),
mSf055Override(nullptr), mIncreasingSiou(nullptr), mPrintRTCMArg(nullptr) {}
mSf055Override(nullptr), mSf055Default(nullptr), mSf042Override(nullptr),
mSf042Default(nullptr), mIncreasingSiou(nullptr), mFilterByOcb(nullptr),
mIgnoreL2L(nullptr), mPrintRTCMArg(nullptr) {}

~SsrCommand() override {
delete mFormatArg;
Expand All @@ -33,7 +35,12 @@ class SsrCommand final : public Command {
delete mAverageZenithDelayArg;
delete mEnableIodeShift;
delete mSf055Override;
delete mSf055Default;
delete mSf042Override;
delete mSf042Default;
delete mIncreasingSiou;
delete mFilterByOcb;
delete mIgnoreL2L;
delete mPrintRTCMArg;
}

Expand All @@ -48,7 +55,12 @@ class SsrCommand final : public Command {
args::Flag* mAverageZenithDelayArg;
args::Flag* mEnableIodeShift;
args::ValueFlag<int>* mSf055Override;
args::ValueFlag<int>* mSf055Default;
args::ValueFlag<int>* mSf042Override;
args::ValueFlag<int>* mSf042Default;
args::Flag* mIncreasingSiou;
args::Flag* mFilterByOcb;
args::Flag* mIgnoreL2L;
args::Flag* mPrintRTCMArg;
};

Expand Down
2 changes: 1 addition & 1 deletion generator/spartn2/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ target_link_libraries(generator_spartn2 PRIVATE asn1::generated::lpp asn1::helpe
target_link_libraries(generator_spartn2 PRIVATE utility)

if (SPARTN_DEBUG_PRINT)
target_compile_definitions(generator_spartn2 PRIVATE SPARTN_DEBUG_PRINT)
target_compile_definitions(generator_spartn2 PRIVATE SPARTN_DEBUG_PRINT=2)
endif (SPARTN_DEBUG_PRINT)

setup_target(generator_spartn2)
3 changes: 2 additions & 1 deletion generator/spartn2/builder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,14 @@

Builder::Builder(uint32_t capacity) : mData(capacity), mBitOffset(0) {}

void Builder::double_to_bits(double min_range, double max_range, double resolution, double value,
double Builder::double_to_bits(double min_range, double max_range, double resolution, double value,
uint8_t bits) {
auto clamped_value = std::max(min_range, std::min(max_range, value));
auto scaled_value = (clamped_value - min_range) / resolution;
auto rounded_value = std::lround(scaled_value);
auto unsigned_value = static_cast<uint64_t>(rounded_value);
this->bits(unsigned_value, bits);
return rounded_value * resolution + min_range;
}

void Builder::reserve(uint32_t bits) {
Expand Down
2 changes: 1 addition & 1 deletion generator/spartn2/builder.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class Builder {

inline void b(bool value) { bits(static_cast<uint64_t>(value), 1); }

void double_to_bits(double min_range, double max_range, double resolution, double value,
double double_to_bits(double min_range, double max_range, double resolution, double value,
uint8_t bits);

// TODO: float, double
Expand Down
Loading

0 comments on commit cd06909

Please sign in to comment.