Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
c9606c8
[ESD-2045] Restructure old C API (#994)
woodfell Jun 8, 2021
33eb284
[ESD-2047] Implement new C generator (#995)
woodfell Jun 8, 2021
c778211
[ESD-2047] Generated tests for new API (#998)
woodfell Jun 8, 2021
bcd364d
[ESD-2048] Rework generated headers (#999)
woodfell Jun 8, 2021
d121ed5
[ESD-2050] Add doc to the sbp_msg.h file (#1002)
samvrlewis Jun 8, 2021
abe4ebc
[ESD-2058] Update message traits template (#1006)
woodfell Jun 9, 2021
6d01982
[ESD-2059] Add a typedef for write callback (#1007)
woodfell Jun 9, 2021
0517936
[ESD-2049] Tidy up generated source files (#1003)
woodfell Jun 9, 2021
0cf5ae0
Fix big endian for new API [ESD-2057] (#1008)
samvrlewis Jun 9, 2021
dc378ea
[ESD-2060] Apply name and location changes (#1013)
woodfell Jun 10, 2021
56b8e84
Add -pedantic and -Wconversion (#1015)
woodfell Jun 10, 2021
276d6eb
Remove endian.h (#1016)
woodfell Jun 10, 2021
1b92c1f
[ESD-2046] String encoding (#1014)
woodfell Jun 11, 2021
49e5646
Add enum for message type (#1017)
woodfell Jun 11, 2021
559e332
Use more compilers in CI (#1018)
woodfell Jun 11, 2021
c4287aa
Doxygen errors (#1005)
woodfell Jun 11, 2021
8292f12
Windows CI Stages (#1021)
RReichert Jun 11, 2021
09569d5
Add some v4 examples (#1024)
samvrlewis Jun 16, 2021
3901153
[ESD-2043] Merge master (#1039)
woodfell Jun 29, 2021
72c1140
[ESD-2119] Correct naming of strlen helper functions (#1041)
woodfell Jul 5, 2021
15c63c4
Enable VS2019 tests (#1045)
RReichert Jul 5, 2021
da42946
[ESD-2117] Address code review comments (#1042)
woodfell Jul 6, 2021
424b9d7
Bump cmake submodule
Jul 6, 2021
3cf38e0
message_handler -> payload_handler
Jul 6, 2021
73592ef
Merge branch 'master' into woodfell/esd-2043/merge_master
Jul 16, 2021
c06b941
Fix examples
Jul 16, 2021
0ddd7dc
Regenerate C
Jul 16, 2021
2f8061b
[ESD-2043] Merge master (#1048)
woodfell Jul 16, 2021
262c737
Revert "[ESD-2043] Merge master (#1048)"
samvrlewis Jul 19, 2021
f99771c
Merge remote-tracking branch 'origin/woodfell/esd-2043/merge_master' …
samvrlewis Jul 19, 2021
655d48b
[ESD-2133] Add to_sbp_msg functions in MessageTraits (#1051)
samvrlewis Jul 22, 2021
f624ddd
[ESD-2122] Modify string functions to add truncate option
samvrlewis Jul 24, 2021
0148a2d
[ESD-2139] Add method to process unpacked messages from the state cla…
samvrlewis Jul 24, 2021
f218c23
Merge branch 'master' into ESD-2043-portability-project
Jul 26, 2021
9eba5ff
Cherry-pick faafd5bf0
Jul 26, 2021
df662d8
Fix JS array generation with primitive types (#1056)
woodfell Jul 26, 2021
2b39aa4
ESD-2131 swift targets (#1053)
RReichert Aug 2, 2021
46746ac
[ESD-2157]Add converters for GNSS message variants (#1060)
sokhealy Aug 4, 2021
2a175dc
Merge branch 'master' into ESD-2043-portability-project
Aug 6, 2021
d4accaa
ESD-2138 C11 -> C99 (#1064)
RReichert Aug 15, 2021
b5f6392
[ESD-2203] Always call decoded callbacks (#1065)
woodfell Aug 26, 2021
1ecb815
ESD-2195 buffer underflow on SBP string decoding (#1066)
RReichert Aug 30, 2021
c0c84f6
Update cmake
Sep 2, 2021
98c6713
Merge remote-tracking branch 'origin/master' into ESD-2043-portabilit…
Sep 2, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
153 changes: 153 additions & 0 deletions .github/workflows/c.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,3 +36,156 @@ jobs:
- name: Upload coverage to codecov.io
run: |
bash <(curl -s https://codecov.io/bash) -s c/build || echo "Codecov did not collect coverage reports";


gcc6-release:
name: GCC6 - Release
runs-on: ubuntu-18.04
steps:
- uses: actions/checkout@v2
with:
submodules: recursive
fetch-depth: 0

- name: Setup
run: |
sudo apt-get -qq update
sudo apt-get -qq install libeigen3-dev libserialport-dev

- name: Run tests
run: make test-c
env:
CMAKEFLAGS: -DCMAKE_BUILD_TYPE=Release -DBUILD_EXAMPLES=true

- name: Build examples
run: make -C c/build examples


clang6-debug:
name: Clang6 - Debug
runs-on: ubuntu-18.04
steps:
- uses: actions/checkout@v2
with:
submodules: recursive
fetch-depth: 0

- name: Setup
run: |
sudo apt-get -qq update
sudo apt-get -qq install clang-6.0 libeigen3-dev libserialport-dev

- name: Run tests
run: make test-c
env:
CMAKEFLAGS: -DCMAKE_BUILD_TYPE=Debug -DBUILD_EXAMPLES=true
CC: clang-6.0
CXX: clang++-6.0

- name: Build examples
run: make -C c/build examples


clang6-release:
name: Clang6 - Release
runs-on: ubuntu-18.04
steps:
- uses: actions/checkout@v2
with:
submodules: recursive
fetch-depth: 0

- name: Setup
run: |
sudo apt-get -qq update
sudo apt-get -qq install clang-6.0 libeigen3-dev libserialport-dev

- name: Run tests
run: make test-c
env:
CMAKEFLAGS: -DCMAKE_BUILD_TYPE=Release -DBUILD_EXAMPLES=true
CC: clang-6.0
CXX: clang++-6.0

- name: Build examples
run: make -C c/build examples


macos:
name: macos
runs-on: macos-10.15
steps:
- uses: actions/checkout@v2
with:
submodules: recursive
fetch-depth: 0

- name: Run tests
run: make test-c
env:
CC: clang
CXX: clang++


big-endian:
name: Test Big Endian
runs-on: ubuntu-18.04
steps:
- uses: actions/checkout@v2
with:
submodules: recursive
fetch-depth: 0

- name: Setup
run: |
sudo apt-get -qq update
sudo apt-get -qq install gcc-multilib-mips-linux-gnu gcc-mips-linux-gnu qemu-user g++-mips-linux-gnu

- name: Run big endian tests
run: make test-c-v4
env:
CC: mips-linux-gnu-gcc
CXX: mips-linux-gnu-g++

CMAKEFLAGS: -DCMAKE_EXE_LINKER_FLAGS_RELEASE="-static" -Dgtest_disable_pthreads=ON


windows-minGW:
name: Windows MinGW
runs-on: windows-2019
steps:

- uses: actions/checkout@v2
with:
submodules: recursive
fetch-depth: 0

- name: Configure
run: cmake -G "MinGW Makefiles" -S c -B build

- name: Build
run: cmake --build build --target all

- name: Test
run: cmake --build build --target do-all-tests


windows-vs-2019:
name: Windows VS 2019
runs-on: windows-2019
steps:

- uses: actions/checkout@v2
with:
submodules: recursive
fetch-depth: 0

- name: Configure
run: cmake -G "Visual Studio 16 2019" -S c -B build -D gtest_force_shared_crt=true

- name: Build
run: cmake --build build --target ALL_BUILD

- name: Test
run: cmake --build build --target do-all-tests

1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
*.*~
limbo/
.idea/
*.bak
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we still need this?


# Byte-compiled / optimized / DLL files
__pycache__/
Expand Down
15 changes: 12 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -171,10 +171,10 @@ gen: gen-c gen-python gen-javascript gen-java gen-haskell gen-rust gen-protobuf
gen-quicktype: gen-quicktype-typescript gen-quicktype-elm

gen-c:
$(call announce-begin,"Generating C headers")
$(call announce-begin,"Generating C headers and sources")
cd $(SWIFTNAV_ROOT)/generator; \
$(SBP_GEN_BIN) -i $(SBP_SPEC_DIR) \
-o $(SWIFTNAV_ROOT)/c/include/libsbp \
-o $(SWIFTNAV_ROOT)/c \
-r $(SBP_VERSION) \
--c

Expand Down Expand Up @@ -318,7 +318,7 @@ gen-quicktype-elm:

# Testers

test: test-all-begin test-c test-java test-python test-haskell test-javascript test-rust test-all-end
test: test-all-begin test-c test-c-v4 test-java test-python test-haskell test-javascript test-rust test-all-end

test-all-begin:
$(call announce-begin,"Running all tests")
Expand All @@ -335,6 +335,15 @@ test-c:
$(MAKE) do-all-tests
$(call announce-end,"Finished running C tests")

test-c-v4:
$(call announce-begin,"Running C tests")
cd $(SWIFTNAV_ROOT)/c; \
mkdir -p build/ && cd build/; \
cmake $(CMAKEFLAGS) ../; \
$(MAKE); \
$(MAKE) do-test-libsbp-v4 do-test-libsbp-cpp-v4
$(call announce-end,"Finished running C tests")

test-python:
$(call announce-begin,"Running Python tests")
cd $(SWIFTNAV_ROOT)/python/ && tox --skip-missing-interpreters
Expand Down
1 change: 1 addition & 0 deletions c/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ swift_create_project_options(
TEST_PACKAGES "Check"
)
include(CodeCoverage)
include(SwiftTargets)
include(TestTargets)
add_code_coverage_all_targets()
# TODO: Reformatting is limited to generated files; it should be expanded to cover all files
Expand Down
7 changes: 2 additions & 5 deletions c/examples/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,6 @@ option(BUILD_EXAMPLES "" OFF)

if(BUILD_EXAMPLES)
add_custom_target(examples)

foreach(target example cpp_example tcp_example tcp_2sigma_example)
add_subdirectory(${target})
add_dependencies(examples libsbp_${target})
endforeach()
add_subdirectory(legacy)
add_subdirectory(v4)
endif()
4 changes: 4 additions & 0 deletions c/examples/legacy/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
foreach(target example cpp_example tcp_example tcp_2sigma_example)
add_subdirectory(${target})
add_dependencies(examples libsbp_${target})
endforeach()
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ project(libsbp_cpp_example)

set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake")

set(CMAKE_C_FLAGS "-Wall -Wextra -Wno-strict-prototypes -Wno-unknown-warning-option -Werror -std=gnu99 ${CMAKE_C_FLAGS}")
set(CMAKE_CXX_FLAGS "-Wall -Wextra -Wno-unknown-warning-option -Werror -std=c++11 ${CMAKE_CXX_FLAGS}")
set(CMAKE_C_FLAGS "-Wall -Wextra -Wno-strict-prototypes -Werror -std=gnu99 -Wno-error=deprecated-declarations ${CMAKE_C_FLAGS}")
set(CMAKE_CXX_FLAGS "-Wall -Wextra -Werror -std=c++11 -Wno-error=deprecated-declarations ${CMAKE_CXX_FLAGS}")

find_package(PkgConfig)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
#include <fstream>

#include <libsbp/cpp/state.h>
#include <libsbp/cpp/message_handler.h>
#include <libsbp/cpp/frame_handler.h>
#include <libsbp/legacy/cpp/payload_handler.h>
#include <libsbp/legacy/cpp/frame_handler.h>

void usage(char *prog_name) {
fprintf(stderr, "usage: %s [filename]\n", prog_name);
Expand Down Expand Up @@ -34,9 +34,9 @@ class SbpFileReader : public sbp::IReader {
std::ifstream file_stream_;
};

class ECEFHandler : private sbp::MessageHandler<msg_gps_time_t, msg_pos_ecef_t> {
class ECEFHandler : private sbp::PayloadHandler<msg_gps_time_t, msg_pos_ecef_t> {
public:
ECEFHandler(sbp::State *state) : sbp::MessageHandler<msg_gps_time_t, msg_pos_ecef_t>(state) {
ECEFHandler(sbp::State *state) : sbp::PayloadHandler<msg_gps_time_t, msg_pos_ecef_t>(state) {
}

void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, const msg_gps_time_t& msg) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ project(libsbp_example)

set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake")

set(CMAKE_C_FLAGS "-Wall -Werror -std=gnu99 ${CMAKE_C_FLAGS}")
set(CMAKE_C_FLAGS "-Wall -Werror -Wno-error=deprecated-declarations -std=gnu99")

add_executable(libsbp_example example.c)

Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#include <libserialport.h>

#include <libsbp/sbp.h>
#include <libsbp/system.h>
#include <libsbp/legacy/system.h>

char *serial_port_name = NULL;
struct sp_port *piksi_port = NULL;
Expand Down Expand Up @@ -128,7 +128,7 @@ int main(int argc, char **argv)

sbp_state_init(&s);

sbp_register_callback(&s, SBP_MSG_HEARTBEAT, &heartbeat_callback, NULL,
sbp_payload_callback_register(&s, SBP_MSG_HEARTBEAT, &heartbeat_callback, NULL,
&heartbeat_callback_node);

while(1) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ project(libsbp_tcp_2sigma_example)

set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake")

set(CMAKE_CXX_FLAGS "-Wall -Wextra -Wno-unknown-warning-option -Werror -std=c++14 ${CMAKE_CXX_FLAGS}")
set(CMAKE_CXX_FLAGS "-Wall -Wextra -Werror -Wno-error=deprecated-declarations -std=c++14")

add_executable(libsbp_tcp_2sigma_example tcp_2sigma_example.cc)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
#endif /* SHOW_PLOT */

#include <libsbp/sbp.h>
#include <libsbp/navigation.h>
#include <libsbp/legacy/navigation.h>

// width and height of the plot window in pixels
#define SIZE_PIXELS 300
Expand Down Expand Up @@ -248,7 +248,7 @@ int main(int argc, char* const argv[]) {

sbp_state_init(&sbp_state);
sbp_state_set_io_context(&sbp_state, (void*)&fd);
sbp_register_callback(&sbp_state, SBP_MSG_POS_LLH_COV, &pos_llh_cov_callback, NULL, &callback_node[0]);
sbp_payload_callback_register(&sbp_state, SBP_MSG_POS_LLH_COV, &pos_llh_cov_callback, NULL, &callback_node[0]);

while(1) {
switch(sbp_process(&sbp_state, &socket_read)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ project(libsbp_tcp_example)

set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake")

set(CMAKE_C_FLAGS "-Wall -Wextra -Wno-strict-prototypes -Wno-unknown-warning-option -Werror -std=gnu99 ${CMAKE_C_FLAGS}")
set(CMAKE_C_FLAGS "-Wall -Wextra -Wno-strict-prototypes -Werror -Wno-error=deprecated-declarations -std=gnu99 ${CMAKE_C_FLAGS}")

add_executable(libsbp_tcp_example tcp_example.c)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#include <unistd.h>

#include <libsbp/sbp.h>
#include <libsbp/system.h>
#include <libsbp/legacy/system.h>

char *tcp_ip_addr = NULL;
char *tcp_ip_port = NULL;
Expand Down Expand Up @@ -101,7 +101,7 @@ int main(int argc, char **argv)

setup_socket();
sbp_state_init(&s);
sbp_register_callback(&s, SBP_MSG_HEARTBEAT, &heartbeat_callback, NULL,
sbp_payload_callback_register(&s, SBP_MSG_HEARTBEAT, &heartbeat_callback, NULL,
&heartbeat_callback_node);

while(1) {
Expand Down
4 changes: 4 additions & 0 deletions c/examples/v4/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
foreach(target example cpp_example cpp_traits_example)
add_subdirectory(${target})
add_dependencies(examples libsbp_v4_${target})
endforeach()
15 changes: 15 additions & 0 deletions c/examples/v4/cpp_example/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
cmake_minimum_required(VERSION 2.8.9)
project(libsbp_v4_cpp_example)

set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake")

set(CMAKE_C_FLAGS "-Wall -Wextra -Wno-strict-prototypes -Werror -std=gnu99 -Wno-error=deprecated-declarations ${CMAKE_C_FLAGS}")
set(CMAKE_CXX_FLAGS "-Wall -Wextra -Werror -std=c++11 -Wno-error=deprecated-declarations ${CMAKE_CXX_FLAGS}")

find_package(PkgConfig)

link_directories("/usr/local/lib/")
include_directories("/usr/local/include/")

add_executable(libsbp_v4_cpp_example cpp_example.cc)
target_link_libraries(libsbp_v4_cpp_example sbp)
Loading