sbgEComBinaryLogPressure.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 
27  pOutputData->pressure = sbgStreamBufferReadFloatLE(pInputStream);
28  pOutputData->height = sbgStreamBufferReadFloatLE(pInputStream);
29 
30  //
31  // Return if any error has occurred while parsing the frame
32  //
33  return sbgStreamBufferGetLastError(pInputStream);
34 }
35 
43 {
44  //
45  // Check input arguments
46  //
47  SBG_ASSERT(pOutputStream);
48  SBG_ASSERT(pInputData);
49 
50  //
51  // Write the frame payload
52  //
53  sbgStreamBufferWriteUint32LE(pOutputStream, pInputData->timeStamp);
54  sbgStreamBufferWriteUint16LE(pOutputStream, pInputData->status);
55 
56  sbgStreamBufferWriteFloatLE(pOutputStream, pInputData->pressure);
57  sbgStreamBufferWriteFloatLE(pOutputStream, pInputData->height);
58 
59  //
60  // Return if any error has occurred while writing the frame
61  //
62  return sbgStreamBufferGetLastError(pOutputStream);
63 }
SBG_INLINE float sbgStreamBufferReadFloatLE(SbgStreamBuffer *pHandle)
SbgErrorCode sbgEComBinaryLogParsePressureData(SbgStreamBuffer *pInputStream, SbgLogPressureData *pOutputData)
SBG_INLINE uint16 sbgStreamBufferReadUint16LE(SbgStreamBuffer *pHandle)
SbgErrorCode sbgEComBinaryLogWritePressureData(SbgStreamBuffer *pOutputStream, const SbgLogPressureData *pInputData)
This file is used to parse received Pressure binary logs.
SBG_INLINE uint32 sbgStreamBufferReadUint32LE(SbgStreamBuffer *pHandle)
SBG_INLINE SbgErrorCode sbgStreamBufferWriteUint16LE(SbgStreamBuffer *pHandle, uint16 value)
SBG_INLINE SbgErrorCode sbgStreamBufferWriteFloatLE(SbgStreamBuffer *pHandle, float value)
SBG_INLINE SbgErrorCode sbgStreamBufferWriteUint32LE(SbgStreamBuffer *pHandle, uint32 value)
#define SBG_ASSERT(expression)
Definition: sbgDebug.h:52
enum _SbgErrorCode SbgErrorCode
SBG_INLINE SbgErrorCode sbgStreamBufferGetLastError(SbgStreamBuffer *pHandle)


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