unsigned short datalength
the length of the data currently in the buffer
struct struct_cBuffer cBuffer
cBuffer structure
unsigned short dataindex
the index into the buffer where the data starts
void bufferInit(cBuffer *buffer, unsigned char *start, unsigned short size)
initialize a buffer to start at a given address and have given size
unsigned char * dataptr
the physical memory address where the buffer is stored
void bufferDumpFromFront(cBuffer *buffer, unsigned short numbytes)
dump (discard) the first numbytes from the front of the buffer
unsigned char bufferGetFromFront(cBuffer *buffer)
get the first byte from the front of the buffer
void bufferFlush(cBuffer *buffer)
flush (clear) the contents of the buffer
unsigned short size
the allocated size of the buffer
unsigned char bufferGetAtIndex(cBuffer *buffer, unsigned short index)
get a byte at the specified index in the buffer (kind of like array access)
unsigned char bufferAddToEnd(cBuffer *buffer, unsigned char data)
add a byte to the end of the buffer
unsigned char bufferIsNotFull(cBuffer *buffer)
check if the buffer is full/not full (returns non-zero value if not full)