Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump to latest open source publish of libswiftnav #2

Draft
wants to merge 9 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Base image is created by https://github.com/swift-nav/docker-recipes
FROM 571934480752.dkr.ecr.us-west-2.amazonaws.com/swift-build:2021-06-07
FROM 571934480752.dkr.ecr.us-west-2.amazonaws.com/swift-build-modern-rust:2023-04-25

# Add anything that's specific to this repo's build environment here.
RUN sudo mkdir -p /usr/share/man/man1
RUN sudo apt-get update && sudo apt-get install -y sqlite3 afl++
RUN sudo mkdir -p /usr/share/man/man1 \
&& sudo apt-get update \
&& sudo apt-get install --no-install-recommends -y sqlite3 afl++
15 changes: 0 additions & 15 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -30,21 +30,6 @@ pipeline {
buildDiscarder(logRotator(daysToKeepStr: '3'))
}

// Overwrite in stages that need clang
environment {
// Default compiler. Override in each stage as needed.
CC='gcc-6'
CXX='g++-6'
COMPILER='gcc-6'

// Default parallelism for make
MAKEJ='4'

// Since ~/.ccache is mounted from a shared NFS disk, make sure the temp
// dir is local to the container.
CCACHE_TEMPDIR='/tmp/ccache_tmp'
}

stages {
stage('Build') {
parallel {
Expand Down
1 change: 1 addition & 0 deletions c/afl/make_afl_testcases.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#define _GNU_SOURCE

#include "make_afl_testcases.h"

#include <assert.h>
#include <fcntl.h>
#include <stdio.h>
Expand Down
1 change: 1 addition & 0 deletions c/afl/make_rtcm_testcases.c
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
#include <string.h>
#include <swiftnav/bits.h>
#include <swiftnav/edc.h>

#include "make_afl_testcases.h"

#define RTCM3_PREAMBLE 0xD3
Expand Down
1 change: 1 addition & 0 deletions c/afl/make_ubx_testcases.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#include <ubx/decode.h>
#include <ubx/encode.h>

#include "make_afl_testcases.h"

static u8 output_buf[4096];
Expand Down
6 changes: 2 additions & 4 deletions c/gnss_converters/include/gnss-converters/ixcom_sbp.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,11 @@
#ifndef GNSS_CONVERTERS_IXCOM_SBP_INTERFACE_H
#define GNSS_CONVERTERS_IXCOM_SBP_INTERFACE_H

#include <ixcom/messages.h>
#include <libsbp/sbp.h>
#include <stddef.h>
#include <unistd.h>

#include <libsbp/sbp.h>

#include <ixcom/messages.h>

#ifdef __cplusplus
extern "C" {
#endif
Expand Down
4 changes: 2 additions & 2 deletions c/gnss_converters/include/gnss-converters/ubx_sbp.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,15 @@
#ifndef GNSS_CONVERTERS_UBX_SBP_INTERFACE_H
#define GNSS_CONVERTERS_UBX_SBP_INTERFACE_H

#include <gnss-converters/eph_sat_data.h>
#include <libsbp/sbp.h>
#include <libsbp/v4/gnss.h>
#include <libsbp/v4/navigation.h>
#include <libsbp/v4/observation.h>
#include <libsbp/v4/orientation.h>
#include <swiftnav/bytestream.h>
#include <unistd.h>

#include <gnss-converters/eph_sat_data.h>
#include <swiftnav/bytestream.h>
#include "swiftnav/gnss_time.h"
#include "swiftnav/signal.h"

Expand Down
11 changes: 4 additions & 7 deletions c/gnss_converters/src/ixcom_sbp.c
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
#include <assert.h>
#include <math.h>
#include <stddef.h>
#include <string.h>

#include <gnss-converters/ixcom_sbp.h>
#include <ixcom/decode.h>
#include <libsbp/v4/imu.h>
#include <libsbp/v4/vehicle.h>

#include <gnss-converters/ixcom_sbp.h>

#include <math.h>
#include <stddef.h>
#include <string.h>
#include <swiftnav/constants.h>

#define ODO_TIMESOURCE_GPS 0x1
Expand Down
7 changes: 3 additions & 4 deletions c/gnss_converters/src/nmea.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,12 @@
* WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
*/

#include "sbp_nmea_internal.h"

#include <assert.h>
#include <gnss-converters/nmea.h>
#include <math.h>
#include <stdarg.h>
#include <stdlib.h>
#include <string.h>

#include <gnss-converters/nmea.h>
#include <swiftnav/array_tools.h>
#include <swiftnav/common.h>
#include <swiftnav/constants.h>
Expand All @@ -27,6 +24,8 @@
#include <swiftnav/pvt_result.h>
#include <swiftnav/signal.h>

#include "sbp_nmea_internal.h"

/** \addtogroup io
* \{ */

Expand Down
1 change: 0 additions & 1 deletion c/gnss_converters/src/options.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
* WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
*/
#include <assert.h>

#include <gnss-converters/options.h>
#include <rtcm3/constants.h>
#include <rtcm3/msm_utils.h>
Expand Down
8 changes: 4 additions & 4 deletions c/gnss_converters/src/rtcm3_sbp.c
Original file line number Diff line number Diff line change
Expand Up @@ -134,8 +134,8 @@ void rtcm2sbp_decode_payload(const uint8_t *payload,
uint32_t payload_length,
struct rtcm3_sbp_state *state) {
(void)payload_length;
swiftnav_bitstream_t bitstream;
swiftnav_bitstream_init(&bitstream, payload, payload_length * 8);
swiftnav_in_bitstream_t bitstream;
swiftnav_in_bitstream_init(&bitstream, payload, payload_length * 8);

if (payload_length < 2) {
return;
Expand Down Expand Up @@ -1349,14 +1349,14 @@ void send_sbp_log_message(const uint8_t level,
rtcm_stn_to_sbp_sender_id(stn_id), SbpMsgLog, &msg, state->context);
}

void send_MSM_warning(const swiftnav_bitstream_t *bitstream,
void send_MSM_warning(const swiftnav_in_bitstream_t *bitstream,
struct rtcm3_sbp_state *state) {
if (!state->sent_msm_warning) {
/* Only send 1 warning */
state->sent_msm_warning = true;
/* Get the stn ID as well */
uint32_t stn_id = 0;
if (swiftnav_bitstream_getbitu(bitstream, &stn_id, 12, 24)) {
if (swiftnav_in_bitstream_getbitu(bitstream, &stn_id, 12, 24)) {
uint8_t msg[39] = "MSM1-3 Messages currently not supported";
send_sbp_log_message(
RTCM_MSM_LOGGING_LEVEL, msg, sizeof(msg), stn_id, state);
Expand Down
6 changes: 2 additions & 4 deletions c/gnss_converters/src/rtcm3_sbp_ephemeris.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
#include <swiftnav/constants.h>
#include <swiftnav/ephemeris.h>
#include <swiftnav/float_equality.h>

#include "ephemeris/sbas.h"
#include "rtcm3_sbp_internal.h"
#include "rtcm3_utils.h"
Expand Down Expand Up @@ -69,10 +70,7 @@ values, N = 0-6: use 2^(1+N/2) (round to one
decimal place i.e. 2.8, 5.7 and 11.3) , N=
7-15:use 2^(N-2), 8192 specifies use at own
risk) */
if (ura >= ARRAY_SIZE(g_bds_ura_table)) {
return -1;
}
float m = g_bds_ura_table[ura];
float m = decode_bds_ura_index(ura);
if (float_equal(INVALID_URA_VALUE, m)) {
return 8192.0f;
}
Expand Down
3 changes: 2 additions & 1 deletion c/gnss_converters/src/rtcm3_sbp_internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
#include <swiftnav/constants.h>
#include <swiftnav/gnss_time.h>
#include <swiftnav/signal.h>

#include "common.h"
#include "gnss-converters/rtcm3_sbp.h"

Expand Down Expand Up @@ -152,7 +153,7 @@ void send_sbp_log_message(uint8_t level,
uint16_t stn_id,
const struct rtcm3_sbp_state *state);

void send_MSM_warning(const swiftnav_bitstream_t *bitstream,
void send_MSM_warning(const swiftnav_in_bitstream_t *bitstream,
struct rtcm3_sbp_state *state);

void send_buffer_full_error(const struct rtcm3_sbp_state *state);
Expand Down
1 change: 1 addition & 0 deletions c/gnss_converters/src/rtcm3_sbp_ssr.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
#include <math.h>
#include <rtcm3/msm_utils.h>
#include <string.h>

#include "rtcm3_sbp_internal.h"

#define SSR_MESSAGE_LENGTH 256
Expand Down
7 changes: 3 additions & 4 deletions c/gnss_converters/src/rtcm3_utils.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,10 @@
#include "rtcm3_utils.h"

#include <assert.h>
#include <stdbool.h>
#include <stdint.h>

#include <rtcm3/constants.h>
#include <rtcm3/msm_utils.h>
#include <stdbool.h>
#include <stdint.h>
#include <swiftnav/constants.h>
#include <swiftnav/logging.h>
#include <swiftnav/signal.h>
Expand Down Expand Up @@ -455,7 +454,7 @@ bool msm_signal_frequency(const rtcm_msm_header *header,
return false;
}
case CODE_BDS2_B1:
*p_freq = BDS2_B11_HZ;
*p_freq = BDS2_B1I_HZ;
return true;
case CODE_BDS2_B2:
*p_freq = BDS2_B2_HZ;
Expand Down
3 changes: 1 addition & 2 deletions c/gnss_converters/src/rtcm3_utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,9 @@
#ifndef GNSS_CONVERTERS_RTCM3_UTILS_H
#define GNSS_CONVERTERS_RTCM3_UTILS_H

#include <rtcm3/messages.h>
#include <stdbool.h>
#include <stdint.h>

#include <rtcm3/messages.h>
#include <swiftnav/signal.h>

#define GPS_TOE_RESOLUTION 16
Expand Down
5 changes: 2 additions & 3 deletions c/gnss_converters/src/sbp_nmea.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,12 @@
* WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
*/

#include <gnss-converters/nmea.h>
#include <gnss-converters/sbp_nmea.h>
#include <math.h>
#include <stddef.h>
#include <stdlib.h>
#include <string.h>

#include <gnss-converters/nmea.h>
#include <gnss-converters/sbp_nmea.h>
#include <swiftnav/constants.h>
#include <swiftnav/gnss_time.h>
#include <swiftnav/memcpy_s.h>
Expand Down
3 changes: 1 addition & 2 deletions c/gnss_converters/test/check_options.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,8 @@
*/

#include <check.h>
#include <math.h>

#include <gnss-converters/options.h>
#include <math.h>
#include <rtcm3/messages.h>
#include <rtcm3/msm_utils.h>
#include <rtcm3_utils.h>
Expand Down
10 changes: 5 additions & 5 deletions c/gnss_converters_extra/src/sbp_conv.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,15 @@
* WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
*/

#include <gnss-converters-extra/sbp_conv.h>

#include <assert.h>
#include <gnss-converters-extra/sbp_conv.h>
#include <gnss-converters-extra/sbp_rtcm3.h>
#include <libsbp/legacy/logging.h>
#include <libsbp/sbp.h>
#include <swiftnav/fifo_byte.h>
#include <swiftnav/gnss_time.h>
#include <time.h>

#include <gnss-converters-extra/sbp_rtcm3.h>

struct sbp_conv_s {
struct rtcm3_out_state state;
fifo_t fifo;
Expand Down Expand Up @@ -114,7 +112,9 @@ size_t sbp_conv(sbp_conv_t conv,
sbp2rtcm_sbp_log_cb(sender, (u8)rlen, rbuf, &conv->state);
break;
}
default: { break; }
default: {
break;
}
}
return fifo_read(&conv->fifo, wbuf, (u32)wlen);
}
10 changes: 5 additions & 5 deletions c/gnss_converters_extra/src/sbp_rtcm3.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,20 +10,21 @@
* WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
*/

#include <assert.h>
#include <math.h>
#include <stdlib.h>
#include <string.h>
#include "gnss-converters-extra/sbp_rtcm3.h"

#include <assert.h>
#include <libsbp/legacy/gnss.h>
#include <libsbp/legacy/logging.h>
#include <math.h>
#include <rtcm3/bits.h>
#include <rtcm3/decode.h>
#include <rtcm3/encode.h>
#include <rtcm3/eph_decode.h>
#include <rtcm3/eph_encode.h>
#include <rtcm3/logging.h>
#include <rtcm3/ssr_decode.h>
#include <stdlib.h>
#include <string.h>
#include <swiftnav/edc.h>
#include <swiftnav/ephemeris.h>
#include <swiftnav/fifo_byte.h>
Expand All @@ -34,7 +35,6 @@
#include <swiftnav/signal.h>
#include <swiftnav/swift_strnlen.h>

#include "gnss-converters-extra/sbp_rtcm3.h"
#include "gnss-converters/utils.h"
#include "rtcm3_utils.h"
#include "sbp_rtcm3_internal.h"
Expand Down
1 change: 1 addition & 0 deletions c/gnss_converters_extra/src/sbp_rtcm3_internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
#include <swiftnav/constants.h>
#include <swiftnav/gnss_time.h>
#include <swiftnav/signal.h>

#include "common.h"
#include "gnss-converters-extra/sbp_rtcm3.h"

Expand Down
7 changes: 3 additions & 4 deletions c/gnss_converters_extra/test/check_utils.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,14 @@
#include <stdlib.h>
#include <string.h>

#include "../../gnss_converters_extra/src/sbp_rtcm3_internal.h"
#include "../src/rtcm3_sbp_internal.h"
#include "../src/rtcm3_utils.h"
#include "common.h"
#include "gnss-converters-extra/sbp_rtcm3.h"
#include "gnss-converters/rtcm3_sbp.h"
#include "libsbp/legacy/logging.h"

#include "../../gnss_converters_extra/src/sbp_rtcm3_internal.h"
#include "../src/rtcm3_sbp_internal.h"
#include "../src/rtcm3_utils.h"

#define FREQ_TOL 1e-3

static struct rtcm3_sbp_state state;
Expand Down
3 changes: 1 addition & 2 deletions c/ixcom2sbp/src/ixcom2sbp.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,11 @@
*/

#include <getopt.h>
#include <gnss-converters/ixcom_sbp.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

#include <gnss-converters/ixcom_sbp.h>

sbp_state_t sbp_state;

typedef int (*readfn_ptr)(uint8_t *, size_t, void *);
Expand Down
Loading
Loading