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 }
_SbgLogDepth
Definition: sbgEComBinaryLogDepth.h:46
sbgStreamBufferWriteFloatLE
SBG_INLINE SbgErrorCode sbgStreamBufferWriteFloatLE(SbgStreamBuffer *pHandle, float value)
Definition: sbgStreamBufferLE.h:1753
sbgStreamBufferGetLastError
SBG_INLINE SbgErrorCode sbgStreamBufferGetLastError(SbgStreamBuffer *pHandle)
Definition: sbgStreamBufferCommon.h:274
_SbgLogDepth::pressureAbs
float pressureAbs
Definition: sbgEComBinaryLogDepth.h:50
sbgStreamBufferReadUint16LE
SBG_INLINE uint16_t sbgStreamBufferReadUint16LE(SbgStreamBuffer *pHandle)
Definition: sbgStreamBufferLE.h:106
sbgStreamBufferWriteUint16LE
SBG_INLINE SbgErrorCode sbgStreamBufferWriteUint16LE(SbgStreamBuffer *pHandle, uint16_t value)
Definition: sbgStreamBufferLE.h:1250
_SbgLogDepth::status
uint16_t status
Definition: sbgEComBinaryLogDepth.h:49
_SbgLogDepth::timeStamp
uint32_t timeStamp
Definition: sbgEComBinaryLogDepth.h:48
sbgStreamBufferReadUint32LE
SBG_INLINE uint32_t sbgStreamBufferReadUint32LE(SbgStreamBuffer *pHandle)
Definition: sbgStreamBufferLE.h:386
_SbgStreamBuffer
Definition: sbgStreamBufferCommon.h:188
SbgErrorCode
enum _SbgErrorCode SbgErrorCode
Header file that defines all error codes for SBG Systems libraries.
sbgEComBinaryLogDepth.h
This file is used to store depth measurements.
sbgStreamBufferReadFloatLE
SBG_INLINE float sbgStreamBufferReadFloatLE(SbgStreamBuffer *pHandle)
Definition: sbgStreamBufferLE.h:1086
sbgStreamBufferWriteUint32LE
SBG_INLINE SbgErrorCode sbgStreamBufferWriteUint32LE(SbgStreamBuffer *pHandle, uint32_t value)
Definition: sbgStreamBufferLE.h:1499
sbgEComBinaryLogParseDepth
SbgErrorCode sbgEComBinaryLogParseDepth(SbgStreamBuffer *pInputStream, SbgLogDepth *pOutputData)
Definition: sbgEComBinaryLogDepth.c:7
sbgEComBinaryLogWriteDepth
SbgErrorCode sbgEComBinaryLogWriteDepth(SbgStreamBuffer *pOutputStream, const SbgLogDepth *pInputData)
Definition: sbgEComBinaryLogDepth.c:27
_SbgLogDepth::altitude
float altitude
Definition: sbgEComBinaryLogDepth.h:51


sbg_driver
Author(s): SBG Systems
autogenerated on Fri Oct 11 2024 02:13:40