sbgECom Library  4.0.1987-stable
C library to interface SBG Systems IMU/AHRS/INS
sbgStreamBufferCommon.h
Go to the documentation of this file.
1 
33 #ifndef SBG_STREAM_BUFFER_COMMON_H
34 #define SBG_STREAM_BUFFER_COMMON_H
35 
36 #include <sbgCommon.h>
37 
38 //----------------------------------------------------------------------//
39 //- General definitions -//
40 //----------------------------------------------------------------------//
41 
45 #if SBG_CONFIG_BIG_ENDIAN == 1
49  #define sbgStreamBufferReadUint16 sbgStreamBufferReadUint16BE
50  #define sbgStreamBufferReadInt16 sbgStreamBufferReadInt16BE
51 
52  #define sbgStreamBufferReadUint24 sbgStreamBufferReadUint24BE
53  #define sbgStreamBufferReadInt24 sbgStreamBufferReadInt24BE
54 
55  #define sbgStreamBufferReadUint32 sbgStreamBufferReadUint32BE
56  #define sbgStreamBufferReadInt32 sbgStreamBufferReadInt32BE
57 
58  #define sbgStreamBufferReadUint40 sbgStreamBufferReadUint40BE
59  #define sbgStreamBufferReadInt40 sbgStreamBufferReadInt40BE
60 
61  #define sbgStreamBufferReadUint48 sbgStreamBufferReadUint48BE
62  #define sbgStreamBufferReadInt48 sbgStreamBufferReadInt48BE
63 
64  #define sbgStreamBufferReadUint56 sbgStreamBufferReadUint56BE
65  #define sbgStreamBufferReadInt56 sbgStreamBufferReadInt56BE
66 
67  #define sbgStreamBufferReadUint64 sbgStreamBufferReadUint64BE
68  #define sbgStreamBufferReadInt64 sbgStreamBufferReadInt64BE
69 
70  #define sbgStreamBufferReadSizeT32 sbgStreamBufferReadSizeT32BE
71  #define sbgStreamBufferReadSizeT64 sbgStreamBufferReadSizeT64BE
72 
73  #define sbgStreamBufferReadFloat sbgStreamBufferReadFloatBE
74  #define sbgStreamBufferReadDouble sbgStreamBufferReadDoubleBE
75 
76  #define sbgStreamBufferWriteUint16 sbgStreamBufferWriteUint16BE
77  #define sbgStreamBufferWriteInt16 sbgStreamBufferWriteInt16BE
78 
79  #define sbgStreamBufferWriteUint24 sbgStreamBufferWriteUint24BE
80  #define sbgStreamBufferWriteInt24 sbgStreamBufferWriteInt24BE
81 
82  #define sbgStreamBufferWriteUint32 sbgStreamBufferWriteUint32BE
83  #define sbgStreamBufferWriteInt32 sbgStreamBufferWriteInt32BE
84 
85  #define sbgStreamBufferWriteUint64 sbgStreamBufferWriteUint64BE
86  #define sbgStreamBufferWriteInt64 sbgStreamBufferWriteInt64BE
87 
88  #define sbgStreamBufferWriteSizeT32 sbgStreamBufferWriteSizeT32BE
89  #define sbgStreamBufferWriteSizeT64 sbgStreamBufferWriteSizeT64BE
90 
91  #define sbgStreamBufferWriteFloat sbgStreamBufferWriteFloatBE
92  #define sbgStreamBufferWriteDouble sbgStreamBufferWriteDoubleBE
93 
94  #define sbgStreamBufferReadString sbgStreamBufferReadStringBE
95  #define sbgStreamBufferWriteString sbgStreamBufferWriteStringBE
96 #else
100  #define sbgStreamBufferReadUint16 sbgStreamBufferReadUint16LE
101  #define sbgStreamBufferReadInt16 sbgStreamBufferReadInt16LE
102 
103  #define sbgStreamBufferReadUint24 sbgStreamBufferReadUint24LE
104  #define sbgStreamBufferReadInt24 sbgStreamBufferReadInt24LE
105 
106  #define sbgStreamBufferReadUint32 sbgStreamBufferReadUint32LE
107  #define sbgStreamBufferReadInt32 sbgStreamBufferReadInt32LE
108 
109  #define sbgStreamBufferReadUint40 sbgStreamBufferReadUint40LE
110  #define sbgStreamBufferReadInt40 sbgStreamBufferReadInt40LE
111 
112  #define sbgStreamBufferReadUint48 sbgStreamBufferReadUint48LE
113  #define sbgStreamBufferReadInt48 sbgStreamBufferReadInt48LE
114 
115  #define sbgStreamBufferReadUint56 sbgStreamBufferReadUint56LE
116  #define sbgStreamBufferReadInt56 sbgStreamBufferReadInt56LE
117 
118  #define sbgStreamBufferReadUint64 sbgStreamBufferReadUint64LE
119  #define sbgStreamBufferReadInt64 sbgStreamBufferReadInt64LE
120 
121  #define sbgStreamBufferReadSizeT32 sbgStreamBufferReadSizeT32LE
122  #define sbgStreamBufferReadSizeT64 sbgStreamBufferReadSizeT64LE
123 
124  #define sbgStreamBufferReadFloat sbgStreamBufferReadFloatLE
125  #define sbgStreamBufferReadDouble sbgStreamBufferReadDoubleLE
126 
127  #define sbgStreamBufferWriteUint16 sbgStreamBufferWriteUint16LE
128  #define sbgStreamBufferWriteInt16 sbgStreamBufferWriteInt16LE
129 
130  #define sbgStreamBufferWriteUint24 sbgStreamBufferWriteUint24LE
131  #define sbgStreamBufferWriteInt24 sbgStreamBufferWriteInt24LE
132 
133  #define sbgStreamBufferWriteUint32 sbgStreamBufferWriteUint32LE
134  #define sbgStreamBufferWriteInt32 sbgStreamBufferWriteInt32LE
135 
136  #define sbgStreamBufferWriteUint64 sbgStreamBufferWriteUint64LE
137  #define sbgStreamBufferWriteInt64 sbgStreamBufferWriteInt64LE
138 
139  #define sbgStreamBufferWriteSizeT32 sbgStreamBufferWriteSizeT32LE
140  #define sbgStreamBufferWriteSizeT64 sbgStreamBufferWriteSizeT64LE
141 
142  #define sbgStreamBufferWriteFloat sbgStreamBufferWriteFloatLE
143  #define sbgStreamBufferWriteDouble sbgStreamBufferWriteDoubleLE
144 
145  #define sbgStreamBufferReadString sbgStreamBufferReadStringLE
146  #define sbgStreamBufferWriteString sbgStreamBufferWriteStringLE
147 #endif
148 
153 #define sbgStreamBufferReadUint8LE sbgStreamBufferReadUint8
154 #define sbgStreamBufferReadInt8LE sbgStreamBufferReadInt8
155 #define sbgStreamBufferReadBooleanLE sbgStreamBufferReadBoolean
156 #define sbgStreamBufferReadBufferLE sbgStreamBufferReadBuffer
157 
158 #define sbgStreamBufferWriteUint8LE sbgStreamBufferWriteUint8
159 #define sbgStreamBufferWriteInt8LE sbgStreamBufferWriteInt8
160 #define sbgStreamBufferWriteBooleanLE sbgStreamBufferWriteBoolean
161 #define sbgStreamBufferWriteBufferLE sbgStreamBufferWriteBuffer
162 
163 #define sbgStreamBufferReadUint8BE sbgStreamBufferReadUint8
164 #define sbgStreamBufferReadInt8BE sbgStreamBufferReadInt8
165 #define sbgStreamBufferReadBooleanBE sbgStreamBufferReadBoolean
166 #define sbgStreamBufferReadBufferBE sbgStreamBufferReadBuffer
167 
168 #define sbgStreamBufferWriteUint8BE sbgStreamBufferWriteUint8
169 #define sbgStreamBufferWriteInt8BE sbgStreamBufferWriteInt8
170 #define sbgStreamBufferWriteBooleanBE sbgStreamBufferWriteBoolean
171 #define sbgStreamBufferWriteBufferBE sbgStreamBufferWriteBuffer
172 
173 //----------------------------------------------------------------------//
174 //- Structure definitions -//
175 //----------------------------------------------------------------------//
176 
180 typedef enum _SbgSBMode
181 {
185 
189 typedef enum _SbgSBSeekOrigin
190 {
194  SB_SEEK_END
196 
200 typedef struct _SbgStreamBuffer
201 {
203  size_t bufferSize;
204  uint8_t *pBufferPtr;
205  uint8_t *pCurrentPtr;
208 
209 //----------------------------------------------------------------------//
210 //- Common operations methods -//
211 //----------------------------------------------------------------------//
212 
221 SBG_INLINE SbgErrorCode sbgStreamBufferInitForWrite(SbgStreamBuffer *pHandle, void *pLinkedBuffer, size_t bufferSize)
222 {
223  assert(pHandle);
224  assert(pLinkedBuffer);
225 
226  //
227  // Initialize stream parameters
228  //
229  pHandle->modes = SB_MODE_WRITE;
230  pHandle->bufferSize = bufferSize;
231  pHandle->errorCode = SBG_NO_ERROR;
232 
233  //
234  // Initialize the buffer
235  //
236  pHandle->pBufferPtr = (uint8_t*)pLinkedBuffer;
237  pHandle->pCurrentPtr = (uint8_t*)pLinkedBuffer;
238 
239  //
240  // For now, we don't handle any error, maybe we could add checks in debug mode only
241  //
242  return SBG_NO_ERROR;
243 }
244 
253 SBG_INLINE SbgErrorCode sbgStreamBufferInitForRead(SbgStreamBuffer *pHandle, const void *pLinkedBuffer, size_t bufferSize)
254 {
255  assert(pHandle);
256  assert(pLinkedBuffer);
257 
258  //
259  // Initialize stream parameters
260  //
261  pHandle->modes = SB_MODE_READ;
262  pHandle->bufferSize = bufferSize;
263  pHandle->errorCode = SBG_NO_ERROR;
264 
265  //
266  // Initialize the buffer
267  //
268  pHandle->pBufferPtr = (uint8_t*)pLinkedBuffer;
269  pHandle->pCurrentPtr = (uint8_t*)pLinkedBuffer;
270 
271  //
272  // For now, we don't handle any error, maybe we could add checks in debug mode only
273  //
274  return SBG_NO_ERROR;
275 }
276 
284 {
285  assert(pHandle);
286 
287  //
288  // Return error code
289  //
290  return pHandle->errorCode;
291 }
292 
299 {
300  assert(pHandle);
301 
302  //
303  // Return error code
304  //
305  pHandle->errorCode = SBG_NO_ERROR;
306 }
307 
319 {
320  assert(pHandle);
321 
322  //
323  // Return the linked buffer size
324  //
325  return pHandle->bufferSize;
326 }
327 
339 {
340  assert(pHandle);
341 
342  //
343  // Return the number of bytes between the begin of the stream and the current pointer
344  //
345  return ((size_t)pHandle->pCurrentPtr - (size_t)pHandle->pBufferPtr);
346 }
347 
358 {
359  assert(pHandle);
360 
361  //
362  // Return the space left in bytes
363  //
364  return sbgStreamBufferGetSize(pHandle) - sbgStreamBufferGetLength(pHandle);
365 }
366 
376 {
377  assert(pHandle);
378 
379  //
380  // Test if we haven't already an error
381  //
382  if (pHandle->errorCode == SBG_NO_ERROR)
383  {
384  //
385  // According to the origin reference point
386  //
387  switch (origin)
388  {
389  case SB_SEEK_SET:
390  pHandle->pCurrentPtr = pHandle->pBufferPtr + offset;
391  break;
392  case SB_SEEK_CUR_INC:
393  pHandle->pCurrentPtr += offset;
394  break;
395  case SB_SEEK_CUR_DEC:
396  pHandle->pCurrentPtr -= offset;
397  break;
398  case SB_SEEK_END:
399  pHandle->pCurrentPtr = pHandle->pBufferPtr + (pHandle->bufferSize - offset);
400  break;
401  default:
402  pHandle->errorCode = SBG_INVALID_PARAMETER;
403  SBG_LOG_ERROR(pHandle->errorCode, "Invalid origin parameter");
404  }
405 
406  //
407  // Make sure that no error has occurred
408  //
409  if (pHandle->errorCode == SBG_NO_ERROR)
410  {
411  //
412  // Test if the current ptr is still within the buffer bounds
413  //
414  if (pHandle->pCurrentPtr < pHandle->pBufferPtr)
415  {
416  //
417  // We are before the buffer so clamp to the begining of the buffer and raise an error
418  //
419  pHandle->pCurrentPtr = pHandle->pBufferPtr;
420  pHandle->errorCode = SBG_BUFFER_OVERFLOW;
421 
422  //
423  // Stream buffer underflow
424  //
425  SBG_LOG_ERROR(pHandle->errorCode, "Trying to seek before the buffer");
426  }
427  else if (pHandle->pCurrentPtr > pHandle->pBufferPtr + pHandle->bufferSize)
428  {
429  //
430  // We are after the buffer so clamp to the end of the buffer and raise an error
431  //
432  pHandle->pCurrentPtr = pHandle->pBufferPtr + pHandle->bufferSize;
433  pHandle->errorCode = SBG_BUFFER_OVERFLOW;
434 
435  //
436  // Stream buffer overflow
437  //
438  SBG_LOG_ERROR(pHandle->errorCode, "Trying to seek after the buffer");
439  }
440  }
441  }
442 
443  return pHandle->errorCode;
444 }
445 
453 {
454  assert(pHandle);
455 
456  return (size_t)pHandle->pCurrentPtr - (size_t)pHandle->pBufferPtr;
457 }
458 
466 {
467  assert(pHandle);
468 
469  return pHandle->pBufferPtr;
470 }
471 
479 {
480  assert(pHandle);
481 
482  return pHandle->pCurrentPtr;
483 }
484 
485 //----------------------------------------------------------------------//
486 //- Read operations methods -//
487 //----------------------------------------------------------------------//
488 
496 {
497  assert(pHandle);
498 
499  //
500  // Test if we haven't already an error
501  //
502  if (pHandle->errorCode == SBG_NO_ERROR)
503  {
504  //
505  // Test if we can access this item
506  //
507  if (sbgStreamBufferGetSpace(pHandle) >= sizeof(int8_t))
508  {
509  //
510  // Read the byte
511  //
512  return *((int8_t*)(pHandle->pCurrentPtr++));
513  }
514  else
515  {
516  //
517  // We have a buffer overflow
518  //
519  pHandle->errorCode = SBG_BUFFER_OVERFLOW;
520  }
521  }
522 
523  //
524  // If we are here, it means we have an error so return 0
525  //
526  return 0;
527 }
528 
536 {
537  assert(pHandle);
538 
539  //
540  // Test if we haven't already an error
541  //
542  if (pHandle->errorCode == SBG_NO_ERROR)
543  {
544  //
545  // Test if we can access this item
546  //
547  if (sbgStreamBufferGetSpace(pHandle) >= sizeof(uint8_t))
548  {
549  //
550  // Read the byte
551  //
552  return *((uint8_t*)(pHandle->pCurrentPtr++));
553  }
554  else
555  {
556  //
557  // We have a buffer overflow
558  //
559  pHandle->errorCode = SBG_BUFFER_OVERFLOW;
560  }
561  }
562 
563  //
564  // If we are here, it means we have an error so return 0
565  //
566  return 0;
567 }
568 
576 {
577  assert(pHandle);
578 
579  //
580  // Test if we haven't already an error
581  //
582  if (pHandle->errorCode == SBG_NO_ERROR)
583  {
584  //
585  // Test if we can access this item
586  //
587  if (sbgStreamBufferGetSpace(pHandle) >= sizeof(uint8_t))
588  {
589  //
590  // Read the byte and check if the value is different than zero or not
591  //
592  if (*((uint8_t*)(pHandle->pCurrentPtr++)))
593  {
594  return true;
595  }
596  else
597  {
598  return false;
599  }
600  }
601  else
602  {
603  //
604  // We have a buffer overflow
605  //
606  pHandle->errorCode = SBG_BUFFER_OVERFLOW;
607  }
608  }
609 
610  //
611  // If we are here, it means we have an error so return false
612  //
613  return false;
614 }
615 
624 SBG_INLINE SbgErrorCode sbgStreamBufferReadBuffer(SbgStreamBuffer *pHandle, void *pBuffer, size_t numBytesToRead)
625 {
626  assert(pHandle);
627  assert((pBuffer) || (numBytesToRead == 0));
628 
629  //
630  // Test if we haven't already an error
631  //
632  if (pHandle->errorCode == SBG_NO_ERROR)
633  {
634  //
635  // Test if enough bytes in stream
636  //
637  if (sbgStreamBufferGetSpace(pHandle) >= numBytesToRead)
638  {
639  //
640  // Copy from the stream buffer to the output buffer
641  //
642  memcpy(pBuffer, pHandle->pCurrentPtr, numBytesToRead);
643 
644  //
645  // Update the current pointer
646  //
647  pHandle->pCurrentPtr += numBytesToRead;
648  }
649  else
650  {
651  //
652  // Not enough data in stream
653  //
654  pHandle->errorCode = SBG_BUFFER_OVERFLOW;
655  }
656  }
657 
658  return pHandle->errorCode;
659 }
660 
661 //----------------------------------------------------------------------//
662 //- Write operations methods -//
663 //----------------------------------------------------------------------//
664 
673 {
674  assert(pHandle);
675 
676  //
677  // Test if we haven't already an error
678  //
679  if (pHandle->errorCode == SBG_NO_ERROR)
680  {
681  //
682  // Test if we can access this item
683  //
684  if (sbgStreamBufferGetSpace(pHandle) >= sizeof(int8_t))
685  {
686  //
687  // Write each byte
688  //
689  *(pHandle->pCurrentPtr++) = (int8_t)(value);
690  }
691  else
692  {
693  //
694  // We are accessing a data that is outside the stream buffer
695  //
696  pHandle->errorCode = SBG_BUFFER_OVERFLOW;
697  }
698  }
699 
700  return pHandle->errorCode;
701 }
702 
711 {
712  assert(pHandle);
713 
714  //
715  // Test if we haven't already an error
716  //
717  if (pHandle->errorCode == SBG_NO_ERROR)
718  {
719  //
720  // Test if we can access this item
721  //
722  if (sbgStreamBufferGetSpace(pHandle) >= sizeof(uint8_t))
723  {
724  //
725  // Write each byte
726  //
727  *(pHandle->pCurrentPtr++) = (uint8_t)(value);
728  }
729  else
730  {
731  //
732  // We are accessing a data that is outside the stream buffer
733  //
734  pHandle->errorCode = SBG_BUFFER_OVERFLOW;
735  }
736  }
737 
738  return pHandle->errorCode;
739 }
740 
749 {
750  assert(pHandle);
751 
752  //
753  // Test if we haven't already an error
754  //
755  if (pHandle->errorCode == SBG_NO_ERROR)
756  {
757  //
758  // Test if we can access this item
759  //
760  if (sbgStreamBufferGetSpace(pHandle) >= sizeof(uint8_t))
761  {
762  //
763  // Write the boolean as an uint8_t value (1 byte)
764  //
765  if (value)
766  {
767  *(pHandle->pCurrentPtr++) = 1;
768  }
769  else
770  {
771  *(pHandle->pCurrentPtr++) = 0;
772  }
773  }
774  else
775  {
776  //
777  // We are accessing a data that is outside the stream buffer
778  //
779  pHandle->errorCode = SBG_BUFFER_OVERFLOW;
780  }
781  }
782 
783  return pHandle->errorCode;
784 }
785 
794 SBG_INLINE SbgErrorCode sbgStreamBufferWriteBuffer(SbgStreamBuffer *pHandle, const void *pBuffer, size_t numBytesToWrite)
795 {
796  assert(pHandle);
797  assert((pBuffer) || (numBytesToWrite == 0));
798 
799  //
800  // Test if we haven't already an error
801  //
802  if (pHandle->errorCode == SBG_NO_ERROR)
803  {
804  //
805  // Test if we can access this item
806  //
807  if (sbgStreamBufferGetSpace(pHandle) >= numBytesToWrite)
808  {
809  //
810  // Copy from the stream buffer to the output buffer
811  //
812  memcpy(pHandle->pCurrentPtr, pBuffer, numBytesToWrite);
813 
814  //
815  // Update the current pointer
816  //
817  pHandle->pCurrentPtr += numBytesToWrite;
818  }
819  else
820  {
821  //
822  // We are accessing a data that is outside the stream buffer
823  //
824  pHandle->errorCode = SBG_BUFFER_OVERFLOW;
825  }
826  }
827 
828  return pHandle->errorCode;
829 }
830 
831 #endif // SBG_STREAM_BUFFER_COMMON_H
Main header for the SBG Systems common C library.
#define SBG_INLINE
Definition: sbgDefines.h:227
enum _SbgErrorCode SbgErrorCode
@ SBG_BUFFER_OVERFLOW
Definition: sbgErrorCodes.h:59
@ SBG_NO_ERROR
Definition: sbgErrorCodes.h:48
@ SBG_INVALID_PARAMETER
Definition: sbgErrorCodes.h:60
_SbgSBSeekOrigin
Definition: sbgStreamBufferCommon.h:190
@ SB_SEEK_END
Definition: sbgStreamBufferCommon.h:194
@ SB_SEEK_SET
Definition: sbgStreamBufferCommon.h:191
@ SB_SEEK_CUR_DEC
Definition: sbgStreamBufferCommon.h:193
@ SB_SEEK_CUR_INC
Definition: sbgStreamBufferCommon.h:192
SBG_INLINE int8_t sbgStreamBufferReadInt8(SbgStreamBuffer *pHandle)
Definition: sbgStreamBufferCommon.h:495
enum _SbgSBSeekOrigin SbgSBSeekOrigin
SBG_INLINE SbgErrorCode sbgStreamBufferWriteInt8(SbgStreamBuffer *pHandle, int8_t value)
Definition: sbgStreamBufferCommon.h:672
SBG_INLINE void sbgStreamBufferClearLastError(SbgStreamBuffer *pHandle)
Definition: sbgStreamBufferCommon.h:298
SBG_INLINE void * sbgStreamBufferGetCursor(const SbgStreamBuffer *pHandle)
Definition: sbgStreamBufferCommon.h:478
SBG_INLINE SbgErrorCode sbgStreamBufferWriteUint8(SbgStreamBuffer *pHandle, uint8_t value)
Definition: sbgStreamBufferCommon.h:710
SBG_INLINE SbgErrorCode sbgStreamBufferSeek(SbgStreamBuffer *pHandle, size_t offset, SbgSBSeekOrigin origin)
Definition: sbgStreamBufferCommon.h:375
enum _SbgSBMode SbgSBMode
SBG_INLINE SbgErrorCode sbgStreamBufferInitForWrite(SbgStreamBuffer *pHandle, void *pLinkedBuffer, size_t bufferSize)
Definition: sbgStreamBufferCommon.h:221
SBG_INLINE SbgErrorCode sbgStreamBufferReadBuffer(SbgStreamBuffer *pHandle, void *pBuffer, size_t numBytesToRead)
Definition: sbgStreamBufferCommon.h:624
SBG_INLINE SbgErrorCode sbgStreamBufferWriteBuffer(SbgStreamBuffer *pHandle, const void *pBuffer, size_t numBytesToWrite)
Definition: sbgStreamBufferCommon.h:794
SBG_INLINE SbgErrorCode sbgStreamBufferWriteBoolean(SbgStreamBuffer *pHandle, bool value)
Definition: sbgStreamBufferCommon.h:748
SBG_INLINE bool sbgStreamBufferReadBoolean(SbgStreamBuffer *pHandle)
Definition: sbgStreamBufferCommon.h:575
SBG_INLINE SbgErrorCode sbgStreamBufferInitForRead(SbgStreamBuffer *pHandle, const void *pLinkedBuffer, size_t bufferSize)
Definition: sbgStreamBufferCommon.h:253
SBG_INLINE size_t sbgStreamBufferGetSpace(const SbgStreamBuffer *pHandle)
Definition: sbgStreamBufferCommon.h:357
SBG_INLINE void * sbgStreamBufferGetLinkedBuffer(const SbgStreamBuffer *pHandle)
Definition: sbgStreamBufferCommon.h:465
SBG_INLINE SbgErrorCode sbgStreamBufferGetLastError(const SbgStreamBuffer *pHandle)
Definition: sbgStreamBufferCommon.h:283
SBG_INLINE size_t sbgStreamBufferTell(const SbgStreamBuffer *pHandle)
Definition: sbgStreamBufferCommon.h:452
SBG_INLINE size_t sbgStreamBufferGetLength(const SbgStreamBuffer *pHandle)
Definition: sbgStreamBufferCommon.h:338
SBG_INLINE size_t sbgStreamBufferGetSize(const SbgStreamBuffer *pHandle)
Definition: sbgStreamBufferCommon.h:318
struct _SbgStreamBuffer SbgStreamBuffer
_SbgSBMode
Definition: sbgStreamBufferCommon.h:181
@ SB_MODE_WRITE
Definition: sbgStreamBufferCommon.h:183
@ SB_MODE_READ
Definition: sbgStreamBufferCommon.h:182
SBG_INLINE uint8_t sbgStreamBufferReadUint8(SbgStreamBuffer *pHandle)
Definition: sbgStreamBufferCommon.h:535
Definition: sbgStreamBufferCommon.h:201
SbgErrorCode errorCode
Definition: sbgStreamBufferCommon.h:206
uint8_t * pCurrentPtr
Definition: sbgStreamBufferCommon.h:205
uint8_t * pBufferPtr
Definition: sbgStreamBufferCommon.h:204
size_t bufferSize
Definition: sbgStreamBufferCommon.h:203
SbgSBMode modes
Definition: sbgStreamBufferCommon.h:202