sbgEComBinaryLogUsbl.c
Go to the documentation of this file.
1 #include "sbgEComBinaryLogUsbl.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->latitude = sbgStreamBufferReadDoubleLE(pInputStream);
25  pOutputData->longitude = sbgStreamBufferReadDoubleLE(pInputStream);
26 
27  pOutputData->depth = sbgStreamBufferReadFloatLE(pInputStream);
28 
29  pOutputData->latitudeAccuracy = sbgStreamBufferReadFloatLE(pInputStream);
30  pOutputData->longitudeAccuracy = sbgStreamBufferReadFloatLE(pInputStream);
31  pOutputData->depthAccuracy = sbgStreamBufferReadFloatLE(pInputStream);
32 
33  //
34  // Return if any error has occurred while parsing the frame
35  //
36  return sbgStreamBufferGetLastError(pInputStream);
37 }
38 
46 {
47  assert(pOutputStream);
48  assert(pInputData);
49 
50  //
51  // Write the frame payload
52  //
53  sbgStreamBufferWriteUint32LE(pOutputStream, pInputData->timeStamp);
54  sbgStreamBufferWriteUint16LE(pOutputStream, pInputData->status);
55 
56  sbgStreamBufferWriteDoubleLE(pOutputStream, pInputData->latitude);
57  sbgStreamBufferWriteDoubleLE(pOutputStream, pInputData->longitude);
58 
59  sbgStreamBufferWriteFloatLE(pOutputStream, pInputData->depth);
60 
61  sbgStreamBufferWriteFloatLE(pOutputStream, pInputData->latitudeAccuracy);
62  sbgStreamBufferWriteFloatLE(pOutputStream, pInputData->longitudeAccuracy);
63  sbgStreamBufferWriteFloatLE(pOutputStream, pInputData->depthAccuracy);
64 
65  //
66  // Return if any error has occurred while writing the frame
67  //
68  return sbgStreamBufferGetLastError(pOutputStream);
69 }
SBG_INLINE float sbgStreamBufferReadFloatLE(SbgStreamBuffer *pHandle)
SbgErrorCode sbgEComBinaryLogParseUsblData(SbgStreamBuffer *pInputStream, SbgLogUsblData *pOutputData)
SBG_INLINE SbgErrorCode sbgStreamBufferWriteDoubleLE(SbgStreamBuffer *pHandle, double value)
SBG_INLINE uint16_t sbgStreamBufferReadUint16LE(SbgStreamBuffer *pHandle)
SBG_INLINE SbgErrorCode sbgStreamBufferWriteFloatLE(SbgStreamBuffer *pHandle, float value)
SBG_INLINE SbgErrorCode sbgStreamBufferWriteUint32LE(SbgStreamBuffer *pHandle, uint32_t value)
SbgErrorCode sbgEComBinaryLogWriteUsblData(SbgStreamBuffer *pOutputStream, const SbgLogUsblData *pInputData)
SBG_INLINE uint32_t sbgStreamBufferReadUint32LE(SbgStreamBuffer *pHandle)
SBG_INLINE SbgErrorCode sbgStreamBufferWriteUint16LE(SbgStreamBuffer *pHandle, uint16_t value)
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): SBG Systems
autogenerated on Sat Sep 3 2022 02:53:35