sbgEComBinaryLogUtc.c
Go to the documentation of this file.
1 #include "sbgEComBinaryLogUtc.h"
2 
3 //----------------------------------------------------------------------//
4 //- Operations -//
5 //----------------------------------------------------------------------//
6 
14 {
15  assert(pInputStream);
16  assert(pOutputData);
17 
18  //
19  // Read the frame payload
20  //
21  pOutputData->timeStamp = sbgStreamBufferReadUint32LE(pInputStream);
22  pOutputData->status = sbgStreamBufferReadUint16LE(pInputStream);
23  pOutputData->year = sbgStreamBufferReadUint16LE(pInputStream);
24  pOutputData->month = sbgStreamBufferReadInt8LE(pInputStream);
25  pOutputData->day = sbgStreamBufferReadInt8LE(pInputStream);
26  pOutputData->hour = sbgStreamBufferReadInt8LE(pInputStream);
27  pOutputData->minute = sbgStreamBufferReadInt8LE(pInputStream);
28  pOutputData->second = sbgStreamBufferReadInt8LE(pInputStream);
29  pOutputData->nanoSecond = sbgStreamBufferReadInt32LE(pInputStream);
30  pOutputData->gpsTimeOfWeek = sbgStreamBufferReadUint32LE(pInputStream);
31 
32  //
33  // Return if any error has occurred while parsing the frame
34  //
35  return sbgStreamBufferGetLastError(pInputStream);
36 }
37 
45 {
46  assert(pOutputStream);
47  assert(pInputData);
48 
49  //
50  // Write the frame payload
51  //
52  sbgStreamBufferWriteUint32LE(pOutputStream, pInputData->timeStamp);
53  sbgStreamBufferWriteUint16LE(pOutputStream, pInputData->status);
54  sbgStreamBufferWriteUint16LE(pOutputStream, pInputData->year);
55  sbgStreamBufferWriteInt8LE(pOutputStream, pInputData->month);
56  sbgStreamBufferWriteInt8LE(pOutputStream, pInputData->day);
57  sbgStreamBufferWriteInt8LE(pOutputStream, pInputData->hour);
58  sbgStreamBufferWriteInt8LE(pOutputStream, pInputData->minute);
59  sbgStreamBufferWriteInt8LE(pOutputStream, pInputData->second);
60  sbgStreamBufferWriteInt32LE(pOutputStream, pInputData->nanoSecond);
61  sbgStreamBufferWriteUint32LE(pOutputStream, pInputData->gpsTimeOfWeek);
62 
63  //
64  // Return if any error has occurred while writing the frame
65  //
66  return sbgStreamBufferGetLastError(pOutputStream);
67 }
This file is used to parse received UTC binary logs.
SbgErrorCode sbgEComBinaryLogParseUtcData(SbgStreamBuffer *pInputStream, SbgLogUtcData *pOutputData)
SBG_INLINE uint16_t sbgStreamBufferReadUint16LE(SbgStreamBuffer *pHandle)
SbgErrorCode sbgEComBinaryLogWriteUtcData(SbgStreamBuffer *pOutputStream, const SbgLogUtcData *pInputData)
#define sbgStreamBufferWriteInt8LE
SBG_INLINE SbgErrorCode sbgStreamBufferWriteInt32LE(SbgStreamBuffer *pHandle, int32_t value)
#define sbgStreamBufferReadInt8LE
SBG_INLINE int32_t sbgStreamBufferReadInt32LE(SbgStreamBuffer *pHandle)
SBG_INLINE SbgErrorCode sbgStreamBufferWriteUint32LE(SbgStreamBuffer *pHandle, uint32_t value)
SBG_INLINE uint32_t sbgStreamBufferReadUint32LE(SbgStreamBuffer *pHandle)
SBG_INLINE SbgErrorCode sbgStreamBufferWriteUint16LE(SbgStreamBuffer *pHandle, uint16_t value)
enum _SbgErrorCode SbgErrorCode
SBG_INLINE SbgErrorCode sbgStreamBufferGetLastError(SbgStreamBuffer *pHandle)


sbg_driver
Author(s): SBG Systems
autogenerated on Sat Sep 3 2022 02:53:35