sbgEComBinaryLogOdometer.c
Go to the documentation of this file.
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 = sbgStreamBufferReadFloatLE(pInputStream);
28 
29  //
30  // Return if any error has occurred while parsing the frame
31  //
32  return sbgStreamBufferGetLastError(pInputStream);
33 }
34 
42 {
43  //
44  // Check input arguments
45  //
46  SBG_ASSERT(pOutputStream);
47  SBG_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);
56 
57  //
58  // Return if any error has occurred while writing the frame
59  //
60  return sbgStreamBufferGetLastError(pOutputStream);
61 }
SBG_INLINE float sbgStreamBufferReadFloatLE(SbgStreamBuffer *pHandle)
SBG_INLINE uint16 sbgStreamBufferReadUint16LE(SbgStreamBuffer *pHandle)
SBG_INLINE uint32 sbgStreamBufferReadUint32LE(SbgStreamBuffer *pHandle)
This file is used to parse received odometer binary logs.
SbgErrorCode sbgEComBinaryLogWriteOdometerData(SbgStreamBuffer *pOutputStream, const SbgLogOdometerData *pInputData)
SBG_INLINE SbgErrorCode sbgStreamBufferWriteUint16LE(SbgStreamBuffer *pHandle, uint16 value)
SBG_INLINE SbgErrorCode sbgStreamBufferWriteFloatLE(SbgStreamBuffer *pHandle, float value)
SBG_INLINE SbgErrorCode sbgStreamBufferWriteUint32LE(SbgStreamBuffer *pHandle, uint32 value)
SbgErrorCode sbgEComBinaryLogParseOdometerData(SbgStreamBuffer *pInputStream, SbgLogOdometerData *pOutputData)
#define SBG_ASSERT(expression)
Definition: sbgDebug.h:52
enum _SbgErrorCode SbgErrorCode
SBG_INLINE SbgErrorCode sbgStreamBufferGetLastError(SbgStreamBuffer *pHandle)


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