sbgEComBinaryLogOdometer.c
Go to the documentation of this file.
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 = sbgStreamBufferReadFloatLE(pInputStream);
25 
26  //
27  // Return if any error has occurred while parsing the frame
28  //
29  return sbgStreamBufferGetLastError(pInputStream);
30 }
31 
39 {
40  assert(pOutputStream);
41  assert(pInputData);
42 
43  //
44  // Write the frame payload
45  //
46  sbgStreamBufferWriteUint32LE(pOutputStream, pInputData->timeStamp);
47  sbgStreamBufferWriteUint16LE(pOutputStream, pInputData->status);
48 
49  sbgStreamBufferWriteFloatLE(pOutputStream, pInputData->velocity);
50 
51  //
52  // Return if any error has occurred while writing the frame
53  //
54  return sbgStreamBufferGetLastError(pOutputStream);
55 }
SBG_INLINE float sbgStreamBufferReadFloatLE(SbgStreamBuffer *pHandle)
SBG_INLINE uint16_t sbgStreamBufferReadUint16LE(SbgStreamBuffer *pHandle)
This file is used to parse received odometer binary logs.
SbgErrorCode sbgEComBinaryLogWriteOdometerData(SbgStreamBuffer *pOutputStream, const SbgLogOdometerData *pInputData)
SBG_INLINE SbgErrorCode sbgStreamBufferWriteFloatLE(SbgStreamBuffer *pHandle, float value)
SbgErrorCode sbgEComBinaryLogParseOdometerData(SbgStreamBuffer *pInputStream, SbgLogOdometerData *pOutputData)
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
SBG_INLINE SbgErrorCode sbgStreamBufferGetLastError(SbgStreamBuffer *pHandle)


sbg_driver
Author(s): SBG Systems
autogenerated on Thu Oct 22 2020 03:47:22