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


sbg_driver
Author(s):
autogenerated on Sun Jan 27 2019 03:42:20