sbgEComBinaryLogDvl.c
Go to the documentation of this file.
1 #include "sbgEComBinaryLogDvl.h"
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 
24  pOutputData->velocity[0] = sbgStreamBufferReadFloatLE(pInputStream);
25  pOutputData->velocity[1] = sbgStreamBufferReadFloatLE(pInputStream);
26  pOutputData->velocity[2] = sbgStreamBufferReadFloatLE(pInputStream);
27 
28  pOutputData->velocityQuality[0] = sbgStreamBufferReadFloatLE(pInputStream);
29  pOutputData->velocityQuality[1] = sbgStreamBufferReadFloatLE(pInputStream);
30  pOutputData->velocityQuality[2] = sbgStreamBufferReadFloatLE(pInputStream);
31 
32  //
33  // Return if any error has occurred while parsing the frame
34  //
35  return sbgStreamBufferGetLastError(pInputStream);
36 }
37 
45 {
46  assert(pOutputStream);
47  assert(pInputData);
48 
49  //
50  // Write the frame payload
51  //
52  sbgStreamBufferWriteUint32LE(pOutputStream, pInputData->timeStamp);
53  sbgStreamBufferWriteUint16LE(pOutputStream, pInputData->status);
54 
55  sbgStreamBufferWriteFloatLE(pOutputStream, pInputData->velocity[0]);
56  sbgStreamBufferWriteFloatLE(pOutputStream, pInputData->velocity[1]);
57  sbgStreamBufferWriteFloatLE(pOutputStream, pInputData->velocity[2]);
58 
59  sbgStreamBufferWriteFloatLE(pOutputStream, pInputData->velocityQuality[0]);
60  sbgStreamBufferWriteFloatLE(pOutputStream, pInputData->velocityQuality[1]);
61  sbgStreamBufferWriteFloatLE(pOutputStream, pInputData->velocityQuality[2]);
62 
63  //
64  // Return if any error has occurred while writing the frame
65  //
66  return sbgStreamBufferGetLastError(pOutputStream);
67 }
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_t sbgStreamBufferReadUint16LE(SbgStreamBuffer *pHandle)
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
SbgErrorCode sbgEComBinaryLogParseDvlData(SbgStreamBuffer *pInputStream, SbgLogDvlData *pOutputData)
SBG_INLINE SbgErrorCode sbgStreamBufferGetLastError(SbgStreamBuffer *pHandle)


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