8 #ifndef _RING_BUFFER_H_ 9 #define _RING_BUFFER_H_ 50 #endif // _RING_BUFFER_H_ void ringBufInit(ring_buf_t *rbuf, unsigned char *buf, int bufSize, int wordSize)
Initialize ring buffer pointers.
int ringBufReadToChar2(ring_buf_t *rbuf, unsigned char *buf, int len, unsigned char character1, unsigned char character2)
This function returns everything up to and including the first occurrence of a character. If the character is not found, then nothing (zero) is returned.
int ringBufWrite(ring_buf_t *rbuf, unsigned char *buf, int numBytes)
This function writes data to the ring buffer.
int ringBufPeek(const ring_buf_t *rbuf, unsigned char *buf, int len, int offset)
This function reads data from the ring buffer without removing any data. Same as ringBufPop without m...
int ringBufRemove(ring_buf_t *rbuf, int len)
This function removes data from the ring buffer.
int ringBufFind(const ring_buf_t *rbuf, const unsigned char *str, int len)
This function finds the index of the first matching string in the ring buffer. Returns -1 if not foun...
int ringBufRead(ring_buf_t *rbuf, unsigned char *buf, int len)
This function reads data from the ring buffer.
int ringBufReadToChar(ring_buf_t *rbuf, unsigned char *buf, int len, unsigned char character)
This function returns everything up to and including the first occurrence of a character. If the character is not found, then nothing (zero) is returned.
int ringBufClear(ring_buf_t *rbuf)
Clear the entire buffer.
int ringBufFree(const ring_buf_t *rbuf)
This function returns the number of bytes free in UART Rx buffer. Important: Buffer size is one less ...
int ringBufUsed(const ring_buf_t *rbuf)
This function returns the number of bytes currently in ring buffer.
int ringBufEmpty(const ring_buf_t *rbuf)
This function returns 1 if the buffer is empty, 0 if not empty.