sbgEComBinaryLogImuRaw.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->rawAccelerometers[0] = sbgStreamBufferReadUint32LE(pInputStream);
25  pOutputData->rawAccelerometers[1] = sbgStreamBufferReadUint32LE(pInputStream);
26  pOutputData->rawAccelerometers[2] = sbgStreamBufferReadUint32LE(pInputStream);
27 
28  pOutputData->rawGyroscopes[0] = sbgStreamBufferReadUint32LE(pInputStream);
29  pOutputData->rawGyroscopes[1] = sbgStreamBufferReadUint32LE(pInputStream);
30  pOutputData->rawGyroscopes[2] = sbgStreamBufferReadUint32LE(pInputStream);
31 
32  pOutputData->rawMagnetometers[0] = sbgStreamBufferReadUint32LE(pInputStream);
33  pOutputData->rawMagnetometers[1] = sbgStreamBufferReadUint32LE(pInputStream);
34  pOutputData->rawMagnetometers[2] = sbgStreamBufferReadUint32LE(pInputStream);
35 
36  pOutputData->rawTempAccels[0] = sbgStreamBufferReadUint32LE(pInputStream);
37  pOutputData->rawTempAccels[1] = sbgStreamBufferReadUint32LE(pInputStream);
38  pOutputData->rawTempAccels[2] = sbgStreamBufferReadUint32LE(pInputStream);
39 
40  pOutputData->rawTempGyros[0] = sbgStreamBufferReadUint32LE(pInputStream);
41  pOutputData->rawTempGyros[1] = sbgStreamBufferReadUint32LE(pInputStream);
42  pOutputData->rawTempGyros[2] = sbgStreamBufferReadUint32LE(pInputStream);
43 
44  pOutputData->rawTempMags[0] = sbgStreamBufferReadUint32LE(pInputStream);
45  pOutputData->rawTempMags[1] = sbgStreamBufferReadUint32LE(pInputStream);
46  pOutputData->rawTempMags[2] = sbgStreamBufferReadUint32LE(pInputStream);
47 
48  pOutputData->rawAuxValues[0] = sbgStreamBufferReadUint32LE(pInputStream);
49  pOutputData->rawAuxValues[1] = sbgStreamBufferReadUint32LE(pInputStream);
50  pOutputData->rawAuxValues[2] = sbgStreamBufferReadUint32LE(pInputStream);
51 
52  pOutputData->rawTempAuxValues[0] = sbgStreamBufferReadUint32LE(pInputStream);
53  pOutputData->rawTempAuxValues[1] = sbgStreamBufferReadUint32LE(pInputStream);
54  pOutputData->rawTempAuxValues[2] = sbgStreamBufferReadUint32LE(pInputStream);
55 
56  //
57  // Return if any error has occurred while parsing the frame
58  //
59  return sbgStreamBufferGetLastError(pInputStream);
60 }
61 
69 {
70  assert(pOutputStream);
71  assert(pInputData);
72 
73  //
74  // Write the frame payload
75  //
76  sbgStreamBufferWriteUint32LE(pOutputStream, pInputData->timeStamp);
77  sbgStreamBufferWriteUint16LE(pOutputStream, pInputData->status);
78 
79  sbgStreamBufferWriteUint32LE(pOutputStream, pInputData->rawAccelerometers[0]);
80  sbgStreamBufferWriteUint32LE(pOutputStream, pInputData->rawAccelerometers[1]);
81  sbgStreamBufferWriteUint32LE(pOutputStream, pInputData->rawAccelerometers[2]);
82 
83  sbgStreamBufferWriteUint32LE(pOutputStream, pInputData->rawGyroscopes[0]);
84  sbgStreamBufferWriteUint32LE(pOutputStream, pInputData->rawGyroscopes[1]);
85  sbgStreamBufferWriteUint32LE(pOutputStream, pInputData->rawGyroscopes[2]);
86 
87  sbgStreamBufferWriteUint32LE(pOutputStream, pInputData->rawMagnetometers[0]);
88  sbgStreamBufferWriteUint32LE(pOutputStream, pInputData->rawMagnetometers[1]);
89  sbgStreamBufferWriteUint32LE(pOutputStream, pInputData->rawMagnetometers[2]);
90 
91  sbgStreamBufferWriteUint32LE(pOutputStream, pInputData->rawTempAccels[0]);
92  sbgStreamBufferWriteUint32LE(pOutputStream, pInputData->rawTempAccels[1]);
93  sbgStreamBufferWriteUint32LE(pOutputStream, pInputData->rawTempAccels[2]);
94 
95  sbgStreamBufferWriteUint32LE(pOutputStream, pInputData->rawTempGyros[0]);
96  sbgStreamBufferWriteUint32LE(pOutputStream, pInputData->rawTempGyros[1]);
97  sbgStreamBufferWriteUint32LE(pOutputStream, pInputData->rawTempGyros[2]);
98 
99  sbgStreamBufferWriteUint32LE(pOutputStream, pInputData->rawTempMags[0]);
100  sbgStreamBufferWriteUint32LE(pOutputStream, pInputData->rawTempMags[1]);
101  sbgStreamBufferWriteUint32LE(pOutputStream, pInputData->rawTempMags[2]);
102 
103  sbgStreamBufferWriteUint32LE(pOutputStream, pInputData->rawAuxValues[0]);
104  sbgStreamBufferWriteUint32LE(pOutputStream, pInputData->rawAuxValues[1]);
105  sbgStreamBufferWriteUint32LE(pOutputStream, pInputData->rawAuxValues[2]);
106 
107  sbgStreamBufferWriteUint32LE(pOutputStream, pInputData->rawTempAuxValues[0]);
108  sbgStreamBufferWriteUint32LE(pOutputStream, pInputData->rawTempAuxValues[1]);
109  sbgStreamBufferWriteUint32LE(pOutputStream, pInputData->rawTempAuxValues[2]);
110 
111  //
112  // Return if any error has occurred while writing the frame
113  //
114  return sbgStreamBufferGetLastError(pOutputStream);
115 }
This file is used to parse received RAW IMU logs.
SBG_INLINE uint16_t sbgStreamBufferReadUint16LE(SbgStreamBuffer *pHandle)
SbgErrorCode sbgEComBinaryLogParseImuRawData(SbgStreamBuffer *pInputStream, SbgLogImuRawData *pOutputData)
SbgErrorCode sbgEComBinaryLogWriteImuRawData(SbgStreamBuffer *pOutputStream, const SbgLogImuRawData *pInputData)
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 Sat Sep 3 2022 02:53:35