Skip to content

Commit

Permalink
Release 4.0.1987-stable
Browse files Browse the repository at this point in the history
  • Loading branch information
Raphael Siryani committed Jan 30, 2024
1 parent fa23476 commit 3c335b4
Show file tree
Hide file tree
Showing 158 changed files with 12,904 additions and 8,866 deletions.
432 changes: 237 additions & 195 deletions CHANGELOG.md

Large diffs are not rendered by default.

73 changes: 60 additions & 13 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,22 +1,34 @@
cmake_minimum_required(VERSION 3.18 FATAL_ERROR)
cmake_minimum_required(VERSION 3.16 FATAL_ERROR)

set(CMAKE_BUILD_TYPE Release CACHE STRING "build type")

project(sbgECom)

#
# Project configuration
# Compiler configuration
#
set(CMAKE_C_STANDARD 99)
set(CMAKE_C_STANDARD_REQUIRED ON)
set(CMAKE_C_EXTENSIONS ON)
set(CMAKE_POSITION_INDEPENDENT_CODE ON)

option(BUILD_EXAMPLES "Build examples" OFF)
option(BUILD_TOOLS "Build tools" OFF)
set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

#
# Project configuration
#
option(BUILD_EXAMPLES "Build examples" OFF)
option(BUILD_TOOLS "Build tools" OFF)
option(USE_DEPRECATED_MACROS "Enable deprecated preprocessor defines and macros" ON)

if (USE_DEPRECATED_MACROS)
message(NOTICE "deprecated definitions, macros and enum values enabled")
add_compile_definitions(SBG_ECOM_USE_DEPRECATED_MACROS)
endif()

#
# sbgECom
# sbgECom library
#
add_library(${PROJECT_NAME} STATIC)

Expand Down Expand Up @@ -91,20 +103,55 @@ if (BUILD_TOOLS)
add_subdirectory(${argtable3_SOURCE_DIR} ${argtable3_BINARY_DIR} EXCLUDE_FROM_ALL)
endif()

#
# sbgBasicLogger tool - log sbgECom logs to CSV like files
#
add_executable(sbgBasicLogger
${PROJECT_SOURCE_DIR}/tools/sbgBasicLogger/src/main.c
${PROJECT_SOURCE_DIR}/tools/sbgBasicLogger/src/sbgBasicLoggerAccumulators.h
${PROJECT_SOURCE_DIR}/tools/sbgBasicLogger/src/sbgBasicLoggerFile.h
${PROJECT_SOURCE_DIR}/tools/sbgBasicLogger/src/sbgBasicLoggerHandler.h
${PROJECT_SOURCE_DIR}/tools/sbgBasicLogger/src/sbgBasicLoggerAccumulators.c
${PROJECT_SOURCE_DIR}/tools/sbgBasicLogger/src/sbgBasicLoggerFile.c
${PROJECT_SOURCE_DIR}/tools/sbgBasicLogger/src/sbgBasicLoggerHandler.c
${PROJECT_SOURCE_DIR}/tools/sbgBasicLogger/src/loggerEntry/helpers/imuDataMean.h
${PROJECT_SOURCE_DIR}/tools/sbgBasicLogger/src/loggerEntry/loggerEntryAidings.h
${PROJECT_SOURCE_DIR}/tools/sbgBasicLogger/src/loggerEntry/loggerEntryDvl.h
${PROJECT_SOURCE_DIR}/tools/sbgBasicLogger/src/loggerEntry/loggerEntryEkf.h
${PROJECT_SOURCE_DIR}/tools/sbgBasicLogger/src/loggerEntry/loggerEntryEkfRotAccel.h
${PROJECT_SOURCE_DIR}/tools/sbgBasicLogger/src/loggerEntry/loggerEntryEvent.h
${PROJECT_SOURCE_DIR}/tools/sbgBasicLogger/src/loggerEntry/loggerEntryGeneral.h
${PROJECT_SOURCE_DIR}/tools/sbgBasicLogger/src/loggerEntry/loggerEntryGnss.h
${PROJECT_SOURCE_DIR}/tools/sbgBasicLogger/src/loggerEntry/loggerEntryImu.h
${PROJECT_SOURCE_DIR}/tools/sbgBasicLogger/src/loggerEntry/loggerEntryMag.h
${PROJECT_SOURCE_DIR}/tools/sbgBasicLogger/src/loggerEntry/loggerEntryShipMotion.h
${PROJECT_SOURCE_DIR}/tools/sbgBasicLogger/src/loggerManager/loggerContext.h
${PROJECT_SOURCE_DIR}/tools/sbgBasicLogger/src/loggerManager/loggerEntry.h
${PROJECT_SOURCE_DIR}/tools/sbgBasicLogger/src/loggerManager/loggerManager.h
${PROJECT_SOURCE_DIR}/tools/sbgBasicLogger/src/loggerManager/loggerSettings.h
${PROJECT_SOURCE_DIR}/tools/sbgBasicLogger/src/loggerApp.h
${PROJECT_SOURCE_DIR}/tools/sbgBasicLogger/src/loggerEntry/helpers/imuDataMean.cpp
${PROJECT_SOURCE_DIR}/tools/sbgBasicLogger/src/loggerEntry/loggerEntryAidings.cpp
${PROJECT_SOURCE_DIR}/tools/sbgBasicLogger/src/loggerEntry/loggerEntryDvl.cpp
${PROJECT_SOURCE_DIR}/tools/sbgBasicLogger/src/loggerEntry/loggerEntryEkf.cpp
${PROJECT_SOURCE_DIR}/tools/sbgBasicLogger/src/loggerEntry/loggerEntryEkfRotAccel.cpp
${PROJECT_SOURCE_DIR}/tools/sbgBasicLogger/src/loggerEntry/loggerEntryEvent.cpp
${PROJECT_SOURCE_DIR}/tools/sbgBasicLogger/src/loggerEntry/loggerEntryGeneral.cpp
${PROJECT_SOURCE_DIR}/tools/sbgBasicLogger/src/loggerEntry/loggerEntryGnss.cpp
${PROJECT_SOURCE_DIR}/tools/sbgBasicLogger/src/loggerEntry/loggerEntryImu.cpp
${PROJECT_SOURCE_DIR}/tools/sbgBasicLogger/src/loggerEntry/loggerEntryMag.cpp
${PROJECT_SOURCE_DIR}/tools/sbgBasicLogger/src/loggerEntry/loggerEntryShipMotion.cpp
${PROJECT_SOURCE_DIR}/tools/sbgBasicLogger/src/loggerManager/loggerContext.cpp
${PROJECT_SOURCE_DIR}/tools/sbgBasicLogger/src/loggerManager/loggerEntry.cpp
${PROJECT_SOURCE_DIR}/tools/sbgBasicLogger/src/loggerManager/loggerManager.cpp
${PROJECT_SOURCE_DIR}/tools/sbgBasicLogger/src/loggerManager/loggerSettings.cpp
${PROJECT_SOURCE_DIR}/tools/sbgBasicLogger/src/loggerApp.cpp
${PROJECT_SOURCE_DIR}/tools/sbgBasicLogger/src/main.cpp
)
target_include_directories(sbgBasicLogger
PRIVATE ${argtable3_SOURCE_DIR}/src
PRIVATE ${PROJECT_SOURCE_DIR}/tools/sbgBasicLogger/src
)
target_include_directories(sbgBasicLogger PRIVATE ${argtable3_SOURCE_DIR}/src)
target_link_libraries(sbgBasicLogger ${PROJECT_NAME} argtable3_static)
install(TARGETS sbgBasicLogger DESTINATION bin/tools/sbgBasicLogger COMPONENT executables)
install(FILES tools/sbgBasicLogger/README.md DESTINATION bin/tools/sbgBasicLogger COMPONENT executables)

#
# sbgEComApi tool - use sbgInsRestApi GET/POS method over a serial port
#
add_executable(sbgEComApi ${PROJECT_SOURCE_DIR}/tools/sbgEComApi/src/main.c)
target_include_directories(sbgEComApi PRIVATE ${argtable3_SOURCE_DIR}/src)
target_link_libraries(sbgEComApi ${PROJECT_NAME} argtable3_static)
Expand Down
14 changes: 11 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ The library is written and maintained by SBG Systems SAS. You can contact the su

# Documentation

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

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

# Building sbgECom Library
The sbgECom library and code examples are very easy to compile on any platform using CMake.
The library has no third party library dependencies making it very easy to build.
The sbgECom library and code samples have no third party library dependencies.

However, if you would like to build sbgECom CLI tools such as the `sbgBasicLogger` or `sbgInsRestApi` there is a dependency on Argtable3.

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

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

## Building sbgECom
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:
Expand All @@ -48,6 +52,9 @@ cmake --build build

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

> **Disable Deprecated Macros**
> Make sure to add `-DUSE_DEPRECATED_MACROS=OFF` to disable support of deprecated defines, macros and enum values.
# Code Examples
SBG Systems provides several and simple C code examples to quickly use the sbgECom library.
You can find both the source code as well as a binary for each example.
Expand Down Expand Up @@ -108,6 +115,7 @@ The `bin/tools` directory contains pre-compiled 64 bits binaries for Windows, Li
## sbgBasicLogger
Simply parse sbgECom logs from a serial or ethernet interface and write log content to CSV like files.
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.
It can also extract RAW GNSS data stream as well as real time differential correction (RTCM) stream to binary files.

## sbgEComApi
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.
Expand Down
8 changes: 4 additions & 4 deletions common/debug/sbgDebug.h
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ typedef enum _SbgDebugLogType
* \param[in] errorCode The error code that has thrown this error.
* \param[in] format String litteral for the associated error message (you can use printf like string formating).
*/
#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__)
#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__)

#if SBG_CONFIG_ENABLE_LOG_ERROR == 1
#define SBG_LOG_ERROR SBG_LOG_ERROR_CALL
Expand All @@ -79,7 +79,7 @@ typedef enum _SbgDebugLogType
* \param[in] errorCode The error code that has thrown this warning.
* \param[in] format String litteral for the associated warning message (you can use printf like string formating).
*/
#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__)
#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__)

#if SBG_CONFIG_ENABLE_LOG_WARNING == 1
#define SBG_LOG_WARNING SBG_LOG_WARNING_CALL
Expand All @@ -91,7 +91,7 @@ typedef enum _SbgDebugLogType
* Log an information message.
* \param[in] format String litteral for the information message (you can use printf like string formating).
*/
#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__)
#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__)

#if SBG_CONFIG_ENABLE_LOG_INFO == 1
#define SBG_LOG_INFO SBG_LOG_INFO_CALL
Expand All @@ -103,7 +103,7 @@ typedef enum _SbgDebugLogType
* Log an information message only in debug mode
* \param[in] format String litteral for the information message (you can use printf like string formating).
*/
#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__)
#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__)

#if SBG_CONFIG_ENABLE_LOG_DEBUG == 1
#define SBG_LOG_DEBUG SBG_LOG_DEBUG_CALL
Expand Down
3 changes: 0 additions & 3 deletions common/interfaces/sbgInterface.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,6 @@ void sbgInterfaceZeroInit(SbgInterface *pInterface)
{
assert(pInterface);

//
// Make sure the whole struct is zero init
//
memset(pInterface, 0x00, sizeof(*pInterface));
}

Expand Down
14 changes: 7 additions & 7 deletions common/interfaces/sbgInterfaceSerialUnix.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@


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

//
// Create the right baud rate value for unix platforms
// Create the right baud rate value for Unix platforms
//
switch (baudRate)
{
Expand Down Expand Up @@ -141,14 +141,14 @@ static SbgErrorCode sbgInterfaceSerialDestroy(SbgInterface *pInterface)
//
// Get the internal serial handle
//
pSerialHandle = (int*)pInterface->handle;
pSerialHandle = (int *)pInterface->handle;

//
// Close the port com
//
close((*pSerialHandle));
SBG_FREE(pSerialHandle);
pInterface->handle = NULL;
sbgInterfaceZeroInit(pInterface);

return SBG_NO_ERROR;
}
Expand Down Expand Up @@ -212,7 +212,7 @@ static SbgErrorCode sbgInterfaceSerialFlush(SbgInterface *pInterface, uint32_t f
}

/*!
* Change the serial interface baud rate immediatly.
* Change the serial interface baud rate immediately.
*
* \param[in] handle Valid handle on an initialized interface.
* \param[in] baudRate The new baudrate to apply in bps.
Expand Down Expand Up @@ -321,7 +321,7 @@ static SbgErrorCode sbgInterfaceSerialWrite(SbgInterface *pInterface, const void
else
{
//
// An error has occured during the write
// An error has occurred during the write
//
fprintf(stderr, "sbgDeviceWrite: Unable to write to our device: %s\n", strerror(errno));
return SBG_WRITE_ERROR;
Expand Down Expand Up @@ -443,7 +443,7 @@ SbgErrorCode sbgInterfaceSerialCreate(SbgInterface *pInterface, const char *devi
if (fcntl((*pSerialHandle), F_SETFL, O_NONBLOCK) != -1)
{
//
// Retreive current options
// Retrieve current options
//
if (tcgetattr((*pSerialHandle), &options) != -1)
{
Expand Down
4 changes: 2 additions & 2 deletions common/interfaces/sbgInterfaceSerialWin.c
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ static SbgErrorCode sbgInterfaceSerialWrite(SbgInterface *pInterface, const void
if (WriteFile(pSerialDevice, pCurrentBuffer, numBytesLeftToWrite, (LPDWORD)&numBytesWritten, NULL) == false)
{
//
// An error has occured during the write
// An error has occurred during the write
//
sbgGetWindowsErrorMsg(errorMsg, sizeof(errorMsg));
SBG_LOG_ERROR(SBG_WRITE_ERROR, "Write failed error: %s", errorMsg);
Expand Down Expand Up @@ -400,7 +400,7 @@ SBG_COMMON_LIB_API SbgErrorCode sbgInterfaceSerialCreate(SbgInterface *pInterfac
if (PurgeComm(hSerialDevice, PURGE_TXABORT | PURGE_RXABORT | PURGE_TXCLEAR | PURGE_RXCLEAR))
{
//
// Retreives current com state and com timeout
// Retrieve current com state and com timeout
//
if ( (GetCommState(hSerialDevice, &comState)) && (GetCommTimeouts(hSerialDevice, &comTimeOut)) )
{
Expand Down
Loading

0 comments on commit 3c335b4

Please sign in to comment.