sbgEComBinaryLogDepth.c
Go to the documentation of this file.
2 
3 //----------------------------------------------------------------------//
4 //- Operations -//
5 //----------------------------------------------------------------------//
6 
8 {
9  assert(pInputStream);
10  assert(pOutputData);
11 
12  //
13  // Read the frame payload
14  //
15  pOutputData->timeStamp = sbgStreamBufferReadUint32LE(pInputStream);
16  pOutputData->status = sbgStreamBufferReadUint16LE(pInputStream);
17 
18  pOutputData->pressureAbs = sbgStreamBufferReadFloatLE(pInputStream);
19  pOutputData->altitude = sbgStreamBufferReadFloatLE(pInputStream);
20 
21  //
22  // Return if any error has occurred while parsing the frame
23  //
24  return sbgStreamBufferGetLastError(pInputStream);
25 }
26 
28 {
29  assert(pOutputStream);
30  assert(pInputData);
31 
32  //
33  // Write the frame payload
34  //
35  sbgStreamBufferWriteUint32LE(pOutputStream, pInputData->timeStamp);
36  sbgStreamBufferWriteUint16LE(pOutputStream, pInputData->status);
37 
38  sbgStreamBufferWriteFloatLE(pOutputStream, pInputData->pressureAbs);
39  sbgStreamBufferWriteFloatLE(pOutputStream, pInputData->altitude);
40 
41  //
42  // Return if any error has occurred while writing the frame
43  //
44  return sbgStreamBufferGetLastError(pOutputStream);
45 }
SBG_INLINE float sbgStreamBufferReadFloatLE(SbgStreamBuffer *pHandle)
SBG_INLINE uint16_t sbgStreamBufferReadUint16LE(SbgStreamBuffer *pHandle)
SbgErrorCode sbgEComBinaryLogWriteDepth(SbgStreamBuffer *pOutputStream, const SbgLogDepth *pInputData)
This file is used to store depth measurements.
SBG_INLINE SbgErrorCode sbgStreamBufferWriteFloatLE(SbgStreamBuffer *pHandle, float value)
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)
SbgErrorCode sbgEComBinaryLogParseDepth(SbgStreamBuffer *pInputStream, SbgLogDepth *pOutputData)


sbg_driver
Author(s): SBG Systems
autogenerated on Thu Oct 22 2020 03:47:22