Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependents: TYBLE16_simple_data_logger TYBLE16_MP3_Air
ACore
Buffer | |
typedef struct __ac_buffer | ac_buffer_t |
void | ac_buffer_init (ac_buffer_t *pBuf, const uint8_t *data, size_t size) |
Initialize ac_buffer using underlying byte array, set ac_buffer's length to 0 (empty) | |
void | ac_buffer_dup (ac_buffer_t *pBuf, const ac_buffer_t *pBufIn) |
Copy pBufIn to pBuf. | |
static const uint8_t * | ac_buffer_data (const ac_buffer_t *pBuf) |
Get buffer's underlying byte array. | |
static size_t | ac_buffer_size (const ac_buffer_t *pBuf) |
Get buffer's size. | |
static ac_buffer_t * | ac_buffer_next (const ac_buffer_t *pBuf) |
Get next buffer in chain. | |
static void | ac_buffer_set_next (ac_buffer_t *pBuf, ac_buffer_t *pNextBuf) |
Set next buffer in chain. | |
void | ac_buffer_append (ac_buffer_t *pBuf, ac_buffer_t *pAppBuf) |
Append buffer to end of chain. | |
void | ac_buffer_split (ac_buffer_t *pStartBuf, ac_buffer_t *pEndBuf, ac_buffer_t *pBuf, size_t length) |
Truncate pBuf to length bytes and save the remaining bytes in pEndBuf. | |
void | ac_buffer_dump (ac_buffer_t *pBuf) |
Dump a ac_buffer's content to stdout (useful for debugging) | |
Buffer Builder | |
typedef struct __ac_buffer_builder | ac_buffer_builder_t |
void | ac_buffer_builder_write_be (ac_buffer_builder_t *pBuilder, const uint8_t *buf, size_t size) |
Write data to big endian ac_buffer (on a LE architecture, byte order will be swapped) | |
void | ac_buffer_builder_write_le (ac_buffer_builder_t *pBuilder, const uint8_t *buf, size_t size) |
Write data to little endian ac_buffer (on a LE architecture, byte order will be preserved) | |
void | ac_buffer_builder_write_be_at (ac_buffer_builder_t *pBuilder, size_t pos, const uint8_t *buf, size_t size) |
Write data to big endian ac_buffer at specific position (on a LE architecture, byte order will be swapped) | |
void | ac_buffer_builder_write_le_at (ac_buffer_builder_t *pBuilder, size_t pos, const uint8_t *buf, size_t size) |
Write data to little endian ac_buffer at specific position (on a LE architecture, byte order will be preserved) | |
void | ac_buffer_builder_init (ac_buffer_builder_t *pBuilder, uint8_t *data, size_t size) |
Initialize ac_buffer builder. | |
void | ac_buffer_builder_from_buffer (ac_buffer_builder_t *pBuilder) |
Initialize ac_buffer builder from underlying ac_buffer. | |
void | ac_buffer_builder_reset (ac_buffer_builder_t *pBuilder) |
Reset ac_buffer builder. | |
void | ac_buffer_builder_set_full (ac_buffer_builder_t *pBuilder) |
Set ac_buffer builder's ac_buffer to full size. | |
static size_t | ac_buffer_builder_length (ac_buffer_builder_t *pBuilder) |
Get ac_buffer builder's length. | |
static void | ac_buffer_builder_set_length (ac_buffer_builder_t *pBuilder, size_t length) |
Set ac_buffer builder's length. | |
static uint8_t * | ac_buffer_builder_write_position (ac_buffer_builder_t *pBuilder) |
Get ac_buffer builder's pointer to write position. | |
static size_t | ac_buffer_builder_write_offset (ac_buffer_builder_t *pBuilder) |
Get ac_buffer builder's write offset. | |
static void | ac_buffer_builder_set_write_offset (ac_buffer_builder_t *pBuilder, size_t off) |
Set ac_buffer builder's write offset. | |
static size_t | ac_buffer_builder_read_offset (ac_buffer_builder_t *pBuilder) |
Get ac_buffer builder's read offset. | |
static void | ac_buffer_builder_set_read_offset (ac_buffer_builder_t *pBuilder, size_t off) |
Set ac_buffer builder's read offset. | |
static ac_buffer_t * | ac_buffer_builder_buffer (ac_buffer_builder_t *pBuilder) |
Get ac_buffer builder's underlying ac_buffer. | |
static size_t | ac_buffer_builder_space (ac_buffer_builder_t *pBuilder) |
Get space in ac_buffer builder. | |
static bool | ac_buffer_builder_empty (ac_buffer_builder_t *pBuilder) |
Is ac_buffer builder empty. | |
static bool | ac_buffer_full (ac_buffer_builder_t *pBuilder) |
Is ac_buffer builder full. | |
static void | ac_buffer_builder_write_nu8 (ac_buffer_builder_t *pBuilder, uint8_t hu8) |
Write 8-bit value in ac_buffer builder. | |
static void | ac_buffer_builder_write_nu16 (ac_buffer_builder_t *pBuilder, uint16_t hu16) |
Write 16-bit value in ac_buffer builder. | |
static void | ac_buffer_builder_write_nu24 (ac_buffer_builder_t *pBuilder, uint32_t hu24) |
Write 24-bit value in ac_buffer builder. | |
static void | ac_buffer_builder_write_nu32 (ac_buffer_builder_t *pBuilder, uint32_t hu32) |
Write 32-bit value in ac_buffer builder. | |
static void | ac_buffer_builder_write_nu64 (ac_buffer_builder_t *pBuilder, uint64_t hu64) |
Write 64-bit value in ac_buffer builder. | |
static void | ac_buffer_builder_write_n_bytes (ac_buffer_builder_t *pBuilder, const uint8_t *data, size_t size) |
Write n-bytes value in ac_buffer builder. | |
static void | ac_buffer_builder_write_nu8_at (ac_buffer_builder_t *pBuilder, size_t off, uint8_t hu8) |
Write 8-bit value in ac_buffer builder at specified position. | |
static void | ac_buffer_builder_write_nu16_at (ac_buffer_builder_t *pBuilder, size_t off, uint16_t hu16) |
Write 16-bit value in ac_buffer builder at specified position. | |
static void | ac_buffer_builder_write_nu24_at (ac_buffer_builder_t *pBuilder, size_t off, uint32_t hu24) |
Write 24-bit value in ac_buffer builder at specified position. | |
static void | ac_buffer_builder_write_nu32_at (ac_buffer_builder_t *pBuilder, size_t off, uint32_t hu32) |
Write 32-bit value in ac_buffer builder at specified position. | |
static void | ac_buffer_builder_write_nu64_at (ac_buffer_builder_t *pBuilder, size_t off, uint64_t hu64) |
Write 64-bit value in ac_buffer builder at specified position. | |
static void | ac_buffer_builder_write_n_bytes_at (ac_buffer_builder_t *pBuilder, size_t off, const uint8_t *data, size_t size) |
Write n-bytes value in ac_buffer builder at specified position. | |
void | ac_buffer_builder_write_n_skip (ac_buffer_builder_t *pBuilder, size_t size) |
Skip n-bytes in ac_buffer builder. | |
void | ac_buffer_builder_copy_n_bytes (ac_buffer_builder_t *pBuilderOut, ac_buffer_t *pBufIn, size_t size) |
Copy n bytes from buffer to builder. | |
void | ac_buffer_builder_compact (ac_buffer_builder_t *pBuilder) |
Compact builder Will move underlying buffer's byte to start of allocated buffer. | |
static size_t | ac_buffer_builder_writable (ac_buffer_builder_t *pBuilder) |
Get number of writable bytes in ac_buffer builder. | |
Buffer Reader | |
void | ac_buffer_read_be (ac_buffer_t *pBuf, uint8_t *buf, size_t size) |
Read n-bytes in big-endian format from buffer reader and advance read posiion. | |
void | ac_buffer_read_le (ac_buffer_t *pBuf, uint8_t *buf, size_t size) |
Read n-bytes in little-endian format from buffer reader and advance read posiion. | |
static uint8_t | ac_buffer_read_nu8 (ac_buffer_t *pBuf) |
Read 8-bit value from buffer reader and advance read posiion. | |
static uint16_t | ac_buffer_read_nu16 (ac_buffer_t *pBuf) |
Read BE 16-bit value from buffer reader and advance read posiion. | |
static uint32_t | ac_buffer_read_nu24 (ac_buffer_t *pBuf) |
Read BE 24-bit value from buffer reader and advance read posiion. | |
static uint32_t | ac_buffer_read_nu32 (ac_buffer_t *pBuf) |
Read BE 32-bit value from buffer reader and advance read posiion. | |
static uint64_t | ac_buffer_read_nu64 (ac_buffer_t *pBuf) |
Read BE 64-bit value from buffer reader and advance read posiion. | |
static void | ac_buffer_read_n_bytes (ac_buffer_t *pBuf, uint8_t *data, size_t size) |
Read n bytes from buffer reader and advance read posiion. | |
void | ac_buffer_read_n_skip (ac_buffer_t *pBuf, size_t size) |
Skip n bytes from buffer reader and advance read posiion. | |
size_t | ac_buffer_reader_readable (const ac_buffer_t *pBuf) |
Get number of bytes readable from buffer. | |
const uint8_t * | ac_buffer_reader_current_buffer_pointer (ac_buffer_t *pBuf) |
Get a pointer to the current position within this buffer's current backing array. | |
size_t | ac_buffer_reader_current_buffer_length (ac_buffer_t *pBuf) |
Get the number of bytes readable within the current backing array. | |
bool | ac_buffer_reader_cmp_bytes (const ac_buffer_t *pBuf, const uint8_t *bytes, size_t length) |
Compare buffer with array (does not advance read position) | |
bool | ac_buffer_reader_cmp (const ac_buffer_t *pBuf1, const ac_buffer_t *pBuf2) |
Compare buffer with array (does not advance read position) |
Function Documentation
void ac_buffer_append | ( | ac_buffer_t * | pBuf, |
ac_buffer_t * | pAppBuf | ||
) |
Append buffer to end of chain.
- Parameters:
-
pBuf pointer to ac_buffer_t structure pAppBuf pointer to buffer to append to chain
Definition at line 47 of file ac_buffer.c.
static ac_buffer_t* ac_buffer_builder_buffer | ( | ac_buffer_builder_t * | pBuilder ) | [static] |
Get ac_buffer builder's underlying ac_buffer.
- Parameters:
-
pBuilder ac_buffer builder
- Returns:
- ac_buffer
Definition at line 185 of file ac_buffer_builder.h.
void ac_buffer_builder_compact | ( | ac_buffer_builder_t * | pBuilder ) |
Compact builder Will move underlying buffer's byte to start of allocated buffer.
- Parameters:
-
pBuilder ac_buffer builder
Definition at line 112 of file ac_buffer_builder.c.
void ac_buffer_builder_copy_n_bytes | ( | ac_buffer_builder_t * | pBuilderOut, |
ac_buffer_t * | pBufIn, | ||
size_t | size | ||
) |
Copy n bytes from buffer to builder.
- Parameters:
-
pBuilderOut ac_buffer builder pBufIn the input buffer size number of bytes to copy
Definition at line 97 of file ac_buffer_builder.c.
static bool ac_buffer_builder_empty | ( | ac_buffer_builder_t * | pBuilder ) | [static] |
Is ac_buffer builder empty.
- Parameters:
-
pBuilder ac_buffer builder
- Returns:
- true if ac_buffer builder is empty
Definition at line 203 of file ac_buffer_builder.h.
void ac_buffer_builder_from_buffer | ( | ac_buffer_builder_t * | pBuilder ) |
Initialize ac_buffer builder from underlying ac_buffer.
- Parameters:
-
pBuilder ac_buffer builder to init
Definition at line 39 of file ac_buffer_builder.c.
void ac_buffer_builder_init | ( | ac_buffer_builder_t * | pBuilder, |
uint8_t * | data, | ||
size_t | size | ||
) |
Initialize ac_buffer builder.
- Parameters:
-
pBuilder ac_buffer builder to init data pointer to byte array to use size of byte array
Definition at line 32 of file ac_buffer_builder.c.
static size_t ac_buffer_builder_length | ( | ac_buffer_builder_t * | pBuilder ) | [static] |
Get ac_buffer builder's length.
- Parameters:
-
pBuilder ac_buffer builder to get length of
- Returns:
- number of valid bytes in ac_buffer
Definition at line 104 of file ac_buffer_builder.h.
static size_t ac_buffer_builder_read_offset | ( | ac_buffer_builder_t * | pBuilder ) | [static] |
Get ac_buffer builder's read offset.
- Parameters:
-
pBuilder ac_buffer builder
- Returns:
- read offset
Definition at line 159 of file ac_buffer_builder.h.
void ac_buffer_builder_reset | ( | ac_buffer_builder_t * | pBuilder ) |
Reset ac_buffer builder.
- Parameters:
-
pBuilder ac_buffer builder to reset
Definition at line 46 of file ac_buffer_builder.c.
void ac_buffer_builder_set_full | ( | ac_buffer_builder_t * | pBuilder ) |
Set ac_buffer builder's ac_buffer to full size.
- Parameters:
-
pBuilder ac_buffer builder to set to full size
Definition at line 51 of file ac_buffer_builder.c.
static void ac_buffer_builder_set_length | ( | ac_buffer_builder_t * | pBuilder, |
size_t | length | ||
) | [static] |
Set ac_buffer builder's length.
- Parameters:
-
pBuilder ac_buffer builder to set length of length number of valid bytes in ac_buffer
Definition at line 113 of file ac_buffer_builder.h.
static void ac_buffer_builder_set_read_offset | ( | ac_buffer_builder_t * | pBuilder, |
size_t | off | ||
) | [static] |
Set ac_buffer builder's read offset.
- Parameters:
-
pBuilder ac_buffer builder off new read offset
Definition at line 168 of file ac_buffer_builder.h.
static void ac_buffer_builder_set_write_offset | ( | ac_buffer_builder_t * | pBuilder, |
size_t | off | ||
) | [static] |
Set ac_buffer builder's write offset.
- Parameters:
-
pBuilder ac_buffer builder off new write offset
Definition at line 143 of file ac_buffer_builder.h.
static size_t ac_buffer_builder_space | ( | ac_buffer_builder_t * | pBuilder ) | [static] |
Get space in ac_buffer builder.
- Parameters:
-
pBuilder ac_buffer builder
- Returns:
- number of free bytes in ac_buffer builder
Definition at line 194 of file ac_buffer_builder.h.
static size_t ac_buffer_builder_writable | ( | ac_buffer_builder_t * | pBuilder ) | [static] |
Get number of writable bytes in ac_buffer builder.
- Parameters:
-
pBuilder ac_buffer builder
- Returns:
- number of free bytes in ac_buffer builder
Definition at line 356 of file ac_buffer_builder.h.
void ac_buffer_builder_write_be | ( | ac_buffer_builder_t * | pBuilder, |
const uint8_t * | buf, | ||
size_t | size | ||
) |
Write data to big endian ac_buffer (on a LE architecture, byte order will be swapped)
- Parameters:
-
pBuilder ac_buffer builder to use buf pointer to data size the data size
Definition at line 56 of file ac_buffer_builder.c.
void ac_buffer_builder_write_be_at | ( | ac_buffer_builder_t * | pBuilder, |
size_t | pos, | ||
const uint8_t * | buf, | ||
size_t | size | ||
) |
Write data to big endian ac_buffer at specific position (on a LE architecture, byte order will be swapped)
- Parameters:
-
pBuilder ac_buffer builder to use pos position in ac_buffer to write from buf pointer to data size the data size
Definition at line 75 of file ac_buffer_builder.c.
void ac_buffer_builder_write_le | ( | ac_buffer_builder_t * | pBuilder, |
const uint8_t * | buf, | ||
size_t | size | ||
) |
Write data to little endian ac_buffer (on a LE architecture, byte order will be preserved)
- Parameters:
-
pBuilder ac_buffer builder to use buf pointer to data size the data size
Definition at line 68 of file ac_buffer_builder.c.
void ac_buffer_builder_write_le_at | ( | ac_buffer_builder_t * | pBuilder, |
size_t | pos, | ||
const uint8_t * | buf, | ||
size_t | size | ||
) |
Write data to little endian ac_buffer at specific position (on a LE architecture, byte order will be preserved)
- Parameters:
-
pBuilder ac_buffer builder to use pos position in ac_buffer to write from buf pointer to data size the data size
Definition at line 83 of file ac_buffer_builder.c.
static void ac_buffer_builder_write_n_bytes | ( | ac_buffer_builder_t * | pBuilder, |
const uint8_t * | data, | ||
size_t | size | ||
) | [static] |
Write n-bytes value in ac_buffer builder.
- Parameters:
-
pBuilder ac_buffer builder data data to write size data length
Definition at line 267 of file ac_buffer_builder.h.
static void ac_buffer_builder_write_n_bytes_at | ( | ac_buffer_builder_t * | pBuilder, |
size_t | off, | ||
const uint8_t * | data, | ||
size_t | size | ||
) | [static] |
Write n-bytes value in ac_buffer builder at specified position.
- Parameters:
-
pBuilder ac_buffer builder off offset at which to write data data to write size data length
Definition at line 328 of file ac_buffer_builder.h.
void ac_buffer_builder_write_n_skip | ( | ac_buffer_builder_t * | pBuilder, |
size_t | size | ||
) |
Skip n-bytes in ac_buffer builder.
- Parameters:
-
pBuilder ac_buffer builder size number of bytes to skip
Definition at line 91 of file ac_buffer_builder.c.
static void ac_buffer_builder_write_nu16 | ( | ac_buffer_builder_t * | pBuilder, |
uint16_t | hu16 | ||
) | [static] |
Write 16-bit value in ac_buffer builder.
- Parameters:
-
pBuilder ac_buffer builder hu16 16-bit value to write in big-endian format
Definition at line 230 of file ac_buffer_builder.h.
static void ac_buffer_builder_write_nu16_at | ( | ac_buffer_builder_t * | pBuilder, |
size_t | off, | ||
uint16_t | hu16 | ||
) | [static] |
Write 16-bit value in ac_buffer builder at specified position.
- Parameters:
-
pBuilder ac_buffer builder off offset at which to write hu16 16-bit value to write
Definition at line 287 of file ac_buffer_builder.h.
static void ac_buffer_builder_write_nu24 | ( | ac_buffer_builder_t * | pBuilder, |
uint32_t | hu24 | ||
) | [static] |
Write 24-bit value in ac_buffer builder.
- Parameters:
-
pBuilder ac_buffer builder hu24 24-bit value to write in big-endian format
Definition at line 239 of file ac_buffer_builder.h.
static void ac_buffer_builder_write_nu24_at | ( | ac_buffer_builder_t * | pBuilder, |
size_t | off, | ||
uint32_t | hu24 | ||
) | [static] |
Write 24-bit value in ac_buffer builder at specified position.
- Parameters:
-
pBuilder ac_buffer builder off offset at which to write hu24 24-bit value to write
Definition at line 297 of file ac_buffer_builder.h.
static void ac_buffer_builder_write_nu32 | ( | ac_buffer_builder_t * | pBuilder, |
uint32_t | hu32 | ||
) | [static] |
Write 32-bit value in ac_buffer builder.
- Parameters:
-
pBuilder ac_buffer builder hu32 32-bit value to write in big-endian format
Definition at line 248 of file ac_buffer_builder.h.
static void ac_buffer_builder_write_nu32_at | ( | ac_buffer_builder_t * | pBuilder, |
size_t | off, | ||
uint32_t | hu32 | ||
) | [static] |
Write 32-bit value in ac_buffer builder at specified position.
- Parameters:
-
pBuilder ac_buffer builder off offset at which to write hu32 32-bit value to write
Definition at line 307 of file ac_buffer_builder.h.
static void ac_buffer_builder_write_nu64 | ( | ac_buffer_builder_t * | pBuilder, |
uint64_t | hu64 | ||
) | [static] |
Write 64-bit value in ac_buffer builder.
- Parameters:
-
pBuilder ac_buffer builder hu64 64-bit value to write in big-endian format
Definition at line 257 of file ac_buffer_builder.h.
static void ac_buffer_builder_write_nu64_at | ( | ac_buffer_builder_t * | pBuilder, |
size_t | off, | ||
uint64_t | hu64 | ||
) | [static] |
Write 64-bit value in ac_buffer builder at specified position.
- Parameters:
-
pBuilder ac_buffer builder off offset at which to write hu64 64-bit value to write
Definition at line 317 of file ac_buffer_builder.h.
static void ac_buffer_builder_write_nu8 | ( | ac_buffer_builder_t * | pBuilder, |
uint8_t | hu8 | ||
) | [static] |
Write 8-bit value in ac_buffer builder.
- Parameters:
-
pBuilder ac_buffer builder hu8 8-bit value to write
Definition at line 221 of file ac_buffer_builder.h.
static void ac_buffer_builder_write_nu8_at | ( | ac_buffer_builder_t * | pBuilder, |
size_t | off, | ||
uint8_t | hu8 | ||
) | [static] |
Write 8-bit value in ac_buffer builder at specified position.
- Parameters:
-
pBuilder ac_buffer builder off offset at which to write hu8 8-bit value to write
Definition at line 277 of file ac_buffer_builder.h.
static size_t ac_buffer_builder_write_offset | ( | ac_buffer_builder_t * | pBuilder ) | [static] |
Get ac_buffer builder's write offset.
- Parameters:
-
pBuilder ac_buffer builder
- Returns:
- write offset
Definition at line 134 of file ac_buffer_builder.h.
static uint8_t* ac_buffer_builder_write_position | ( | ac_buffer_builder_t * | pBuilder ) | [static] |
Get ac_buffer builder's pointer to write position.
- Parameters:
-
pBuilder ac_buffer builder
- Returns:
- pointer to write position
Definition at line 125 of file ac_buffer_builder.h.
static const uint8_t* ac_buffer_data | ( | const ac_buffer_t * | pBuf ) | [static] |
Get buffer's underlying byte array.
- Parameters:
-
pBuf pointer to ac_buffer_t structure
- Returns:
- underlying array
Definition at line 63 of file ac_buffer.h.
void ac_buffer_dump | ( | ac_buffer_t * | pBuf ) |
Dump a ac_buffer's content to stdout (useful for debugging)
- Parameters:
-
pBuf pointer to ac_buffer_t structure
Definition at line 74 of file ac_buffer.c.
void ac_buffer_dup | ( | ac_buffer_t * | pBuf, |
const ac_buffer_t * | pBufIn | ||
) |
Copy pBufIn to pBuf.
- Parameters:
-
pBuf pointer to ac_buffer_t structure to initialize pBufIn the source buffer
Definition at line 40 of file ac_buffer.c.
static bool ac_buffer_full | ( | ac_buffer_builder_t * | pBuilder ) | [static] |
Is ac_buffer builder full.
- Parameters:
-
pBuilder ac_buffer builder
- Returns:
- true if ac_buffer builder is full
Definition at line 212 of file ac_buffer_builder.h.
void ac_buffer_init | ( | ac_buffer_t * | pBuf, |
const uint8_t * | data, | ||
size_t | size | ||
) |
Initialize ac_buffer using underlying byte array, set ac_buffer's length to 0 (empty)
- Parameters:
-
pBuf pointer to ac_buffer_t structure to initialize data byte array to use size size of byte array
Definition at line 32 of file ac_buffer.c.
static ac_buffer_t* ac_buffer_next | ( | const ac_buffer_t * | pBuf ) | [static] |
Get next buffer in chain.
- Parameters:
-
pBuf pointer to ac_buffer_t structure
- Returns:
- pointer to next buffer
Definition at line 81 of file ac_buffer.h.
void ac_buffer_read_be | ( | ac_buffer_t * | pBuf, |
uint8_t * | buf, | ||
size_t | size | ||
) |
Read n-bytes in big-endian format from buffer reader and advance read posiion.
- Parameters:
-
pBuf the buffer to read from buf the array to write to size the number of bytes to read
Definition at line 46 of file ac_buffer_reader.c.
void ac_buffer_read_le | ( | ac_buffer_t * | pBuf, |
uint8_t * | buf, | ||
size_t | size | ||
) |
Read n-bytes in little-endian format from buffer reader and advance read posiion.
- Parameters:
-
pBuf the buffer to read from buf the array to write to size the number of bytes to read
Definition at line 60 of file ac_buffer_reader.c.
static void ac_buffer_read_n_bytes | ( | ac_buffer_t * | pBuf, |
uint8_t * | data, | ||
size_t | size | ||
) | [static] |
Read n bytes from buffer reader and advance read posiion.
- Parameters:
-
pBuf the buffer to read from data the array to write bytes to size the number of bytes to read
Definition at line 116 of file ac_buffer_reader.h.
void ac_buffer_read_n_skip | ( | ac_buffer_t * | pBuf, |
size_t | size | ||
) |
Skip n bytes from buffer reader and advance read posiion.
- Parameters:
-
pBuf the buffer to read from size the number of bytes to skip
Definition at line 75 of file ac_buffer_reader.c.
static uint16_t ac_buffer_read_nu16 | ( | ac_buffer_t * | pBuf ) | [static] |
Read BE 16-bit value from buffer reader and advance read posiion.
- Parameters:
-
pBuf the buffer to read from
- Returns:
- 16-bit value read
Definition at line 71 of file ac_buffer_reader.h.
static uint32_t ac_buffer_read_nu24 | ( | ac_buffer_t * | pBuf ) | [static] |
Read BE 24-bit value from buffer reader and advance read posiion.
- Parameters:
-
pBuf the buffer to read from
- Returns:
- 24-bit value read
Definition at line 82 of file ac_buffer_reader.h.
static uint32_t ac_buffer_read_nu32 | ( | ac_buffer_t * | pBuf ) | [static] |
Read BE 32-bit value from buffer reader and advance read posiion.
- Parameters:
-
pBuf the buffer to read from
- Returns:
- 32-bit value read
Definition at line 93 of file ac_buffer_reader.h.
static uint64_t ac_buffer_read_nu64 | ( | ac_buffer_t * | pBuf ) | [static] |
Read BE 64-bit value from buffer reader and advance read posiion.
- Parameters:
-
pBuf the buffer to read from
- Returns:
- 64-bit value read
Definition at line 104 of file ac_buffer_reader.h.
static uint8_t ac_buffer_read_nu8 | ( | ac_buffer_t * | pBuf ) | [static] |
Read 8-bit value from buffer reader and advance read posiion.
- Parameters:
-
pBuf the buffer to read from
- Returns:
- 8-bit value read
Definition at line 60 of file ac_buffer_reader.h.
bool ac_buffer_reader_cmp | ( | const ac_buffer_t * | pBuf1, |
const ac_buffer_t * | pBuf2 | ||
) |
Compare buffer with array (does not advance read position)
- Parameters:
-
pBuf1 the buffer to compare from pBuf2 the buffer to compare with
- Returns:
- Whether the buffers have the same length and content
Definition at line 137 of file ac_buffer_reader.c.
bool ac_buffer_reader_cmp_bytes | ( | const ac_buffer_t * | pBuf, |
const uint8_t * | bytes, | ||
size_t | length | ||
) |
Compare buffer with array (does not advance read position)
- Parameters:
-
pBuf the buffer to compare from bytes the array to compare with length the array length
- Returns:
- Whether the buffer is AT LEAST as long as the array AND the buffer and array have the same content
Definition at line 110 of file ac_buffer_reader.c.
size_t ac_buffer_reader_current_buffer_length | ( | ac_buffer_t * | pBuf ) |
Get the number of bytes readable within the current backing array.
- Parameters:
-
pBuf the buffer to read from
- Returns:
- The number of bytes readable within the current backing array
Definition at line 104 of file ac_buffer_reader.c.
const uint8_t* ac_buffer_reader_current_buffer_pointer | ( | ac_buffer_t * | pBuf ) |
Get a pointer to the current position within this buffer's current backing array.
- Parameters:
-
pBuf the buffer to read from
- Returns:
- A pointer to the current position within the current backing array
Definition at line 98 of file ac_buffer_reader.c.
size_t ac_buffer_reader_readable | ( | const ac_buffer_t * | pBuf ) |
Get number of bytes readable from buffer.
- Parameters:
-
pBuf the buffer to read from
- Returns:
- The number of bytes which can be read
Definition at line 88 of file ac_buffer_reader.c.
static void ac_buffer_set_next | ( | ac_buffer_t * | pBuf, |
ac_buffer_t * | pNextBuf | ||
) | [static] |
Set next buffer in chain.
- Parameters:
-
pBuf pointer to ac_buffer_t structure pNextBuf pointer to next buffer (or NULL to break chain)
Definition at line 90 of file ac_buffer.h.
static size_t ac_buffer_size | ( | const ac_buffer_t * | pBuf ) | [static] |
Get buffer's size.
- Parameters:
-
pBuf pointer to ac_buffer_t structure
- Returns:
- buffer's size
Definition at line 72 of file ac_buffer.h.
void ac_buffer_split | ( | ac_buffer_t * | pStartBuf, |
ac_buffer_t * | pEndBuf, | ||
ac_buffer_t * | pBuf, | ||
size_t | length | ||
) |
Truncate pBuf to length bytes and save the remaining bytes in pEndBuf.
- Parameters:
-
pBuf The buffer to split (will be set to invalid state) pStartBuf A new buffer at the head of the split pEndBuf A new buffer at the tail of the split length How long pStartBuf should be (if longer than pBuf, then pStartBuf will be pBuf)
Definition at line 55 of file ac_buffer.c.
Generated on Tue Jul 12 2022 13:55:27 by
