Skip to content

Commit

Permalink
v3.4.0 (#12)
Browse files Browse the repository at this point in the history
* v3.4.0
  • Loading branch information
ewasjon authored Jan 26, 2024
1 parent 551398e commit c2271d4
Show file tree
Hide file tree
Showing 127 changed files with 11,600 additions and 861 deletions.
28 changes: 28 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Changelog

## [3.4.0]
- Support for receivers that communicate using NMEA protocol has been added. The following sentences are now supported:
- GGA
- GST
- VTG
- Added a new example has been added to demonstrate how to use the NMEA receiver.
- Added a command-line argument `--print-receiver-messages` (or `--prm`) to print all received messages to the standard output. This option is valid for any receiver (NMEA or u-Blox).
- Fixed a bug related to ASN.1 BIT STRING encoding. The MSB and LSB were swapped. This should not affect OSR or SSR assistance data request.
- Fixed a bug where the SUPL identity was not properly encoded when using IMSI and MSISDN. A value for ABCD was encoded as BADC. The fix is only active when the argument `--supl-identity-fix` is passed.
- Added way to send a "fake" location has been added with the command-line arguments `--location-info`, `--latitude`, `--longitude`, and `--altitude`. There is also an option to always send location information, even if the location server does not request it. This is done with the command-line argument `--force-location-info`.
- Added a option (`--rtcm-print`) to disable printing the "RTCM: XXXX bytes | " lines when using OSR and RTCM generation has been added.
- Added two SPARTN generators:
- `spartn` - The original SPARTN generator.
- `spartn2` - A new SPARTN generator that is based on the original SPARTN generator. It's recommended to use this generator instead of the original SPARTN generator.
- Added support to output ASN.1 UPER encoded 3GPP LPP ProvideAssistanceData messages from the `example_lpp`.
- Moved `build-with-gcc4.8.sh` to `docker/verify-with-gcc4.8.sh` and removed the use of `sudo` in the script.
- Changed to use `TAI_Time` instead of `time_t` to represent estimation time in the `LocationInformation` structure.
- `provide_location_information_callback_ublox` now sets the `location_info->time` field to the time received from the receiver instead of the current time.
- Fixed a bug where `--ublox-serial-data-bits` was used instead of `--serial-data-bits` for the output serial configuration.
- Fixed command-line argument `--version` (or `-v`) to _actually_ print the version.
- Added a new example `example_lpp2spartn` to demonstrate how to convert LPP to SPARTN. It takes ASN.1 UPER messages from STDIN and converts them to SPARTN messages.
- Added a new example `example_ntrip` which can be used to connect to an NTRIP caster and receiver RTCM messages.
- Added a new interface `stdin` that can be used to read data from STDIN.
- `ProvideLocationInformation` now uses MeasurementReferenceTime to provide a precise time estimate with a 250ns resolution.
- Fixed a bug where UBX messages would be missed due to the way we were reading from the interface.
- Fixed a bug where the bitfields in UBX-NAV-PVT were not properly right-shifted down to the LSB. `diff_soln` would report `0b00` or `0b10` instead of `0b0` or `0b1`.
11 changes: 11 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ option(USE_ASAN "USE_ASAN" OFF)
option(ASN_DEBUG "ASN_DEBUG" OFF)
option(INTERFACE_FD_DEBUG "Print FD debug information" OFF)
option(RECEIVER_UBLOX_THREADED "Print Receiver u-blox (threaded) debug information" OFF)
option(SPARTN_DEBUG_PRINT "Print SPARTN debug information" OFF)
option(RECEIVER_NMEA_DEBUG "Print Receiver NMEA debug information" OFF)

option (FORCE_COLORED_OUTPUT "Always produce ANSI-colored output (GNU/Clang only)." TRUE)
if (FORCE_COLORED_OUTPUT)
Expand All @@ -25,6 +27,9 @@ if (USE_OPENSSL)
find_package(OpenSSL REQUIRED)
endif (USE_OPENSSL)

add_definitions(-D_POSIX_C_SOURCE=200809L)
add_definitions(-DCLIENT_VERSION="3.4.0")

if(${ASN_DEBUG})
add_definitions(-DASN_EMIT_DEBUG=1)
endif(${ASN_DEBUG})
Expand All @@ -37,7 +42,13 @@ add_subdirectory("libs")
add_subdirectory("interface")
add_subdirectory("asn.1")
add_subdirectory("generator/rtcm")
add_subdirectory("generator/spartn")
add_subdirectory("generator/spartn2")
add_subdirectory("receiver/ublox")
add_subdirectory("receiver/nmea")
add_subdirectory("examples/ublox")
add_subdirectory("examples/nmea")
add_subdirectory("examples/lpp")
add_subdirectory("examples/lpp2spartn")
add_subdirectory("examples/ntrip")

57 changes: 31 additions & 26 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,43 +1,48 @@
# SUPL-3GPP-LPP-client
# SUPL 3GPP LPP client

SUPL-3GPP-LPP-client is an example client for that connects to a location server using SUPL and requests assistance data using 3GPP LPP (Release 16.4). The code contains libraries for building a custom client for your specific needs. The example client is written in C++ and is designed to be portable and easy to use. It should be sufficient to get started or use as a simple client for testing.
![version](https://img.shields.io/badge/version-3.4.0-green)
![license](https://img.shields.io/badge/license-MXM-blue)

The source code for the ASN.1 definitions from 3GPP LPP Release 16.4 are generated by ASN.1 C (https://github.com/vlm/asn1c). All other code is in C++ and should be portable to must unix-like systems. The example client is tested on Ubuntu 20.04 and Raspberry PI OS (32-bit) with gcc-4.8.
This project is a set of libraries, examples and tools to facilitate the development of 3GPP LPP clients.

---
## Libraries
* 3GPP LPP client - A library that can be used to communicate with a SUPL server and request assistance data.
* RTCM converter - Converts RTCM messages to 3GPP LPP messages
* SPARTN converter - Converts 3GPP LPP messages to SPARTN messages
* Interface - A set of interfaces that can be read or written to, e.g. a device, a file, a socket, etc.
* u-Blox Receiver - A library that can be used to communicate with a u-Blox receiver.
* NMEA Receiver - A library that can be used to communicate with a GNSS receiver that supports NMEA.

## Table of Contents
- [Examples](#examples)
- [Prerequisites](#prerequisites)
- [Building](#building)
- [Usage](#usage)
- [License](#license)
## Examples
* [3GPP LPP example](/examples/lpp/README.md) - `example-lpp` - Simple example of requesting assistance data from a SUPL server, converting it, and sending it to a GNSS receiver. Supports OSR, SSR, and basic retrieval of A-GNSS data. This is almost a fully implemented client.
* [NTRIP example](/examples/ntrip/README.md) - `example-ntrip` - Example that connects to an NTRIP caster, requesting RTCM data, and sending it to a GNSS receiver.
* [u-Blox example](/examples/ublox/README.md) - `example-ublox` - Example that will communicate with a u-Blox receiver and print all received messages to the console.
* [NMEA example](/examples/nmea/README.md) - `example-nmea` - Example that will communicate with a GNSS receiver (that supports NMEA) and print all received messages to the console.

---
## Build

## Examples
The repository has a few examples:
- [LPP](/examples/lpp/README.md) - Example client that requests assistance data from a location server. It supports OSR, SSR, and AGNSS requests. The assistance data can be outputted to a file, serial port, TCP, UDP or stdout. It can also be converted to RTCM messages that can be transmitted to any GNSS receiver that supports it.
- [u-blox](/examples/ublox/README.md) - Example program that demonstrates how to use the u-Blox receiver library. The program takes an interface and port associated with the receiver as arguments. It will the connect, configure the u-blox to output UBX-NAV-PVT, and print all received messages to stdout.

## Prerequisites
These are the prerequisites required for building:
First install the dependencies:
```bash
sudo apt install g++ cmake libssl-dev ninja-build
```

# Building
Building using CMake and Ninja:
Clone the repository:
```bash
cmake -S . -B build -G Ninja
cmake --build build --config Debug
git clone [email protected]:Ericsson/SUPL-3GPP-LPP-client.git
cd SUPL-3GPP-LPP-client
```

After a successful build, the example executables should be located in the `build` folder with a prefix of `example-`. E.g., `build/example-lpp`.

### GCC-4.8
Setup the build:
```bash
mkdir build
cd build
cmake .. -GNinja -DCMAKE_BUILD_TYPE=Debug
```

To verify compatibility with gcc-4.8 and older compilers, use the build script (`build-with-gcc4.8.sh`), that will build the client with gcc 4.8. This help guarantee that the source code will compile on smaller devices such as a Raspberry PI or BeagleBone. This is done with the help of a docker image with the compiler preinstalled. (This requires that you have docker installed)
Build the project (from the build directory):
```bash
ninja
```

## License
See [LICENSE](/LICENSE.txt) file.
4 changes: 2 additions & 2 deletions build-with-gcc4.8.sh → docker/verify-with-gcc4.8.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@ cp -r receiver build/docker/.
cp -r libs build/docker/.
cp CMakeLists.txt build/docker/.

sudo docker build . -f docker/Dockerfile.gcc-4.8 -t build:gcc-4.8
sudo docker build ./build -f docker/Dockerfile.build.gcc-4.8
docker build . -f docker/Dockerfile.gcc-4.8 -t build:gcc-4.8
docker build build -f docker/Dockerfile.build.gcc-4.8
3 changes: 3 additions & 0 deletions examples/lpp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,11 @@ target_include_directories(example_lpp PRIVATE "./")
target_link_libraries(example_lpp PRIVATE utility modem lpplib Threads::Threads)
target_link_libraries(example_lpp PRIVATE args)
target_link_libraries(example_lpp PRIVATE generator::rtcm)
target_link_libraries(example_lpp PRIVATE generator::spartn)
target_link_libraries(example_lpp PRIVATE generator::spartn2)
target_link_libraries(example_lpp PRIVATE dependency::interface)
target_link_libraries(example_lpp PRIVATE receiver::ublox)
target_link_libraries(example_lpp PRIVATE receiver::nmea)
target_link_libraries(example_lpp PRIVATE asn1::generated asn1::helper)

set_target_properties(example_lpp PROPERTIES OUTPUT_NAME "example-lpp")
Expand Down
194 changes: 113 additions & 81 deletions examples/lpp/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Example - LPP Client

This is a simple client examples that requests assistance data from a location server. It supports OSR, SSR, and AGNSS requests. The assistance data can be outputted to a file, serial port, TCP, UDP or stdout. It can also be converted to RTCM messages that can be transmitted to any GNSS receiver that supports it.
This sample code is a simple client that asks for assistance data from a location server. It can handle OSR, SSR, and AGNSS requests. The assistance data can converted to RTCM or SPARTN before being sent to a GNSS receiver or other interface. The client also supports to 3GPP LPP Provide Location Information, which can be used to send the device's location to the location server.

## Usage

Expand All @@ -12,95 +12,127 @@ There are a few required arguments:
- `-i` or `--ci` - The Cell Identity

```
./example-lpp COMMAND {OPTIONS}
./example-lpp COMMAND {OPTIONS}
Example - LPP Client
3GPP LPP Example (3.4.0) - This sample code is a simple client that asks for
assistance data from a location server. It can handle OSR, SSR, and AGNSS
requests. The assistance data can converted to RTCM or SPARTN before being
sent to a GNSS receiver or other interface. The client also supports to 3GPP
LPP Provide Location Information, which can be used to send the device's
location to the location server.
OPTIONS:
OPTIONS:
-?, --help Display this help menu
-v, --version Display version information
Commands:
osr Request observation data from a
location server
ssr Request State-space Representation
(SSR) data from the location server
agnss Request Assisted GNSS data from the
location server
Location Server:
-h[host], --host=[host] Host
-p[port], --port=[port] Port
Default: 5431
-s, --ssl TLS
Default: false
Identity:
--msisdn=[msisdn] MSISDN
--imsi=[imsi] IMSI
Default: 2460813579
--ipv4=[ipv4] IPv4
Cell Information:
-c[mcc], --mcc=[mcc] Mobile Country Code
-n[mnc], --mnc=[mnc] Mobile Network Code
-t[tac], --lac=[tac], --tac=[tac] Tracking Area Code
-i[ci], --ci=[ci] Cell Identity
Modem:
--modem=[device] Device
--modem-baud=[baud_rate] Baud Rate
u-blox Receiver:
--ublox-port=[port] The port used on the u-blox receiver,
used by configuration.
One of: uart1, uart2, i2c, usb
Default: (by interface)
Serial:
--ublox-serial=[device] Device
--ublox-serial-baud=[baud_rate] Baud Rate
-?, --help Display this help menu
-v, --version Display version information
Commands:
osr Request observation data from a
location server
ssr Request State-space Representation
(SSR) data from the location server
agnss Request Assisted GNSS data from the
location server
Location Server:
-h[host], --host=[host] Host
-p[port], --port=[port] Port
Default: 5431
-s, --ssl TLS
Default: false
Identity:
--msisdn=[msisdn] MSISDN
--imsi=[imsi] IMSI
Default: 2460813579
--ipv4=[ipv4] IPv4
--supl-identity-fix Use SUPL Identity Fix
Cell Information:
-c[mcc], --mcc=[mcc] Mobile Country Code
-n[mnc], --mnc=[mnc] Mobile Network Code
-t[tac], --lac=[tac], --tac=[tac] Tracking Area Code
-i[ci], --ci=[ci] Cell Identity
Modem:
--modem=[device] Device
--modem-baud=[baud_rate] Baud Rate
u-blox Receiver:
--ublox-port=[port] The port used on the u-blox receiver,
used by configuration.
One of: uart1, uart2, i2c, usb
Default: (by interface)
Serial:
--ublox-serial=[device] Device
--ublox-serial-baud=[baud_rate] Baud Rate
Default: 115200
--ublox-serial-data=[data_bits] Data Bits
One of: 5, 6, 7, 8
Default: 8
--ublox-serial-stop=[stop_bits] Stop Bits
One of: 1, 2
Default: 1
--ublox-serial-parity=[parity_bits]
Parity Bits
One of: none, odd, even
Default: none
I2C:
--ublox-i2c=[device] Device
--ublox-i2c-address=[address] Address
Default: 66
TCP:
--ublox-tcp=[ip_address] Host or IP Address
--ublox-tcp-port=[port] Port
UDP:
--ublox-udp=[ip_address] Host or IP Address
--ublox-udp-port=[port] Port
NMEA Receiver:
Serial:
--nmea-serial=[device] Device
--nmea-serial-baud=[baud_rate] Baud Rate
Default: 115200
--ublox-serial-data=[data_bits] Data Bits
--nmea-serial-data=[data_bits] Data Bits
One of: 5, 6, 7, 8
Default: 8
--ublox-serial-stop=[stop_bits] Stop Bits
--nmea-serial-stop=[stop_bits] Stop Bits
One of: 1, 2
Default: 1
--ublox-serial-parity=[parity_bits]
--nmea-serial-parity=[parity_bits]
Parity Bits
One of: none, odd, even
Default: none
I2C:
--ublox-i2c=[device] Device
--ublox-i2c-address=[address] Address
Default: 66
TCP:
--ublox-tcp=[ip_address] Host or IP Address
--ublox-tcp-port=[port] Port
UDP:
--ublox-udp=[ip_address] Host or IP Address
--ublox-udp-port=[port] Port
Output:
File:
--file=[file_path] Path
Serial:
--serial=[device] Device
--serial-baud=[baud_rate] Baud Rate
Default: 115200
--serial-data=[data_bits] Data Bits
One of: 5, 6, 7, 8
Default: 8
--serial-stop=[stop_bits] Stop Bits
One of: 1, 2
Default: 1
--serial-parity=[parity_bits] Parity Bits
One of: none, odd, even
Default: none
I2C:
--i2c=[device] Device
--i2c-address=[address] Address
Default: 66
TCP:
--tcp=[ip_address] Host or IP Address
--tcp-port=[port] Port
UDP:
--udp=[ip_address] Host or IP Address
--udp-port=[port] Port
Stdout:
--stdout Stdout
Output:
File:
--file=[file_path] Path
Serial:
--serial=[device] Device
--serial-baud=[baud_rate] Baud Rate
Default: 115200
--serial-data=[data_bits] Data Bits
One of: 5, 6, 7, 8
Default: 8
--serial-stop=[stop_bits] Stop Bits
One of: 1, 2
Default: 1
--serial-parity=[parity_bits] Parity Bits
One of: none, odd, even
Default: none
I2C:
--i2c=[device] Device
--i2c-address=[address] Address
Default: 66
TCP:
--tcp=[ip_address] Host or IP Address
--tcp-port=[port] Port
UDP:
--udp=[ip_address] Host or IP Address
--udp-port=[port] Port
Stdout:
--stdout Stdout
Location Infomation:
--location-info Location Information
--force-location-info Force Location Information (always
send even if not requested)
--latitude=[latitude] Latitude
Default: 69.0599730655754
--longitude=[longitude] Longitude
Default: 20.54864403253676
--altitude=[altitude] Altitude
Default: 0
```
Loading

0 comments on commit c2271d4

Please sign in to comment.