Skip to content

Commit

Permalink
Release 5.2.590-stable
Browse files Browse the repository at this point in the history
  • Loading branch information
Raphael Siryani committed Feb 17, 2025
1 parent f957507 commit 05c19cd
Show file tree
Hide file tree
Showing 12 changed files with 391 additions and 153 deletions.
19 changes: 16 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# Change Log
This change log lists all modifications for each sbgECom library release.

sbgECom C library change log issued on: 2024-12-04
Copyright (C) 2007-2024, SBG Systems SAS. All rights reserved.
sbgECom C library change log issued on: 2025-02-17
Copyright (C) 2007-2025, SBG Systems SAS. All rights reserved.

## Release Summary

The sbgECom 5.1.708-stable is a major release that supports the following products:
The sbgECom 5.2.590-stable is a major release that supports the following products:
- **High Performance INS**: Firmware 5.x and above
- **ELLIPSE v3**: Firmware 3.x and above
- **ELLIPSE v1/v2**: Firmware 2.6 (legacy support)
Expand All @@ -32,6 +32,19 @@ Below are the key improvements and modifications in this release:
- Completely rewritten sbgECom protocol documentation
- General code cleanup and improvements for better maintainability

## Release - 5.2.590-stable

### New Features
- SBGECOM-451 - Add support for new Septentrio Pro+ and CLAS receivers variants
- SBGECOM-455 - Update PTP message with PTP over Ethernet
- SBGECOM-457 - Doc: Add Magnetic declination and inclination fields in EKF Euler and Quaternion messages
- SBGECOM-458 - Doc: Add missing documentation for output message SBG_ECOM_LOG_RTCM_RAW
- SBGECOM-459 - Doc: Add SBG_ECOM_LOG_SESSION_INFO output message with device info and settings

### Bug Fixes
- SBGECOM-452 - Doc: Fix several issues with anchors, titles and notes
- SBGECOM-454 - Doc: SBG_ECOM_LOG_IMU_SHORT message ID is 22 instead of 44

## Release - 5.1.708-stable

### New Features
Expand Down
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
cmake_minimum_required(VERSION 3.16 FATAL_ERROR)

# Set project metadata
project(sbgECom VERSION 5.1.708 LANGUAGES C;CXX)
project(sbgECom VERSION 5.2.590 LANGUAGES C;CXX)

#
# Compiler configuration
Expand Down Expand Up @@ -168,7 +168,7 @@ install(EXPORT sbgEComTargets
include(CMakePackageConfigHelpers)
write_basic_package_version_file(
"${CMAKE_CURRENT_BINARY_DIR}/sbgEComConfigVersion.cmake"
VERSION 5.1.708
VERSION 5.2.590
COMPATIBILITY SameMajorVersion
)

Expand Down
2 changes: 1 addition & 1 deletion LICENSE.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# License {#license}
The MIT License (MIT)

Copyright (C) 2007-2024, SBG Systems SAS. All rights reserved.
Copyright (C) 2007-2025, SBG Systems SAS. All rights reserved.

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# sbgECom Library 5.1.708-stable
# sbgECom Library 5.2.590-stable
sbgECom is a C library provided under the MIT License and used to interface easily [SBG Systems](https://www.sbg-systems.com/) IMU, AHRS and INS to your application.

## Introduction
Expand All @@ -16,7 +16,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/5.1).
You can access the full online sbgECom Doxygen documentation [here](https://developer.sbg-systems.com/sbgECom/5.2).
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 Down
125 changes: 97 additions & 28 deletions doc/binaryMessages.md

Large diffs are not rendered by default.

7 changes: 4 additions & 3 deletions src/commands/sbgEComCmdFeatures.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
*
* \copyright Copyright (C) 2007-2024, SBG Systems SAS. All rights reserved.
* \beginlicense The MIT license
*
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
Expand All @@ -26,7 +26,7 @@
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*
*
* \endlicense
*/

Expand Down Expand Up @@ -85,6 +85,7 @@ extern "C" {
#define SBG_ECOM_GNSS_FEATURE_HIGH_SPEED (0x00000001 << 6) /*!< The GNSS receiver has no high speed limitation (> 515m/s) */
#define SBG_ECOM_GNSS_FEATURE_IM (0x00000001 << 7) /*!< The GNSS receiver is able to detect and mitigate RF interferences. */
#define SBG_ECOM_GNSS_FEATURE_OSNMA (0x00000001 << 8) /*!< The GNSS receiver implements Galileo OSNMA spoofing detection. */
#define SBG_ECOM_GNSS_FEATURE_CLAS (0x00000001 << 9) /*!< The GNSS receiver implements Centimeter-Level Augmentation Service. */

//----------------------------------------------------------------------//
//- Feature commands types definition -//
Expand Down Expand Up @@ -128,7 +129,7 @@ typedef struct _SbgEComFeatures

/*!
* Retrieve the device and embedded GPS receiver features.
*
*
* \param[in] pHandle A valid sbgECom handle.
* \param[in] pFeatures A pointer to a structure to hold features.
* \return SBG_NO_ERROR if the command has been executed successfully.
Expand Down
2 changes: 2 additions & 0 deletions src/logs/sbgEComLogGnssPos.h
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ extern "C" {
#define SBG_ECOM_GNSS_POS_QZSS_L1_USED (0x00000001u << 26) /*!< Set to 1 if QZSS L1CA is used in solution. */
#define SBG_ECOM_GNSS_POS_QZSS_L2_USED (0x00000001u << 27) /*!< Set to 1 if QZSS L2C is used in solution. */
#define SBG_ECOM_GNSS_POS_QZSS_L5_USED (0x00000001u << 28) /*!< Set to 1 if QZSS L5 is used in solution. */
#define SBG_ECOM_GNSS_POS_QZSS_L6_USED (0x00000001u << 29) /*!< Set to 1 if QZSS L6 is used in solution. */

/*!
* GNSS position status definitions.
Expand Down Expand Up @@ -377,6 +378,7 @@ SbgEComGnssOsnmaStatus sbgEComLogGnssPosGetOsnmaStatus(const SbgEComLogGnssPos *
#define SBG_ECOM_GPS_POS_QZSS_L1_USED (0x00000001u << 26)
#define SBG_ECOM_GPS_POS_QZSS_L2_USED (0x00000001u << 27)
#define SBG_ECOM_GPS_POS_QZSS_L5_USED (0x00000001u << 28)
#define SBG_ECOM_GPS_POS_QZSS_L6_USED (0x00000001u << 29)

#define SBG_ECOM_POS_SOL_COMPUTED (SBG_ECOM_GNSS_POS_STATUS_SOL_COMPUTED)
#define SBG_ECOM_POS_INSUFFICIENT_OBS (SBG_ECOM_GNSS_POS_STATUS_INSUFFICIENT_OBS)
Expand Down
171 changes: 95 additions & 76 deletions src/logs/sbgEComLogPtp.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,71 +6,17 @@
#include "sbgEComLogPtp.h"

//----------------------------------------------------------------------//
//- Private functions -//
//- Private definitions for state field -//
//----------------------------------------------------------------------//

/*!
* Convert a value into a state.
*
* \param[in] value Value.
* \param[out] pState State.
* \return SBG_NO_ERROR if successful.
*/
static SbgErrorCode sbgEComLogPtpConvertState(uint8_t value, SbgEComLogPtpState *pState)
{
SbgErrorCode errorCode = SBG_INVALID_PARAMETER;

assert(pState);

switch ((SbgEComLogPtpState)value)
{
case SBG_ECOM_LOG_PTP_STATE_DISABLED:
case SBG_ECOM_LOG_PTP_STATE_FAULTY:
case SBG_ECOM_LOG_PTP_STATE_MASTER:
case SBG_ECOM_LOG_PTP_STATE_PASSIVE:
*pState = (SbgEComLogPtpState)value;
errorCode = SBG_NO_ERROR;
break;
}

if (errorCode == SBG_INVALID_PARAMETER)
{
SBG_LOG_ERROR(errorCode, "unable to convert state: invalid value %" PRIu8, value);
}

return errorCode;
}

/*!
* Convert a value into a time scale.
*
* \param[in] value Value.
* \param[out] pTimeScale Time scale.
* \return SBG_NO_ERROR if successful.
*/
static SbgErrorCode sbgEComLogPtpConvertTimeScale(uint8_t value, SbgEComLogPtpTimeScale *pTimeScale)
{
SbgErrorCode errorCode = SBG_INVALID_PARAMETER;

assert(pTimeScale);
#define SBG_ECOM_LOG_PTP_STATE_SHIFT (0u) /*!< Shift used to extract the PTP state part. */
#define SBG_ECOM_LOG_PTP_STATE_MASK ((uint16_t)0x07u) /*!< Mask used to keep only the PTP state part. */

switch ((SbgEComLogPtpTimeScale)value)
{
case SBG_ECOM_LOG_PTP_TIME_SCALE_TAI:
case SBG_ECOM_LOG_PTP_TIME_SCALE_UTC:
case SBG_ECOM_LOG_PTP_TIME_SCALE_GPS:
*pTimeScale = (SbgEComLogPtpTimeScale)value;
errorCode = SBG_NO_ERROR;
break;
}

if (errorCode == SBG_INVALID_PARAMETER)
{
SBG_LOG_ERROR(errorCode, "unable to convert time scale: invalid value %" PRIu8, value);
}
#define SBG_ECOM_LOG_PTP_TRANSPORT_SHIFT (3u) /*!< Shift used to extract the PTP transport part. */
#define SBG_ECOM_LOG_PTP_TRANSPORT_MASK ((uint16_t)0x07u) /*!< Mask used to keep only the PTP transport part. */

return errorCode;
}
#define SBG_ECOM_LOG_PTP_TIMESCALE_SHIFT (8u) /*!< Shift used to extract the PTP time scale part. */
#define SBG_ECOM_LOG_PTP_TIMESCALE_MASK ((uint16_t)0x07u) /*!< Mask used to keep only the PTP time scale part. */

//----------------------------------------------------------------------//
//- Public functions -//
Expand All @@ -82,8 +28,10 @@ void sbgEComLogPtpZeroInit(SbgEComLogPtp *pLogData)

memset(pLogData, 0, sizeof(*pLogData));

pLogData->state = SBG_ECOM_LOG_PTP_STATE_FAULTY;
pLogData->timeScale = SBG_ECOM_LOG_PTP_TIME_SCALE_TAI;
sbgEComLogPtpSetState(pLogData, SBG_ECOM_LOG_PTP_STATE_FAULTY);
sbgEComLogPtpSetTransport(pLogData, SBG_ECOM_LOG_PTP_TRANSPORT_UDP);
sbgEComLogPtpSetTimeScale(pLogData, SBG_ECOM_LOG_PTP_TIME_SCALE_TAI);

pLogData->timeScaleOffset = 0.0;
pLogData->localClockIdentity = UINT64_MAX;
pLogData->masterClockIdentity = UINT64_MAX;
Expand All @@ -94,20 +42,21 @@ void sbgEComLogPtpZeroInit(SbgEComLogPtp *pLogData)
pLogData->clockOffsetStdDev = NAN;
pLogData->clockFreqOffset = NAN;
pLogData->clockFreqOffsetStdDev = NAN;

memset(pLogData->masterMacAddress, UINT8_MAX, sizeof(pLogData->masterMacAddress));
}

SbgErrorCode sbgEComLogPtpReadFromStream(SbgEComLogPtp *pLogData, SbgStreamBuffer *pStreamBuffer)
{
SbgErrorCode errorCode;
uint8_t state;
uint8_t timeScale;
uint16_t status;

assert(pStreamBuffer);
assert(pLogData);
assert(pStreamBuffer);

pLogData->timeStamp = sbgStreamBufferReadUint32LE(pStreamBuffer);
state = sbgStreamBufferReadUint8(pStreamBuffer);
timeScale = sbgStreamBufferReadUint8(pStreamBuffer);
status = sbgStreamBufferReadUint16LE(pStreamBuffer);

pLogData->timeScaleOffset = sbgStreamBufferReadDoubleLE(pStreamBuffer);

pLogData->localClockIdentity = sbgStreamBufferReadUint64LE(pStreamBuffer);
Expand All @@ -134,29 +83,39 @@ SbgErrorCode sbgEComLogPtpReadFromStream(SbgEComLogPtp *pLogData, SbgStreamBuffe
pLogData->clockFreqOffset = sbgStreamBufferReadFloatLE(pStreamBuffer);
pLogData->clockFreqOffsetStdDev = sbgStreamBufferReadFloatLE(pStreamBuffer);

errorCode = sbgStreamBufferGetLastError(pStreamBuffer);

if (errorCode == SBG_NO_ERROR)
//
// Added in sbgECom 5.2
//
if (sbgStreamBufferGetSpace(pStreamBuffer) >= sizeof(pLogData->masterMacAddress))
{
errorCode = sbgEComLogPtpConvertState(state, &pLogData->state);
for (size_t i = 0; i < SBG_ARRAY_SIZE(pLogData->masterMacAddress); i++)
{
pLogData->masterMacAddress[i] = sbgStreamBufferReadUint8(pStreamBuffer);
}
}
else
{
memset(pLogData->masterMacAddress, UINT8_MAX, sizeof(pLogData->masterMacAddress));
}

errorCode = sbgStreamBufferGetLastError(pStreamBuffer);

if (errorCode == SBG_NO_ERROR)
{
errorCode = sbgEComLogPtpConvertTimeScale(timeScale, &pLogData->timeScale);
pLogData->status = status;
}

return errorCode;
}

SbgErrorCode sbgEComLogPtpWriteToStream(const SbgEComLogPtp *pLogData, SbgStreamBuffer *pStreamBuffer)
{
assert(pStreamBuffer);
assert(pLogData);
assert(pStreamBuffer);

sbgStreamBufferWriteUint32LE(pStreamBuffer, pLogData->timeStamp);
sbgStreamBufferWriteUint8(pStreamBuffer, pLogData->state);
sbgStreamBufferWriteUint8(pStreamBuffer, pLogData->timeScale);
sbgStreamBufferWriteUint16LE(pStreamBuffer, pLogData->status);

sbgStreamBufferWriteDoubleLE(pStreamBuffer, pLogData->timeScaleOffset);

sbgStreamBufferWriteUint64LE(pStreamBuffer, pLogData->localClockIdentity);
Expand All @@ -183,5 +142,65 @@ SbgErrorCode sbgEComLogPtpWriteToStream(const SbgEComLogPtp *pLogData, SbgStream
sbgStreamBufferWriteFloatLE(pStreamBuffer, pLogData->clockFreqOffset);
sbgStreamBufferWriteFloatLE(pStreamBuffer, pLogData->clockFreqOffsetStdDev);

//
// Added in sbgECom 5.2
//
for (size_t i = 0; i < SBG_ARRAY_SIZE(pLogData->masterMacAddress); i++)
{
sbgStreamBufferWriteUint8(pStreamBuffer, pLogData->masterMacAddress[i]);
}

return sbgStreamBufferGetLastError(pStreamBuffer);
}

//----------------------------------------------------------------------//
//- Public setters/getters -//
//----------------------------------------------------------------------//

void sbgEComLogPtpSetState(SbgEComLogPtp *pLogData, SbgEComLogPtpState state)
{
assert(pLogData);
assert(state <= SBG_ECOM_LOG_PTP_STATE_MASK);

pLogData->status &= ~(SBG_ECOM_LOG_PTP_STATE_MASK << SBG_ECOM_LOG_PTP_STATE_SHIFT);
pLogData->status |= ((uint16_t)state & SBG_ECOM_LOG_PTP_STATE_MASK) << SBG_ECOM_LOG_PTP_STATE_SHIFT;
}

SbgEComLogPtpState sbgEComLogPtpGetState(const SbgEComLogPtp *pLogData)
{
assert(pLogData);

return (SbgEComLogPtpState)((pLogData->status >> SBG_ECOM_LOG_PTP_STATE_SHIFT) & SBG_ECOM_LOG_PTP_STATE_MASK);
}

void sbgEComLogPtpSetTransport(SbgEComLogPtp *pLogData, SbgEComLogPtpTransport transport)
{
assert(pLogData);
assert(transport <= SBG_ECOM_LOG_PTP_TRANSPORT_MASK);

pLogData->status &= ~(SBG_ECOM_LOG_PTP_TRANSPORT_MASK << SBG_ECOM_LOG_PTP_TRANSPORT_SHIFT);
pLogData->status |= ((uint16_t)transport & SBG_ECOM_LOG_PTP_TRANSPORT_MASK) << SBG_ECOM_LOG_PTP_TRANSPORT_SHIFT;
}

SbgEComLogPtpTransport sbgEComLogPtpGetTransport(const SbgEComLogPtp *pLogData)
{
assert(pLogData);

return (SbgEComLogPtpTransport)((pLogData->status >> SBG_ECOM_LOG_PTP_TRANSPORT_SHIFT) & SBG_ECOM_LOG_PTP_TRANSPORT_MASK);
}

void sbgEComLogPtpSetTimeScale(SbgEComLogPtp *pLogData, SbgEComLogPtpTimeScale timescale)
{
assert(pLogData);
assert(timescale <= SBG_ECOM_LOG_PTP_TIMESCALE_MASK);

pLogData->status &= ~(SBG_ECOM_LOG_PTP_TIMESCALE_MASK << SBG_ECOM_LOG_PTP_TIMESCALE_SHIFT);
pLogData->status |= ((uint16_t)timescale & SBG_ECOM_LOG_PTP_TIMESCALE_MASK) << SBG_ECOM_LOG_PTP_TIMESCALE_SHIFT;
}

SbgEComLogPtpTimeScale sbgEComLogPtpGetTimeScale(const SbgEComLogPtp *pLogData)
{
assert(pLogData);

return (SbgEComLogPtpTimeScale)((pLogData->status >> SBG_ECOM_LOG_PTP_TIMESCALE_SHIFT) & SBG_ECOM_LOG_PTP_TIMESCALE_MASK);
}
Loading

0 comments on commit 05c19cd

Please sign in to comment.