sbgEComBinaryLogDvl.c
Go to the documentation of this file.
1 #include "sbgEComBinaryLogDvl.h"
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->velocity[0] = sbgStreamBufferReadFloatLE(pInputStream);
28  pOutputData->velocity[1] = sbgStreamBufferReadFloatLE(pInputStream);
29  pOutputData->velocity[2] = sbgStreamBufferReadFloatLE(pInputStream);
30 
31  pOutputData->velocityStdDev[0] = sbgStreamBufferReadFloatLE(pInputStream);
32  pOutputData->velocityStdDev[1] = sbgStreamBufferReadFloatLE(pInputStream);
33  pOutputData->velocityStdDev[2] = sbgStreamBufferReadFloatLE(pInputStream);
34 
35  //
36  // Return if any error has occurred while parsing the frame
37  //
38  return sbgStreamBufferGetLastError(pInputStream);
39 }
40 
48 {
49  //
50  // Check input arguments
51  //
52  SBG_ASSERT(pOutputStream);
53  SBG_ASSERT(pInputData);
54 
55  //
56  // Write the frame payload
57  //
58  sbgStreamBufferWriteUint32LE(pOutputStream, pInputData->timeStamp);
59  sbgStreamBufferWriteUint16LE(pOutputStream, pInputData->status);
60 
61  sbgStreamBufferWriteFloatLE(pOutputStream, pInputData->velocity[0]);
62  sbgStreamBufferWriteFloatLE(pOutputStream, pInputData->velocity[1]);
63  sbgStreamBufferWriteFloatLE(pOutputStream, pInputData->velocity[2]);
64 
65  sbgStreamBufferWriteFloatLE(pOutputStream, pInputData->velocityStdDev[0]);
66  sbgStreamBufferWriteFloatLE(pOutputStream, pInputData->velocityStdDev[1]);
67  sbgStreamBufferWriteFloatLE(pOutputStream, pInputData->velocityStdDev[2]);
68 
69  //
70  // Return if any error has occurred while writing the frame
71  //
72  return sbgStreamBufferGetLastError(pOutputStream);
73 }
This file is used to parse received DVL binary logs.
SBG_INLINE float sbgStreamBufferReadFloatLE(SbgStreamBuffer *pHandle)
SbgErrorCode sbgEComBinaryLogWriteDvlData(SbgStreamBuffer *pOutputStream, const SbgLogDvlData *pInputData)
SBG_INLINE uint16 sbgStreamBufferReadUint16LE(SbgStreamBuffer *pHandle)
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
SbgErrorCode sbgEComBinaryLogParseDvlData(SbgStreamBuffer *pInputStream, SbgLogDvlData *pOutputData)
SBG_INLINE SbgErrorCode sbgStreamBufferGetLastError(SbgStreamBuffer *pHandle)


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