sbgECom Library  4.0.1987-stable
C library to interface SBG Systems IMU/AHRS/INS
sbgEComLogSat.h File Reference

Parse space vehicles in view information log. More...

Go to the source code of this file.

Data Structures

struct  _SbgEComLogSatSignal
 
struct  _SbgEComLogSatEntry
 
struct  _SbgEComLogSatList
 

Macros

#define SBG_ECOM_SAT_MAX_NR_SATELLITES   (64)
 
#define SBG_ECOM_SAT_MAX_NR_SIGNALS   (8)
 

Typedefs

typedef enum _SbgEComSatTrackingStatus SbgEComSatTrackingStatus
 
typedef enum _SbgEComSatHealthStatus SbgEComSatHealthStatus
 
typedef enum _SbgEComSatElevationStatus SbgEComSatElevationStatus
 
typedef struct _SbgEComLogSatSignal SbgEComLogSatSignal
 
typedef struct _SbgEComLogSatEntry SbgEComLogSatEntry
 
typedef struct _SbgEComLogSatList SbgEComLogSatList
 

Enumerations

enum  _SbgEComSatTrackingStatus {
  SBG_ECOM_SAT_TRACKING_STATUS_UNKNOWN = 0 ,
  SBG_ECOM_SAT_TRACKING_STATUS_SEARCHING = 1 ,
  SBG_ECOM_SAT_TRACKING_STATUS_TRACKING_UNKNOWN = 2 ,
  SBG_ECOM_SAT_TRACKING_STATUS_TRACKING_NOT_USED = 3 ,
  SBG_ECOM_SAT_TRACKING_STATUS_TRACKING_REJECTED = 4 ,
  SBG_ECOM_SAT_TRACKING_STATUS_TRACKING_USED = 5
}
 
enum  _SbgEComSatHealthStatus {
  SBG_ECOM_SAT_HEALTH_STATUS_UNKNOWN = 0 ,
  SBG_ECOM_SAT_HEALTH_STATUS_HEALTHY = 1 ,
  SBG_ECOM_SAT_HEALTH_STATUS_UNHEALTHY = 2
}
 
enum  _SbgEComSatElevationStatus {
  SBG_ECOM_SAT_ELEVATION_STATUS_UNKNOWN = 0 ,
  SBG_ECOM_SAT_ELEVATION_STATUS_SETTING = 1 ,
  SBG_ECOM_SAT_ELEVATION_STATUS_RISING = 2
}
 

Functions

const char * sbgEComLogSatSignalGetSignalIdAsStr (const SbgEComLogSatSignal *pSignalData)
 
bool sbgEComLogSatSignalSnrIsValid (const SbgEComLogSatSignal *pSignalData)
 
SbgEComSatHealthStatus sbgEComLogSatSignalGetHealthStatus (const SbgEComLogSatSignal *pSignalData)
 
const char * sbgEComLogSatSignalGetHealthStatusAsStr (const SbgEComLogSatSignal *pSignalData)
 
SbgEComSatTrackingStatus sbgEComLogSatSignalGetTrackingStatus (const SbgEComLogSatSignal *pSignalData)
 
const char * sbgEComLogSatSignalGetTrackingStatusAsStr (const SbgEComLogSatSignal *pSignalData)
 
SbgEComLogSatSignalsbgEComLogSatEntryAdd (SbgEComLogSatEntry *pSatData, SbgEComSignalId id, SbgEComSatHealthStatus healthStatus, SbgEComSatTrackingStatus trackingStatus, bool snrValid, uint8_t snr)
 
SbgEComLogSatSignalsbgEComLogSatEntryGet (SbgEComLogSatEntry *pSatData, SbgEComSignalId id)
 
SbgEComConstellationId sbgEComLogSatEntryGetConstellationId (const SbgEComLogSatEntry *pSatData)
 
const char * sbgEComLogSatEntryGetConstellationIdAsStr (const SbgEComLogSatEntry *pSatData)
 
SbgEComSatElevationStatus sbgEComLogSatEntryGetElevationStatus (const SbgEComLogSatEntry *pSatData)
 
const char * sbgEComLogSatEntryGetElevationStatusAsStr (const SbgEComLogSatEntry *pSatData)
 
SbgEComSatHealthStatus sbgEComLogSatEntryGetHealthStatus (const SbgEComLogSatEntry *pSatData)
 
const char * sbgEComLogSatEntryGetHealthStatusAsStr (const SbgEComLogSatEntry *pSatData)
 
SbgEComSatTrackingStatus sbgEComLogSatEntryGetTrackingStatus (const SbgEComLogSatEntry *pSatData)
 
const char * sbgEComLogSatEntryGetTrackingStatusAsStr (const SbgEComLogSatEntry *pSatData)
 
void sbgEComLogSatListConstruct (SbgEComLogSatList *pSatList, uint32_t timeStamp)
 
SbgEComLogSatEntrysbgEComLogSatListAdd (SbgEComLogSatList *pSatList, uint8_t id, int8_t elevation, uint16_t azimuth, SbgEComConstellationId constellationId, SbgEComSatElevationStatus elevationStatus, SbgEComSatHealthStatus healthStatus, SbgEComSatTrackingStatus trackingStatus)
 
SbgErrorCode sbgEComLogSatListReadFromStream (SbgEComLogSatList *pSatList, SbgStreamBuffer *pStreamBuffer)
 
SbgErrorCode sbgEComLogSatListWriteToStream (const SbgEComLogSatList *pSatList, SbgStreamBuffer *pStreamBuffer)
 
SbgEComLogSatEntrysbgEComLogSatListGet (SbgEComLogSatList *pSatList, uint8_t id)
 

Detailed Description

Parse space vehicles in view information log.

Author
SBG Systems
Date
1 March 2022
License

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 to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 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.

Macro Definition Documentation

◆ SBG_ECOM_SAT_MAX_NR_SATELLITES

#define SBG_ECOM_SAT_MAX_NR_SATELLITES   (64)

Maximum number of satellites in a satellite group.

◆ SBG_ECOM_SAT_MAX_NR_SIGNALS

#define SBG_ECOM_SAT_MAX_NR_SIGNALS   (8)

Maximum number of signals per satellite.

Typedef Documentation

◆ SbgEComSatTrackingStatus

Tracking status.

The tracking status embeds the solution status when the latter is known.

All values must be strictly lower than 8.

These are on-the-wire values.

◆ SbgEComSatHealthStatus

Health status.

All values must be strictly lower than 4.

These are on-the-wire values.

◆ SbgEComSatElevationStatus

Elevation status.

All values must be strictly lower than 4.

These are on-the-wire values.

◆ SbgEComLogSatSignal

Information and status for a single signal for a Satellite.

The flags include the SNR available, health and tracking statuses.

◆ SbgEComLogSatEntry

Information and status for a single satellite.

The flags include the constellation ID, the elevation status, the health status, and the tracking status.

Satellite data and signal data each have their own health and tracking statuses. The statuses of satellite data may be a priority-based summary of the statuses of signal data, or they may reflect information that is limited to a satellite and unavailable for its signals.

The priority rules are :

  • health status : unhealthy -> healthy -> unknown
  • tracking status : tracking and used -> tracking and not used -> tracking (solution status unknown) -> searching -> unknown

For example, if satellite data have an unknown tracking status, and have three signals, one with the searching status, another with the tracking and not used status, and the last with the tracking and used status, the satellite data tracking status will be tracking and used. But if those satellite data are initially set with a healthy health status, and all three signals added have the unknown health status, the satellite data health status remains healthy.

◆ SbgEComLogSatList

List of visible satellites.

Enumeration Type Documentation

◆ _SbgEComSatTrackingStatus

Tracking status.

The tracking status embeds the solution status when the latter is known.

All values must be strictly lower than 8.

These are on-the-wire values.

Enumerator
SBG_ECOM_SAT_TRACKING_STATUS_UNKNOWN 

Unknown tracking status such as no signal / idle.

SBG_ECOM_SAT_TRACKING_STATUS_SEARCHING 

Signal is being searched and can't be used yet.

SBG_ECOM_SAT_TRACKING_STATUS_TRACKING_UNKNOWN 

Signal is tracked but don't know if used or not in the solution.

SBG_ECOM_SAT_TRACKING_STATUS_TRACKING_NOT_USED 

Signal is tracked and is not used in the solution.

SBG_ECOM_SAT_TRACKING_STATUS_TRACKING_REJECTED 

Signal is tracked and is rejected from the solution.

SBG_ECOM_SAT_TRACKING_STATUS_TRACKING_USED 

Signal is tracked and used in the solution.

◆ _SbgEComSatHealthStatus

Health status.

All values must be strictly lower than 4.

These are on-the-wire values.

Enumerator
SBG_ECOM_SAT_HEALTH_STATUS_UNKNOWN 

Don't know the satellite or the signal health status.

SBG_ECOM_SAT_HEALTH_STATUS_HEALTHY 

The satellite or the signal is healthy and can be used.

SBG_ECOM_SAT_HEALTH_STATUS_UNHEALTHY 

The satellite or the signal is not healthy and can't be used.

◆ _SbgEComSatElevationStatus

Elevation status.

All values must be strictly lower than 4.

These are on-the-wire values.

Enumerator
SBG_ECOM_SAT_ELEVATION_STATUS_UNKNOWN 

Don't know if the satellite elevation is setting or rising.

SBG_ECOM_SAT_ELEVATION_STATUS_SETTING 

The satellite elevation is setting.

SBG_ECOM_SAT_ELEVATION_STATUS_RISING 

The satellite elevation is rising

Function Documentation

◆ sbgEComLogSatSignalGetSignalIdAsStr()

const char* sbgEComLogSatSignalGetSignalIdAsStr ( const SbgEComLogSatSignal pSignalData)

Get a signal id as a read only C string.

Parameters
[in]pSignalDataSignal data.
Returns
Signal id as a read only C string.

◆ sbgEComLogSatSignalSnrIsValid()

bool sbgEComLogSatSignalSnrIsValid ( const SbgEComLogSatSignal pSignalData)

Returns true if the SNR value is valid.

Parameters
[in]pSignalDataSignal data.
Returns
true if the SNR value is valid.

◆ sbgEComLogSatSignalGetHealthStatus()

SbgEComSatHealthStatus sbgEComLogSatSignalGetHealthStatus ( const SbgEComLogSatSignal pSignalData)

Get the health status of signal data.

Parameters
[in]pSignalDataSignal data.
Returns
Health status.

◆ sbgEComLogSatSignalGetHealthStatusAsStr()

const char* sbgEComLogSatSignalGetHealthStatusAsStr ( const SbgEComLogSatSignal pSignalData)

Get the health status of signal data as a read only C string.

Parameters
[in]pSignalDataSignal data.
Returns
Health status as a read only C string.

◆ sbgEComLogSatSignalGetTrackingStatus()

SbgEComSatTrackingStatus sbgEComLogSatSignalGetTrackingStatus ( const SbgEComLogSatSignal pSignalData)

Get the tracking status of signal data.

Parameters
[in]pSignalDataSignal data.
Returns
Tracking status.

◆ sbgEComLogSatSignalGetTrackingStatusAsStr()

const char* sbgEComLogSatSignalGetTrackingStatusAsStr ( const SbgEComLogSatSignal pSignalData)

Get the tracking status of signal data as a read only C string.

Parameters
[in]pSignalDataSignal data.
Returns
Tracking status as a read only C string.

◆ sbgEComLogSatEntryAdd()

SbgEComLogSatSignal* sbgEComLogSatEntryAdd ( SbgEComLogSatEntry pSatData,
SbgEComSignalId  id,
SbgEComSatHealthStatus  healthStatus,
SbgEComSatTrackingStatus  trackingStatus,
bool  snrValid,
uint8_t  snr 
)

Add signal data to satellite data.

The health and tracking statuses of the satellite data are updated according to their respective priority rules.

Parameters
[in]pSatDataSatellite data.
[in]idSignal ID.
[in]healthStatusHealth status.
[in]trackingStatusTracking status.
[in]snrValidSet to true if the SNR value is valid.
[in]snrSignal-to-noise ratio, in dB.
Returns
Signal data, NULL if an error occurs.

◆ sbgEComLogSatEntryGet()

SbgEComLogSatSignal* sbgEComLogSatEntryGet ( SbgEComLogSatEntry pSatData,
SbgEComSignalId  id 
)

Get signal data from satellite data.

Parameters
[in]pSatDataSatellite data.
[in]idSignal ID.
Returns
Signal data, NULL if not found.

◆ sbgEComLogSatEntryGetConstellationId()

SbgEComConstellationId sbgEComLogSatEntryGetConstellationId ( const SbgEComLogSatEntry pSatData)

Get the constellation ID of satellite data.

Parameters
[in]pSatDataSatellite data.
Returns
Constellation ID.

◆ sbgEComLogSatEntryGetConstellationIdAsStr()

const char* sbgEComLogSatEntryGetConstellationIdAsStr ( const SbgEComLogSatEntry pSatData)

Get the constellation ID of satellite data as a read only C string.

Parameters
[in]pSatDataSatellite data.
Returns
Constellation ID as a read only C string.

◆ sbgEComLogSatEntryGetElevationStatus()

SbgEComSatElevationStatus sbgEComLogSatEntryGetElevationStatus ( const SbgEComLogSatEntry pSatData)

Get the elevation status of satellite data.

Parameters
[in]pSatDataSatellite data.
Returns
Elevation status.

◆ sbgEComLogSatEntryGetElevationStatusAsStr()

const char* sbgEComLogSatEntryGetElevationStatusAsStr ( const SbgEComLogSatEntry pSatData)

Get the elevation status of satellite data as a read only C string.

Parameters
[in]pSatDataSatellite data.
Returns
Elevation status as a read only C string.

◆ sbgEComLogSatEntryGetHealthStatus()

SbgEComSatHealthStatus sbgEComLogSatEntryGetHealthStatus ( const SbgEComLogSatEntry pSatData)

Get the health status of satellite data.

Parameters
[in]pSatDataSatellite data.
Returns
Health status.

◆ sbgEComLogSatEntryGetHealthStatusAsStr()

const char* sbgEComLogSatEntryGetHealthStatusAsStr ( const SbgEComLogSatEntry pSatData)

Get the health status of satellite data as a read only C string.

Parameters
[in]pSatDataSatellite data.
Returns
Health status as a read only C string.

◆ sbgEComLogSatEntryGetTrackingStatus()

SbgEComSatTrackingStatus sbgEComLogSatEntryGetTrackingStatus ( const SbgEComLogSatEntry pSatData)

Get the tracking status of satellite data.

Parameters
[in]pSatDataSatellite data.
Returns
Tracking status.

◆ sbgEComLogSatEntryGetTrackingStatusAsStr()

const char* sbgEComLogSatEntryGetTrackingStatusAsStr ( const SbgEComLogSatEntry pSatData)

Get the tracking status of satellite data as a read only C string.

Parameters
[in]pSatDataSatellite data.
Returns
Tracking status as a read only C string.

◆ sbgEComLogSatListConstruct()

void sbgEComLogSatListConstruct ( SbgEComLogSatList pSatList,
uint32_t  timeStamp 
)

Satellite list constructor.

Parameters
[in]pSatListSatellite list instance.
[in]timeStampTime stamp, in us.

◆ sbgEComLogSatListAdd()

SbgEComLogSatEntry* sbgEComLogSatListAdd ( SbgEComLogSatList pSatList,
uint8_t  id,
int8_t  elevation,
uint16_t  azimuth,
SbgEComConstellationId  constellationId,
SbgEComSatElevationStatus  elevationStatus,
SbgEComSatHealthStatus  healthStatus,
SbgEComSatTrackingStatus  trackingStatus 
)

Add a satellite entry to the list of satellites.

Parameters
[in]pSatListSatellite list instance.
[in]idSatellite ID.
[in]elevationElevation, in degrees.
[in]azimuthAzimuth, in degrees.
[in]constellationIdConstellation ID.
[in]elevationStatusElevation status.
[in]healthStatusHealth status.
[in]trackingStatusTracking status.
Returns
Satellite data, NULL if an error occurs.

◆ sbgEComLogSatListReadFromStream()

SbgErrorCode sbgEComLogSatListReadFromStream ( SbgEComLogSatList pSatList,
SbgStreamBuffer pStreamBuffer 
)

Parse data for the SBG_ECOM_LOG_GPS::_SAT message and fill the corresponding structure.

Parameters
[out]pSatListSatellite list instance.
[in]pStreamBufferInput stream buffer to read the log from.
Returns
SBG_NO_ERROR if a valid log has been read from the stream buffer.

◆ sbgEComLogSatListWriteToStream()

SbgErrorCode sbgEComLogSatListWriteToStream ( const SbgEComLogSatList pSatList,
SbgStreamBuffer pStreamBuffer 
)

Write data for the SBG_ECOM_LOG_GPS::_SAT message to the output stream buffer from the provided structure.

Parameters
[in]pSatListSatellite list instance.
[out]pStreamBufferOutput stream buffer to write the log to.
Returns
SBG_NO_ERROR if the log has been written to the stream buffer.

◆ sbgEComLogSatListGet()

SbgEComLogSatEntry* sbgEComLogSatListGet ( SbgEComLogSatList pSatList,
uint8_t  id 
)

Get a satellite entry from its ID.

Parameters
[in]pSatListSatellite list instance.
[in]idSatellite ID.
Returns
Satellite data, NULL if not found.