sbgEComBinaryLogEvent.c
Go to the documentation of this file.
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->timeOffset0 = sbgStreamBufferReadUint16LE(pInputStream);
27  pOutputData->timeOffset1 = sbgStreamBufferReadUint16LE(pInputStream);
28  pOutputData->timeOffset2 = sbgStreamBufferReadUint16LE(pInputStream);
29  pOutputData->timeOffset3 = sbgStreamBufferReadUint16LE(pInputStream);
30 
31  //
32  // Return if any error has occurred while parsing the frame
33  //
34  return sbgStreamBufferGetLastError(pInputStream);
35 }
36 
44 {
45  //
46  // Check input arguments
47  //
48  SBG_ASSERT(pOutputStream);
49  SBG_ASSERT(pInputData);
50 
51  //
52  // Write the frame payload
53  //
54  sbgStreamBufferWriteUint32LE(pOutputStream, pInputData->timeStamp);
55  sbgStreamBufferWriteUint16LE(pOutputStream, pInputData->status);
56  sbgStreamBufferWriteUint16LE(pOutputStream, pInputData->timeOffset0);
57  sbgStreamBufferWriteUint16LE(pOutputStream, pInputData->timeOffset1);
58  sbgStreamBufferWriteUint16LE(pOutputStream, pInputData->timeOffset2);
59  sbgStreamBufferWriteUint16LE(pOutputStream, pInputData->timeOffset3);
60 
61  //
62  // Return if any error has occurred while writing the frame
63  //
64  return sbgStreamBufferGetLastError(pOutputStream);
65 }
This file is used to parse received event markers binary logs.
SBG_INLINE uint16 sbgStreamBufferReadUint16LE(SbgStreamBuffer *pHandle)
SbgErrorCode sbgEComBinaryLogWriteEvent(SbgStreamBuffer *pOutputStream, const SbgLogEvent *pInputData)
SBG_INLINE uint32 sbgStreamBufferReadUint32LE(SbgStreamBuffer *pHandle)
SBG_INLINE SbgErrorCode sbgStreamBufferWriteUint16LE(SbgStreamBuffer *pHandle, uint16 value)
SBG_INLINE SbgErrorCode sbgStreamBufferWriteUint32LE(SbgStreamBuffer *pHandle, uint32 value)
#define SBG_ASSERT(expression)
Definition: sbgDebug.h:52
SbgErrorCode sbgEComBinaryLogParseEvent(SbgStreamBuffer *pInputStream, SbgLogEvent *pOutputData)
enum _SbgErrorCode SbgErrorCode
SBG_INLINE SbgErrorCode sbgStreamBufferGetLastError(SbgStreamBuffer *pHandle)


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