sbgECom
1.11.920-stable
|
This file is used to parse received UTC binary logs. More...
#include <sbgCommon.h>
#include <streamBuffer/sbgStreamBuffer.h>
Go to the source code of this file.
Data Structures | |
struct | _SbgLogUtcData |
Macros | |
#define | SBG_ECOM_CLOCK_STATUS_SHIFT (1u) |
#define | SBG_ECOM_CLOCK_STATUS_MASK (0x000Fu) |
#define | SBG_ECOM_CLOCK_UTC_STATUS_SHIFT (6u) |
#define | SBG_ECOM_CLOCK_UTC_STATUS_MASK (0x000Fu) |
#define | SBG_ECOM_CLOCK_STABLE_INPUT (0x0001u << 0) |
#define | SBG_ECOM_CLOCK_UTC_SYNC (0x0001u << 5) |
Typedefs | |
typedef enum _SbgEComClockStatus | SbgEComClockStatus |
typedef enum _SbgEComClockUtcStatus | SbgEComClockUtcStatus |
typedef struct _SbgLogUtcData | SbgLogUtcData |
Enumerations | |
enum | _SbgEComClockStatus { SBG_ECOM_CLOCK_ERROR = 0, SBG_ECOM_CLOCK_FREE_RUNNING = 1, SBG_ECOM_CLOCK_STEERING = 2, SBG_ECOM_CLOCK_VALID = 3 } |
enum | _SbgEComClockUtcStatus { SBG_ECOM_UTC_INVALID = 0, SBG_ECOM_UTC_NO_LEAP_SEC = 1, SBG_ECOM_UTC_VALID = 2 } |
Functions | |
SBG_INLINE SbgEComClockStatus | sbgEComLogUtcGetClockStatus (uint16_t status) |
SBG_INLINE SbgEComClockUtcStatus | sbgEComLogUtcGetClockUtcStatus (uint16_t status) |
SBG_INLINE uint16_t | sbgEComLogUtcBuildClockStatus (SbgEComClockStatus clockStatus, SbgEComClockUtcStatus utcStatus, uint16_t masks) |
SbgErrorCode | sbgEComBinaryLogParseUtcData (SbgStreamBuffer *pInputStream, SbgLogUtcData *pOutputData) |
SbgErrorCode | sbgEComBinaryLogWriteUtcData (SbgStreamBuffer *pOutputStream, const SbgLogUtcData *pInputData) |
This file is used to parse received UTC binary logs.
Copyright (C) 2007-2013, SBG Systems SAS. All rights reserved.
This source code is intended for use only by SBG Systems SAS and those that have explicit written permission to use it from SBG Systems SAS.
THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
#define SBG_ECOM_CLOCK_STATUS_SHIFT (1u) |
Clock status and UTC time status definitions.Shift used to extract the clock status part.
Referenced by sbgEComLogUtcBuildClockStatus(), and sbgEComLogUtcGetClockStatus().
#define SBG_ECOM_CLOCK_STATUS_MASK (0x000Fu) |
Mask used to keep only the clock status part.
Referenced by sbgEComLogUtcBuildClockStatus(), and sbgEComLogUtcGetClockStatus().
#define SBG_ECOM_CLOCK_UTC_STATUS_SHIFT (6u) |
Shift used to extract the clock UTC status part.
Referenced by sbgEComLogUtcBuildClockStatus(), and sbgEComLogUtcGetClockUtcStatus().
#define SBG_ECOM_CLOCK_UTC_STATUS_MASK (0x000Fu) |
Mask used to keep only the clock UTC status part.
Referenced by sbgEComLogUtcBuildClockStatus(), and sbgEComLogUtcGetClockUtcStatus().
#define SBG_ECOM_CLOCK_STABLE_INPUT (0x0001u << 0) |
Clock status mask definitions.Set to 1 if a stable input clock could be used to synchronized the internal clock.
#define SBG_ECOM_CLOCK_UTC_SYNC (0x0001u << 5) |
The UTC time is synchronized with a PPS.
typedef enum _SbgEComClockStatus SbgEComClockStatus |
Clock status enum.
typedef enum _SbgEComClockUtcStatus SbgEComClockUtcStatus |
Status for the UTC time data.
typedef struct _SbgLogUtcData SbgLogUtcData |
Structure that stores data for the SBG_ECOM_LOG_UTC_TIME message.
enum _SbgEComClockStatus |
Clock status enum.
Status for the UTC time data.
SBG_INLINE SbgEComClockStatus sbgEComLogUtcGetClockStatus | ( | uint16_t | status | ) |
Method used to read the clock status from a status field.
[in] | status | Status field to extract the clock status from it. |
References SBG_ECOM_CLOCK_STATUS_MASK, and SBG_ECOM_CLOCK_STATUS_SHIFT.
SBG_INLINE SbgEComClockUtcStatus sbgEComLogUtcGetClockUtcStatus | ( | uint16_t | status | ) |
Method used to read the UTC time status from a clock status field.
[in] | status | Status field to extract the UTC time status from it. |
References SBG_ECOM_CLOCK_UTC_STATUS_MASK, and SBG_ECOM_CLOCK_UTC_STATUS_SHIFT.
SBG_INLINE uint16_t sbgEComLogUtcBuildClockStatus | ( | SbgEComClockStatus | clockStatus, |
SbgEComClockUtcStatus | utcStatus, | ||
uint16_t | masks | ||
) |
Method used to write the clock status field.
[in] | clockStatus | The clock status to set. |
[in] | utcStatus | The UTC time status to set. |
[in] | masks | Bit mask to set. |
References SBG_ECOM_CLOCK_STATUS_MASK, SBG_ECOM_CLOCK_STATUS_SHIFT, SBG_ECOM_CLOCK_UTC_STATUS_MASK, and SBG_ECOM_CLOCK_UTC_STATUS_SHIFT.
SbgErrorCode sbgEComBinaryLogParseUtcData | ( | SbgStreamBuffer * | pInputStream, |
SbgLogUtcData * | pOutputData | ||
) |
Parse data for the SBG_ECOM_LOG_UTC_DATA message and fill the corresponding structure.
[in] | pInputStream | Input stream buffer to read the payload from. |
[out] | pOutputData | Pointer on the output structure that stores parsed data. |
SbgErrorCode sbgEComBinaryLogWriteUtcData | ( | SbgStreamBuffer * | pOutputStream, |
const SbgLogUtcData * | pInputData | ||
) |
Write data for the SBG_ECOM_LOG_UTC_DATA message to the output stream buffer from the provided structure.
[out] | pOutputStream | Output stream buffer to write the payload to. |
[in] | pInputData | Pointer on the input structure that stores data to write. |