sbgEComBinaryLogUsbl.c
Go to the documentation of this file.
1 #include "sbgEComBinaryLogUsbl.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->latitude = sbgStreamBufferReadDoubleLE(pInputStream);
28  pOutputData->longitude = sbgStreamBufferReadDoubleLE(pInputStream);
29 
30  pOutputData->depth = sbgStreamBufferReadFloatLE(pInputStream);
31 
32  pOutputData->latitudeAccuracy = sbgStreamBufferReadFloatLE(pInputStream);
33  pOutputData->longitudeAccuracy = sbgStreamBufferReadFloatLE(pInputStream);
34  pOutputData->depthAccuracy = sbgStreamBufferReadFloatLE(pInputStream);
35 
36  //
37  // Return if any error has occurred while parsing the frame
38  //
39  return sbgStreamBufferGetLastError(pInputStream);
40 }
41 
49 {
50  //
51  // Check input arguments
52  //
53  SBG_ASSERT(pOutputStream);
54  SBG_ASSERT(pInputData);
55 
56  //
57  // Write the frame payload
58  //
59  sbgStreamBufferWriteUint32LE(pOutputStream, pInputData->timeStamp);
60  sbgStreamBufferWriteUint16LE(pOutputStream, pInputData->status);
61 
62  sbgStreamBufferWriteDoubleLE(pOutputStream, pInputData->latitude);
63  sbgStreamBufferWriteDoubleLE(pOutputStream, pInputData->longitude);
64 
65  sbgStreamBufferWriteFloatLE(pOutputStream, pInputData->depth);
66 
67  sbgStreamBufferWriteFloatLE(pOutputStream, pInputData->latitudeAccuracy);
68  sbgStreamBufferWriteFloatLE(pOutputStream, pInputData->longitudeAccuracy);
69  sbgStreamBufferWriteFloatLE(pOutputStream, pInputData->depthAccuracy);
70 
71  //
72  // Return if any error has occurred while writing the frame
73  //
74  return sbgStreamBufferGetLastError(pOutputStream);
75 }
SBG_INLINE float sbgStreamBufferReadFloatLE(SbgStreamBuffer *pHandle)
SbgErrorCode sbgEComBinaryLogParseUsblData(SbgStreamBuffer *pInputStream, SbgLogUsblData *pOutputData)
SBG_INLINE SbgErrorCode sbgStreamBufferWriteDoubleLE(SbgStreamBuffer *pHandle, double value)
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
SbgErrorCode sbgEComBinaryLogWriteUsblData(SbgStreamBuffer *pOutputStream, const SbgLogUsblData *pInputData)
SBG_INLINE double sbgStreamBufferReadDoubleLE(SbgStreamBuffer *pHandle)
This file is used to parse received USBL binary logs.
enum _SbgErrorCode SbgErrorCode
SBG_INLINE SbgErrorCode sbgStreamBufferGetLastError(SbgStreamBuffer *pHandle)


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