Skip to content

Commit 3c335b4

Browse files
author
Raphael Siryani
committed
Release 4.0.1987-stable
1 parent fa23476 commit 3c335b4

File tree

158 files changed

+12904
-8866
lines changed

Some content is hidden

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

158 files changed

+12904
-8866
lines changed

CHANGELOG.md

Lines changed: 237 additions & 195 deletions
Large diffs are not rendered by default.

CMakeLists.txt

Lines changed: 60 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,34 @@
1-
cmake_minimum_required(VERSION 3.18 FATAL_ERROR)
1+
cmake_minimum_required(VERSION 3.16 FATAL_ERROR)
22

33
set(CMAKE_BUILD_TYPE Release CACHE STRING "build type")
44

55
project(sbgECom)
66

77
#
8-
# Project configuration
8+
# Compiler configuration
99
#
1010
set(CMAKE_C_STANDARD 99)
1111
set(CMAKE_C_STANDARD_REQUIRED ON)
1212
set(CMAKE_C_EXTENSIONS ON)
1313
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
1414

15-
option(BUILD_EXAMPLES "Build examples" OFF)
16-
option(BUILD_TOOLS "Build tools" OFF)
15+
set(CMAKE_CXX_STANDARD 14)
16+
set(CMAKE_CXX_STANDARD_REQUIRED ON)
17+
18+
#
19+
# Project configuration
20+
#
21+
option(BUILD_EXAMPLES "Build examples" OFF)
22+
option(BUILD_TOOLS "Build tools" OFF)
23+
option(USE_DEPRECATED_MACROS "Enable deprecated preprocessor defines and macros" ON)
24+
25+
if (USE_DEPRECATED_MACROS)
26+
message(NOTICE "deprecated definitions, macros and enum values enabled")
27+
add_compile_definitions(SBG_ECOM_USE_DEPRECATED_MACROS)
28+
endif()
1729

1830
#
19-
# sbgECom
31+
# sbgECom library
2032
#
2133
add_library(${PROJECT_NAME} STATIC)
2234

@@ -91,20 +103,55 @@ if (BUILD_TOOLS)
91103
add_subdirectory(${argtable3_SOURCE_DIR} ${argtable3_BINARY_DIR} EXCLUDE_FROM_ALL)
92104
endif()
93105

106+
#
107+
# sbgBasicLogger tool - log sbgECom logs to CSV like files
108+
#
94109
add_executable(sbgBasicLogger
95-
${PROJECT_SOURCE_DIR}/tools/sbgBasicLogger/src/main.c
96-
${PROJECT_SOURCE_DIR}/tools/sbgBasicLogger/src/sbgBasicLoggerAccumulators.h
97-
${PROJECT_SOURCE_DIR}/tools/sbgBasicLogger/src/sbgBasicLoggerFile.h
98-
${PROJECT_SOURCE_DIR}/tools/sbgBasicLogger/src/sbgBasicLoggerHandler.h
99-
${PROJECT_SOURCE_DIR}/tools/sbgBasicLogger/src/sbgBasicLoggerAccumulators.c
100-
${PROJECT_SOURCE_DIR}/tools/sbgBasicLogger/src/sbgBasicLoggerFile.c
101-
${PROJECT_SOURCE_DIR}/tools/sbgBasicLogger/src/sbgBasicLoggerHandler.c
110+
${PROJECT_SOURCE_DIR}/tools/sbgBasicLogger/src/loggerEntry/helpers/imuDataMean.h
111+
${PROJECT_SOURCE_DIR}/tools/sbgBasicLogger/src/loggerEntry/loggerEntryAidings.h
112+
${PROJECT_SOURCE_DIR}/tools/sbgBasicLogger/src/loggerEntry/loggerEntryDvl.h
113+
${PROJECT_SOURCE_DIR}/tools/sbgBasicLogger/src/loggerEntry/loggerEntryEkf.h
114+
${PROJECT_SOURCE_DIR}/tools/sbgBasicLogger/src/loggerEntry/loggerEntryEkfRotAccel.h
115+
${PROJECT_SOURCE_DIR}/tools/sbgBasicLogger/src/loggerEntry/loggerEntryEvent.h
116+
${PROJECT_SOURCE_DIR}/tools/sbgBasicLogger/src/loggerEntry/loggerEntryGeneral.h
117+
${PROJECT_SOURCE_DIR}/tools/sbgBasicLogger/src/loggerEntry/loggerEntryGnss.h
118+
${PROJECT_SOURCE_DIR}/tools/sbgBasicLogger/src/loggerEntry/loggerEntryImu.h
119+
${PROJECT_SOURCE_DIR}/tools/sbgBasicLogger/src/loggerEntry/loggerEntryMag.h
120+
${PROJECT_SOURCE_DIR}/tools/sbgBasicLogger/src/loggerEntry/loggerEntryShipMotion.h
121+
${PROJECT_SOURCE_DIR}/tools/sbgBasicLogger/src/loggerManager/loggerContext.h
122+
${PROJECT_SOURCE_DIR}/tools/sbgBasicLogger/src/loggerManager/loggerEntry.h
123+
${PROJECT_SOURCE_DIR}/tools/sbgBasicLogger/src/loggerManager/loggerManager.h
124+
${PROJECT_SOURCE_DIR}/tools/sbgBasicLogger/src/loggerManager/loggerSettings.h
125+
${PROJECT_SOURCE_DIR}/tools/sbgBasicLogger/src/loggerApp.h
126+
${PROJECT_SOURCE_DIR}/tools/sbgBasicLogger/src/loggerEntry/helpers/imuDataMean.cpp
127+
${PROJECT_SOURCE_DIR}/tools/sbgBasicLogger/src/loggerEntry/loggerEntryAidings.cpp
128+
${PROJECT_SOURCE_DIR}/tools/sbgBasicLogger/src/loggerEntry/loggerEntryDvl.cpp
129+
${PROJECT_SOURCE_DIR}/tools/sbgBasicLogger/src/loggerEntry/loggerEntryEkf.cpp
130+
${PROJECT_SOURCE_DIR}/tools/sbgBasicLogger/src/loggerEntry/loggerEntryEkfRotAccel.cpp
131+
${PROJECT_SOURCE_DIR}/tools/sbgBasicLogger/src/loggerEntry/loggerEntryEvent.cpp
132+
${PROJECT_SOURCE_DIR}/tools/sbgBasicLogger/src/loggerEntry/loggerEntryGeneral.cpp
133+
${PROJECT_SOURCE_DIR}/tools/sbgBasicLogger/src/loggerEntry/loggerEntryGnss.cpp
134+
${PROJECT_SOURCE_DIR}/tools/sbgBasicLogger/src/loggerEntry/loggerEntryImu.cpp
135+
${PROJECT_SOURCE_DIR}/tools/sbgBasicLogger/src/loggerEntry/loggerEntryMag.cpp
136+
${PROJECT_SOURCE_DIR}/tools/sbgBasicLogger/src/loggerEntry/loggerEntryShipMotion.cpp
137+
${PROJECT_SOURCE_DIR}/tools/sbgBasicLogger/src/loggerManager/loggerContext.cpp
138+
${PROJECT_SOURCE_DIR}/tools/sbgBasicLogger/src/loggerManager/loggerEntry.cpp
139+
${PROJECT_SOURCE_DIR}/tools/sbgBasicLogger/src/loggerManager/loggerManager.cpp
140+
${PROJECT_SOURCE_DIR}/tools/sbgBasicLogger/src/loggerManager/loggerSettings.cpp
141+
${PROJECT_SOURCE_DIR}/tools/sbgBasicLogger/src/loggerApp.cpp
142+
${PROJECT_SOURCE_DIR}/tools/sbgBasicLogger/src/main.cpp
143+
)
144+
target_include_directories(sbgBasicLogger
145+
PRIVATE ${argtable3_SOURCE_DIR}/src
146+
PRIVATE ${PROJECT_SOURCE_DIR}/tools/sbgBasicLogger/src
102147
)
103-
target_include_directories(sbgBasicLogger PRIVATE ${argtable3_SOURCE_DIR}/src)
104148
target_link_libraries(sbgBasicLogger ${PROJECT_NAME} argtable3_static)
105149
install(TARGETS sbgBasicLogger DESTINATION bin/tools/sbgBasicLogger COMPONENT executables)
106150
install(FILES tools/sbgBasicLogger/README.md DESTINATION bin/tools/sbgBasicLogger COMPONENT executables)
107151

152+
#
153+
# sbgEComApi tool - use sbgInsRestApi GET/POS method over a serial port
154+
#
108155
add_executable(sbgEComApi ${PROJECT_SOURCE_DIR}/tools/sbgEComApi/src/main.c)
109156
target_include_directories(sbgEComApi PRIVATE ${argtable3_SOURCE_DIR}/src)
110157
target_link_libraries(sbgEComApi ${PROJECT_NAME} argtable3_static)

README.md

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ The library is written and maintained by SBG Systems SAS. You can contact the su
1515

1616
# Documentation
1717

18-
You can access the full online sbgECom Doxygen documentation [here](https://developer.sbg-systems.com/sbgECom/3.2).
18+
You can access the full online sbgECom Doxygen documentation [here](https://developer.sbg-systems.com/sbgECom/4.0).
1919
You should also read the SBG Systems [Support Center](https://support.sbg-systems.com) to quickly start using and integrating your products.
2020
Please also have a look at the [sbgInsRestApi](https://developer.sbg-systems.com/sbgInsRestApi/) documentation that is used to configure High Performance INS products.
2121

@@ -27,16 +27,20 @@ The library has been designed to be easily ported to any platform by just provid
2727

2828
# Building sbgECom Library
2929
The sbgECom library and code examples are very easy to compile on any platform using CMake.
30-
The library has no third party library dependencies making it very easy to build.
30+
The sbgECom library and code samples have no third party library dependencies.
31+
32+
However, if you would like to build sbgECom CLI tools such as the `sbgBasicLogger` or `sbgInsRestApi` there is a dependency on Argtable3.
3133

3234
SBG Systems doesn't provide the sbgECom as a pre-compiled library for obvious and good reasons.
3335

3436
## Dependencies
35-
SBG Systems has validated the following toolchain:
37+
SBG Systems has validated the following tool-chain and libraries:
3638
- \>= CMake 3.0
3739
- \>= GNU GCC 8 (any platform)
3840
- \>= AppleClang 13 (Mac OS X)
3941
- \>= Visual Studio 2015 or MSBuild equivalent (Windows)
42+
- \>= Argtable3 (to build sbgECom tools)
43+
- \>= Git (to fetch Argtable3)
4044

4145
## Building sbgECom
4246
To build the sbgECom static library, the C example and the command line tools go to the sbgECom library folder and type the following commands:
@@ -48,6 +52,9 @@ cmake --build build
4852

4953
You should find the sbgECom static library, examples and tools binaries in the `build/Debug` folder.
5054

55+
> **Disable Deprecated Macros**
56+
> Make sure to add `-DUSE_DEPRECATED_MACROS=OFF` to disable support of deprecated defines, macros and enum values.
57+
5158
# Code Examples
5259
SBG Systems provides several and simple C code examples to quickly use the sbgECom library.
5360
You can find both the source code as well as a binary for each example.
@@ -108,6 +115,7 @@ The `bin/tools` directory contains pre-compiled 64 bits binaries for Windows, Li
108115
## sbgBasicLogger
109116
Simply parse sbgECom logs from a serial or ethernet interface and write log content to CSV like files.
110117
This tool can also read sbgECom logs from a binary file making it very interesting to convert ELLIPSE binary streams to easy to use text files.
118+
It can also extract RAW GNSS data stream as well as real time differential correction (RTCM) stream to binary files.
111119

112120
## sbgEComApi
113121
Easily access sbgInsRest API configuration over a serial or UDP interface. You can execute GET and POST queries using simple to use command lines arguments.

common/debug/sbgDebug.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ typedef enum _SbgDebugLogType
6666
* \param[in] errorCode The error code that has thrown this error.
6767
* \param[in] format String litteral for the associated error message (you can use printf like string formating).
6868
*/
69-
#define SBG_LOG_ERROR_CALL(errorCode, format, ...) sbgPlatformDebugLogMsg((const char*)__BASE_FILE__, (const char*)__FUNCTION__, __LINE__, SBG_DEBUG_LOG_CATEGORY, SBG_DEBUG_LOG_TYPE_ERROR, errorCode, format, ##__VA_ARGS__)
69+
#define SBG_LOG_ERROR_CALL(errorCode, format, ...) sbgPlatformDebugLogMsg((const char*)__BASE_FILE__, (const char*)__func__, __LINE__, SBG_DEBUG_LOG_CATEGORY, SBG_DEBUG_LOG_TYPE_ERROR, errorCode, format, ##__VA_ARGS__)
7070

7171
#if SBG_CONFIG_ENABLE_LOG_ERROR == 1
7272
#define SBG_LOG_ERROR SBG_LOG_ERROR_CALL
@@ -79,7 +79,7 @@ typedef enum _SbgDebugLogType
7979
* \param[in] errorCode The error code that has thrown this warning.
8080
* \param[in] format String litteral for the associated warning message (you can use printf like string formating).
8181
*/
82-
#define SBG_LOG_WARNING_CALL(errorCode, format, ...) sbgPlatformDebugLogMsg((const char*)__BASE_FILE__, (const char*)__FUNCTION__, __LINE__, SBG_DEBUG_LOG_CATEGORY, SBG_DEBUG_LOG_TYPE_WARNING, errorCode, format, ##__VA_ARGS__)
82+
#define SBG_LOG_WARNING_CALL(errorCode, format, ...) sbgPlatformDebugLogMsg((const char*)__BASE_FILE__, (const char*)__func__, __LINE__, SBG_DEBUG_LOG_CATEGORY, SBG_DEBUG_LOG_TYPE_WARNING, errorCode, format, ##__VA_ARGS__)
8383

8484
#if SBG_CONFIG_ENABLE_LOG_WARNING == 1
8585
#define SBG_LOG_WARNING SBG_LOG_WARNING_CALL
@@ -91,7 +91,7 @@ typedef enum _SbgDebugLogType
9191
* Log an information message.
9292
* \param[in] format String litteral for the information message (you can use printf like string formating).
9393
*/
94-
#define SBG_LOG_INFO_CALL(format, ...) sbgPlatformDebugLogMsg((const char*)__BASE_FILE__, (const char*)__FUNCTION__, __LINE__, SBG_DEBUG_LOG_CATEGORY, SBG_DEBUG_LOG_TYPE_INFO, SBG_NO_ERROR, format, ##__VA_ARGS__)
94+
#define SBG_LOG_INFO_CALL(format, ...) sbgPlatformDebugLogMsg((const char*)__BASE_FILE__, (const char*)__func__, __LINE__, SBG_DEBUG_LOG_CATEGORY, SBG_DEBUG_LOG_TYPE_INFO, SBG_NO_ERROR, format, ##__VA_ARGS__)
9595

9696
#if SBG_CONFIG_ENABLE_LOG_INFO == 1
9797
#define SBG_LOG_INFO SBG_LOG_INFO_CALL
@@ -103,7 +103,7 @@ typedef enum _SbgDebugLogType
103103
* Log an information message only in debug mode
104104
* \param[in] format String litteral for the information message (you can use printf like string formating).
105105
*/
106-
#define SBG_LOG_DEBUG_CALL(format, ...) sbgPlatformDebugLogMsg((const char*)__BASE_FILE__, (const char*)__FUNCTION__, __LINE__, SBG_DEBUG_LOG_CATEGORY, SBG_DEBUG_LOG_TYPE_DEBUG, SBG_NO_ERROR, format, ##__VA_ARGS__)
106+
#define SBG_LOG_DEBUG_CALL(format, ...) sbgPlatformDebugLogMsg((const char*)__BASE_FILE__, (const char*)__func__, __LINE__, SBG_DEBUG_LOG_CATEGORY, SBG_DEBUG_LOG_TYPE_DEBUG, SBG_NO_ERROR, format, ##__VA_ARGS__)
107107

108108
#if SBG_CONFIG_ENABLE_LOG_DEBUG == 1
109109
#define SBG_LOG_DEBUG SBG_LOG_DEBUG_CALL

common/interfaces/sbgInterface.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,6 @@ void sbgInterfaceZeroInit(SbgInterface *pInterface)
2525
{
2626
assert(pInterface);
2727

28-
//
29-
// Make sure the whole struct is zero init
30-
//
3128
memset(pInterface, 0x00, sizeof(*pInterface));
3229
}
3330

common/interfaces/sbgInterfaceSerialUnix.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323

2424

2525
/*!
26-
* Returns the right unix baud rate const according to a baud rate value.
26+
* Returns the right Unix baud rate const according to a baud rate value.
2727
*
2828
* \param[in] baudRate The baud rate value (ie 115200).
2929
* \return The Unix baud rate constant.
@@ -33,7 +33,7 @@ static uint32_t sbgInterfaceSerialGetBaudRateConst(uint32_t baudRate)
3333
uint32_t baudRateConst;
3434

3535
//
36-
// Create the right baud rate value for unix platforms
36+
// Create the right baud rate value for Unix platforms
3737
//
3838
switch (baudRate)
3939
{
@@ -141,14 +141,14 @@ static SbgErrorCode sbgInterfaceSerialDestroy(SbgInterface *pInterface)
141141
//
142142
// Get the internal serial handle
143143
//
144-
pSerialHandle = (int*)pInterface->handle;
144+
pSerialHandle = (int *)pInterface->handle;
145145

146146
//
147147
// Close the port com
148148
//
149149
close((*pSerialHandle));
150150
SBG_FREE(pSerialHandle);
151-
pInterface->handle = NULL;
151+
sbgInterfaceZeroInit(pInterface);
152152

153153
return SBG_NO_ERROR;
154154
}
@@ -212,7 +212,7 @@ static SbgErrorCode sbgInterfaceSerialFlush(SbgInterface *pInterface, uint32_t f
212212
}
213213

214214
/*!
215-
* Change the serial interface baud rate immediatly.
215+
* Change the serial interface baud rate immediately.
216216
*
217217
* \param[in] handle Valid handle on an initialized interface.
218218
* \param[in] baudRate The new baudrate to apply in bps.
@@ -321,7 +321,7 @@ static SbgErrorCode sbgInterfaceSerialWrite(SbgInterface *pInterface, const void
321321
else
322322
{
323323
//
324-
// An error has occured during the write
324+
// An error has occurred during the write
325325
//
326326
fprintf(stderr, "sbgDeviceWrite: Unable to write to our device: %s\n", strerror(errno));
327327
return SBG_WRITE_ERROR;
@@ -443,7 +443,7 @@ SbgErrorCode sbgInterfaceSerialCreate(SbgInterface *pInterface, const char *devi
443443
if (fcntl((*pSerialHandle), F_SETFL, O_NONBLOCK) != -1)
444444
{
445445
//
446-
// Retreive current options
446+
// Retrieve current options
447447
//
448448
if (tcgetattr((*pSerialHandle), &options) != -1)
449449
{

common/interfaces/sbgInterfaceSerialWin.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ static SbgErrorCode sbgInterfaceSerialWrite(SbgInterface *pInterface, const void
135135
if (WriteFile(pSerialDevice, pCurrentBuffer, numBytesLeftToWrite, (LPDWORD)&numBytesWritten, NULL) == false)
136136
{
137137
//
138-
// An error has occured during the write
138+
// An error has occurred during the write
139139
//
140140
sbgGetWindowsErrorMsg(errorMsg, sizeof(errorMsg));
141141
SBG_LOG_ERROR(SBG_WRITE_ERROR, "Write failed error: %s", errorMsg);
@@ -400,7 +400,7 @@ SBG_COMMON_LIB_API SbgErrorCode sbgInterfaceSerialCreate(SbgInterface *pInterfac
400400
if (PurgeComm(hSerialDevice, PURGE_TXABORT | PURGE_RXABORT | PURGE_TXCLEAR | PURGE_RXCLEAR))
401401
{
402402
//
403-
// Retreives current com state and com timeout
403+
// Retrieve current com state and com timeout
404404
//
405405
if ( (GetCommState(hSerialDevice, &comState)) && (GetCommTimeouts(hSerialDevice, &comTimeOut)) )
406406
{

0 commit comments

Comments
 (0)