sbgEComBinaryLogEvent.c
Go to the documentation of this file.
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->timeOffset0 = sbgStreamBufferReadUint16LE(pInputStream);
24  pOutputData->timeOffset1 = sbgStreamBufferReadUint16LE(pInputStream);
25  pOutputData->timeOffset2 = sbgStreamBufferReadUint16LE(pInputStream);
26  pOutputData->timeOffset3 = sbgStreamBufferReadUint16LE(pInputStream);
27 
28  //
29  // Return if any error has occurred while parsing the frame
30  //
31  return sbgStreamBufferGetLastError(pInputStream);
32 }
33 
41 {
42  assert(pOutputStream);
43  assert(pInputData);
44 
45  //
46  // Write the frame payload
47  //
48  sbgStreamBufferWriteUint32LE(pOutputStream, pInputData->timeStamp);
49  sbgStreamBufferWriteUint16LE(pOutputStream, pInputData->status);
50  sbgStreamBufferWriteUint16LE(pOutputStream, pInputData->timeOffset0);
51  sbgStreamBufferWriteUint16LE(pOutputStream, pInputData->timeOffset1);
52  sbgStreamBufferWriteUint16LE(pOutputStream, pInputData->timeOffset2);
53  sbgStreamBufferWriteUint16LE(pOutputStream, pInputData->timeOffset3);
54 
55  //
56  // Return if any error has occurred while writing the frame
57  //
58  return sbgStreamBufferGetLastError(pOutputStream);
59 }
This file is used to parse received event markers binary logs.
SBG_INLINE uint16_t sbgStreamBufferReadUint16LE(SbgStreamBuffer *pHandle)
SbgErrorCode sbgEComBinaryLogWriteEvent(SbgStreamBuffer *pOutputStream, const SbgLogEvent *pInputData)
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)
SbgErrorCode sbgEComBinaryLogParseEvent(SbgStreamBuffer *pInputStream, SbgLogEvent *pOutputData)
enum _SbgErrorCode SbgErrorCode
SBG_INLINE SbgErrorCode sbgStreamBufferGetLastError(SbgStreamBuffer *pHandle)


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