Skip to content

Commit 0eaf16c

Browse files
authored
New High Level Flag Message (3002) [OI-3101] (#1487)
1 parent 2e2c1a4 commit 0eaf16c

File tree

56 files changed

+5234
-466
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

56 files changed

+5234
-466
lines changed

HOWTO.md

Lines changed: 105 additions & 87 deletions
Large diffs are not rendered by default.

README.md

Lines changed: 81 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,24 @@
1-
## Specification and Bindings for Swift Binary Protocol
1+
# Specification and Bindings for Swift Binary Protocol
22

33
<!-- toc -->
44

5-
- [Installing sbp2json, json2sbp, json2json and related tools](#installing-sbp2json-json2sbp-json2json-and-related-tools)
6-
- [Building / installing](#building--installing)
7-
* [Using Docker](#using-docker)
8-
+ [Fetching the prebuilt image from DockerHub](#fetching-the-prebuilt-image-from-dockerhub)
9-
+ [Creating your own image](#creating-your-own-image)
10-
+ [Using the docker image](#using-the-docker-image)
11-
* [Installing from package managers](#installing-from-package-managers)
12-
* [Installing development Python versions](#installing-development-python-versions)
13-
* [Adding development version as a pip dependency](#adding-development-version-as-a-pip-dependency)
14-
* [Installing from source](#installing-from-source)
15-
- [SBP Development Procedures](#sbp-development-procedures)
16-
- [SBP Protocol Specification](#sbp-protocol-specification)
17-
- [JSON Schema Definitions](#json-schema-definitions)
18-
- [Kaitai Struct Format Descriptions](#kaitai-struct-format-descriptions)
19-
- [LICENSE](#license)
5+
- [Specification and Bindings for Swift Binary Protocol](#specification-and-bindings-for-swift-binary-protocol)
6+
- [Installing sbp2json, json2sbp, json2json and related tools](#installing-sbp2json-json2sbp-json2json-and-related-tools)
7+
- [Building / installing](#building--installing)
8+
- [Using Docker](#using-docker)
9+
- [Fetching the prebuilt image from DockerHub](#fetching-the-prebuilt-image-from-dockerhub)
10+
- [Creating your own image](#creating-your-own-image)
11+
- [Using the docker image](#using-the-docker-image)
12+
- [Installing from package managers](#installing-from-package-managers)
13+
- [Installing development Python versions](#installing-development-python-versions)
14+
- [Adding development version as a pip dependency](#adding-development-version-as-a-pip-dependency)
15+
- [Installing from source](#installing-from-source)
16+
- [SBP Development Procedures](#sbp-development-procedures)
17+
- [SBP Protocol Specification](#sbp-protocol-specification)
18+
- [JSON Schema Definitions](#json-schema-definitions)
19+
- [Kaitai Struct Format Descriptions](#kaitai-struct-format-descriptions)
20+
- [Notes on python bindings](#notes-on-python-bindings)
21+
- [LICENSE](#license)
2022

2123
<!-- tocstop -->
2224

@@ -32,19 +34,19 @@ messages used with SBP, a compiler for generating message bindings, and client
3234
libraries in a variety of languages. This repository is organized into the
3335
following directory structure:
3436

35-
* [`docs`](./docs): Protocol documentation and message definitions.
36-
* [`spec`](./spec): Machine readable protocol specification in
37+
- [`docs`](./docs): Protocol documentation and message definitions.
38+
- [`spec`](./spec): Machine readable protocol specification in
3739
[YAML](http://en.wikipedia.org/wiki/YAML).
38-
* [`generator`](./generator): Simple, template-based generator for
40+
- [`generator`](./generator): Simple, template-based generator for
3941
different languages.
40-
* [`python`](./python): Python client and examples.
41-
* [`c`](./c): C client library and examples.
42-
* [`haskell`](./haskell): Haskell client and examples.
43-
* [`java`](./java): Java client library and examples.
44-
* [`javascript`](./javascript): JavaScript client library and examples.
45-
* [`rust`](./rust): Rust client library and examples.
46-
* [`sbpjson`](./sbpjson): Tools for parsing SBP-JSON.
47-
* [`kaitai`](./kaitai): Kaitai Struct Format Description and generated code.
42+
- [`python`](./python): Python client and examples.
43+
- [`c`](./c): C client library and examples.
44+
- [`haskell`](./haskell): Haskell client and examples.
45+
- [`java`](./java): Java client library and examples.
46+
- [`javascript`](./javascript): JavaScript client library and examples.
47+
- [`rust`](./rust): Rust client library and examples.
48+
- [`sbpjson`](./sbpjson): Tools for parsing SBP-JSON.
49+
- [`kaitai`](./kaitai): Kaitai Struct Format Description and generated code.
4850

4951
Except for the `generator`, all of the above are generated and should not be modified directly.
5052

@@ -72,7 +74,7 @@ your platform.
7274
To install from source, you can use Rust's cargo tool (first [install
7375
Rust](https://www.rust-lang.org/tools/install)), then run:
7476

75-
```
77+
```sh
7678
cargo install --git https://github.com/swift-nav/libsbp.git --bins
7779
```
7880

@@ -87,13 +89,13 @@ tool as well as a `sbp2prettyjson` tool.
8789
Finally, a Python version of the `sbp2json` tool exists, which is installable
8890
on any platform that supports Python via pip, e.g.:
8991

90-
```
92+
```sh
9193
pip3 install sbp
9294
```
9395

9496
The tool can then be invoked as follows:
9597

96-
```
98+
```sh
9799
python3 -m sbp2json <sbp.bin
98100
```
99101

@@ -103,9 +105,11 @@ but works on all platforms that Python itself supports.
103105
## Building / installing
104106

105107
Before you start, run
106-
```
108+
109+
```sh
107110
git pull --tags
108111
```
112+
109113
in you local libsbp repository to pull the tags. This will ensure the correct
110114
version number is generated.
111115

@@ -119,14 +123,18 @@ Start [Docker desktop](https://docs.docker.com/docker-for-mac/).
119123
The quickest method to get going is to just pull a prebuilt copy from DockerHub
120124
(no guarantees on freshness) by running the following on your command line:
121125

122-
docker run --rm -v $PWD:/mnt/workspace -i -t swiftnav/libsbp-build:2025-02-10 /bin/bash
126+
```sh
127+
docker run --rm -v $PWD:/mnt/workspace -i -t swiftnav/libsbp-build:2025-02-10 /bin/bash
128+
```
123129

124130
This will mount your local copy of the libsbp repository onto the image.
125131

126-
Check this [link](https://hub.docker.com/r/swiftnav/libsbp-build/tags) for newer tags.
132+
Check libsbp-build [dockerhub page](https://hub.docker.com/r/swiftnav/libsbp-build/tags) for newer tags.
127133
Alternatively, you could run
128134

129-
docker run --rm -v $PWD:/mnt/workspace -i -t swiftnav/libsbp-build:latest-master /bin/bash
135+
```sh
136+
docker run --rm -v $PWD:/mnt/workspace -i -t swiftnav/libsbp-build:latest-master /bin/bash
137+
```
130138

131139
if you are facing issues with compilation and the tags are out of date as well.
132140

@@ -136,18 +144,24 @@ Otherwise, the `Dockerfile` will create a docker image that contains all the
136144
necessary dependencies to build libsbp. You can make a local image fresh from
137145
this file by running `docker build` as such:
138146

139-
docker build -t libsbp-build - <Dockerfile
147+
```sh
148+
docker build -t libsbp-build - <Dockerfile
149+
```
140150

141151
Reading the Dockerfile from STDIN prevents docker from pulling in the whole
142152
repostory into the build context (which is then immediately discarded anyway).
143153
You can customize the UID of the user that's created with the docker image
144154
by passing the desired `UID` value to the build:
145155

156+
```sh
146157
docker build -t libsbp-build --build-arg UID=1234 - <Dockerfile
158+
```
147159

148160
You can then make this image operate on your local workspace like this:
149161

150-
docker run --rm -v $PWD:/mnt/workspace -i -t libsbp-build:latest /bin/bash
162+
```sh
163+
docker run --rm -v $PWD:/mnt/workspace -i -t libsbp-build:latest /bin/bash
164+
```
151165

152166
#### Using the docker image
153167

@@ -158,12 +172,16 @@ This could take several hours to run. Alternately, the docker image will run
158172
the `make all` command by default, so you can kick off the `make all` process
159173
by simply running the following command:
160174

161-
docker run --rm -v $PWD:/mnt/workspace -i -t libsbp-build:2025-02-10
175+
```sh
176+
docker run --rm -v $PWD:/mnt/workspace -i -t libsbp-build:2025-02-10
177+
```
162178

163179
To speed up this process you can attempt to run Python environment tests in
164180
paralell with:
165181

166-
docker run --rm -v $PWD:/mnt/workspace -i -t -e SBP_TOX_PARALLEL=auto libsbp-build:2025-02-10
182+
```sh
183+
docker run --rm -v $PWD:/mnt/workspace -i -t -e SBP_TOX_PARALLEL=auto libsbp-build:2025-02-10
184+
```
167185

168186
When you are finished, quit Docker so that it would not unnecessarily use up
169187
resources on your machine.
@@ -177,9 +195,9 @@ issues from an old build.
177195

178196
Some bindings are available on package managers:
179197

180-
* [`python`](https://github.com/swift-nav/libsbp/tree/HEAD/python): available on pip
181-
* [`haskell`](https://github.com/swift-nav/libsbp/tree/HEAD/haskell): available on Hackage
182-
* [`javascript`](https://github.com/swift-nav/libsbp/tree/HEAD/javascript): available on NPM
198+
- [`python`](https://github.com/swift-nav/libsbp/tree/HEAD/python): available on pip
199+
- [`haskell`](https://github.com/swift-nav/libsbp/tree/HEAD/haskell): available on Hackage
200+
- [`javascript`](https://github.com/swift-nav/libsbp/tree/HEAD/javascript): available on NPM
183201

184202
### Installing development Python versions
185203

@@ -190,6 +208,7 @@ pip install 'file:///path/to/libsbp#subdirectory=python'
190208
```
191209

192210
Or via setuptools directly:
211+
193212
```sh
194213
cd /path/to/libsbp
195214
cd python
@@ -199,31 +218,35 @@ python setup.py
199218
### Adding development version as a pip dependency
200219

201220
Run the following command:
221+
202222
```sh
203223
pip install "git+https://github.com/swift-nav/libsbp@<GIT_REVISION>#egg=sbp&subdirectory=python"
204224
```
205225

206226
Or add this to `requirements.txt`:
207-
```
227+
228+
```sh
208229
git+https://github.com/swift-nav/libsbp@<GIT_REVISION>#egg=sbp&subdirectory=python
209230
```
210231

211232
### Installing from source
233+
212234
You can build one binding at a time or update all at once:
213235

214-
```
236+
```sh
215237
make python
216238
```
217239

218240
or
219241

220-
```
242+
```sh
221243
make all
222244
```
223245

224246
are both valid. To see a list of all valid targets, run `make help`.
225247

226248
**Python version notes:**
249+
227250
1. By default the Python targets `make python` and `make test-python` (as well
228251
as `make all`) run tests on all Python versions officially supported by *the
229252
libsbp Python bindings*, currently **3.6-3.9**, skipping any versions not
@@ -256,7 +279,7 @@ detection.
256279

257280
Please see [the docs](docs/sbp.pdf) for a full description of the packet
258281
structure and the message types. Developer documentation for the
259-
language-specific sbp libraries is [here](http://swift-nav.github.io/libsbp/).
282+
language-specific sbp libraries is available at [http://swift-nav.github.io/libsbp/](http://swift-nav.github.io/libsbp/).
260283
Please refer to [the changelog](CHANGELOG.md) for more information about the
261284
evolution of the library and its messages.
262285

@@ -281,19 +304,19 @@ respectively.
281304
The Kaitai Struct format description files can also potentially be used to
282305
generate bindings for the following targets:
283306

284-
* graphviz
285-
* csharp
286-
* rust
287-
* java
288-
* go
289-
* cpp_stl
290-
* php
291-
* lua
292-
* nim
293-
* html
294-
* ruby
295-
* construct
296-
* javascript
307+
- graphviz
308+
- csharp
309+
- rust
310+
- java
311+
- go
312+
- cpp_stl
313+
- php
314+
- lua
315+
- nim
316+
- html
317+
- ruby
318+
- construct
319+
- javascript
297320

298321
### Notes on python bindings
299322

c/include/libsbp/cpp/message_traits.h

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6438,6 +6438,44 @@ struct MessageTraits<sbp_msg_ssr_code_phase_biases_bounds_t> {
64386438
}
64396439
};
64406440

6441+
template <>
6442+
struct MessageTraits<sbp_msg_ssr_flag_high_level_dep_a_t> {
6443+
static constexpr sbp_msg_type_t id = SbpMsgSsrFlagHighLevelDepA;
6444+
static constexpr const char *name = "MSG_SSR_FLAG_HIGH_LEVEL_DEP_A";
6445+
static const sbp_msg_ssr_flag_high_level_dep_a_t &get(const sbp_msg_t &msg) {
6446+
return msg.ssr_flag_high_level_dep_a;
6447+
}
6448+
static sbp_msg_ssr_flag_high_level_dep_a_t &get(sbp_msg_t &msg) {
6449+
return msg.ssr_flag_high_level_dep_a;
6450+
}
6451+
static void to_sbp_msg(const sbp_msg_ssr_flag_high_level_dep_a_t &msg,
6452+
sbp_msg_t *sbp_msg) {
6453+
sbp_msg->ssr_flag_high_level_dep_a = msg;
6454+
}
6455+
static sbp_msg_t to_sbp_msg(const sbp_msg_ssr_flag_high_level_dep_a_t &msg) {
6456+
sbp_msg_t sbp_msg;
6457+
sbp_msg.ssr_flag_high_level_dep_a = msg;
6458+
return sbp_msg;
6459+
}
6460+
static s8 send(sbp_state_t *state, u16 sender_id,
6461+
const sbp_msg_ssr_flag_high_level_dep_a_t &msg,
6462+
sbp_write_fn_t write) {
6463+
return sbp_msg_ssr_flag_high_level_dep_a_send(state, sender_id, &msg,
6464+
write);
6465+
}
6466+
static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written,
6467+
const sbp_msg_ssr_flag_high_level_dep_a_t &msg) {
6468+
return sbp_msg_ssr_flag_high_level_dep_a_encode(buf, len, n_written, &msg);
6469+
}
6470+
static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read,
6471+
sbp_msg_ssr_flag_high_level_dep_a_t *msg) {
6472+
return sbp_msg_ssr_flag_high_level_dep_a_decode(buf, len, n_read, msg);
6473+
}
6474+
static size_t encoded_len(const sbp_msg_ssr_flag_high_level_dep_a_t &msg) {
6475+
return sbp_msg_ssr_flag_high_level_dep_a_encoded_len(&msg);
6476+
}
6477+
};
6478+
64416479
template <>
64426480
struct MessageTraits<sbp_msg_ssr_flag_high_level_t> {
64436481
static constexpr sbp_msg_type_t id = SbpMsgSsrFlagHighLevel;

c/include/libsbp/integrity.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
#include <libsbp/integrity/IntegritySSRHeader.h>
2121
#include <libsbp/integrity/MSG_ACKNOWLEDGE.h>
2222
#include <libsbp/integrity/MSG_SSR_FLAG_HIGH_LEVEL.h>
23+
#include <libsbp/integrity/MSG_SSR_FLAG_HIGH_LEVEL_DEP_A.h>
2324
#include <libsbp/integrity/MSG_SSR_FLAG_IONO_GRID_POINTS.h>
2425
#include <libsbp/integrity/MSG_SSR_FLAG_IONO_GRID_POINT_SAT_LOS.h>
2526
#include <libsbp/integrity/MSG_SSR_FLAG_IONO_TILE_SAT_LOS.h>

c/include/libsbp/integrity/MSG_SSR_FLAG_HIGH_LEVEL.h

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,9 +72,14 @@ typedef struct {
7272
sbp_gps_time_sec_t obs_time;
7373

7474
/**
75-
* GNSS reference time of the correction associated to the flag.
75+
* GNSS reference time of the ionospheric correction associated to the flag.
7676
*/
77-
sbp_gps_time_sec_t corr_time;
77+
sbp_gps_time_sec_t iono_corr_time;
78+
79+
/**
80+
* GNSS reference time of the satellite correction associated to the flag.
81+
*/
82+
sbp_gps_time_sec_t sat_corr_time;
7883

7984
/**
8085
* SSR Solution ID.

0 commit comments

Comments
 (0)