![]() |
Mbed OS Reference
|
Data Structures | |
| struct | __ac_buffer |
| struct | __ac_buffer_builder |
Buffer | |
| 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. | |
| 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. | |
Buffer Builder | |
| 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. | |
| 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. | |
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. | |
| 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) | |
| 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)
| pBuf | pointer to ac_buffer_t structure to initialize |
| data | byte array to use |
| size | size of byte array |
| void ac_buffer_dup | ( | ac_buffer_t * | pBuf, |
| const ac_buffer_t * | pBufIn | ||
| ) |
Copy pBufIn to pBuf.
| pBuf | pointer to ac_buffer_t structure to initialize |
| pBufIn | the source buffer |
| void ac_buffer_append | ( | ac_buffer_t * | pBuf, |
| ac_buffer_t * | pAppBuf | ||
| ) |
Append buffer to end of chain.
| pBuf | pointer to ac_buffer_t structure |
| pAppBuf | pointer to buffer to append to 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.
| 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) |
| 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)
| pBuilder | ac_buffer builder to use |
| buf | pointer to data |
| size | the data size |
| 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)
| pBuilder | ac_buffer builder to use |
| buf | pointer to data |
| size | the data size |
| 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)
| pBuilder | ac_buffer builder to use |
| pos | position in ac_buffer to write from |
| buf | pointer to data |
| size | the data size |
| 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)
| pBuilder | ac_buffer builder to use |
| pos | position in ac_buffer to write from |
| buf | pointer to data |
| size | the data size |
| void ac_buffer_builder_init | ( | ac_buffer_builder_t * | pBuilder, |
| uint8_t * | data, | ||
| size_t | size | ||
| ) |
Initialize ac_buffer builder.
| pBuilder | ac_buffer builder to init |
| data | pointer to byte array to use |
| size | of byte array |
| void ac_buffer_builder_from_buffer | ( | ac_buffer_builder_t * | pBuilder | ) |
Initialize ac_buffer builder from underlying ac_buffer.
| pBuilder | ac_buffer builder to init |
| void ac_buffer_builder_reset | ( | ac_buffer_builder_t * | pBuilder | ) |
Reset ac_buffer builder.
| pBuilder | ac_buffer builder to reset |
| void ac_buffer_builder_set_full | ( | ac_buffer_builder_t * | pBuilder | ) |
Set ac_buffer builder's ac_buffer to full size.
| pBuilder | ac_buffer builder to set to full size |
| void ac_buffer_builder_write_n_skip | ( | ac_buffer_builder_t * | pBuilder, |
| size_t | size | ||
| ) |
Skip n-bytes in ac_buffer builder.
| pBuilder | ac_buffer builder |
| size | number of bytes to skip |
| 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.
| pBuilderOut | ac_buffer builder |
| pBufIn | the input buffer |
| size | number of bytes to copy |
| void ac_buffer_builder_compact | ( | ac_buffer_builder_t * | pBuilder | ) |
Compact builder Will move underlying buffer's byte to start of allocated buffer.
| pBuilder | ac_buffer builder |
| 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.
| pBuf | the buffer to read from |
| buf | the array to write to |
| size | the number of bytes to read |
| 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.
| pBuf | the buffer to read from |
| buf | the array to write to |
| size | the number of bytes to read |
| void ac_buffer_read_n_skip | ( | ac_buffer_t * | pBuf, |
| size_t | size | ||
| ) |
Skip n bytes from buffer reader and advance read posiion.
| pBuf | the buffer to read from |
| size | the number of bytes to skip |
| size_t ac_buffer_reader_readable | ( | const ac_buffer_t * | pBuf | ) |
Get number of bytes readable from buffer.
| pBuf | the buffer to read from |
| 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.
| pBuf | the buffer to read from |
| size_t ac_buffer_reader_current_buffer_length | ( | ac_buffer_t * | pBuf | ) |
Get the number of bytes readable within the current backing array.
| pBuf | the buffer to read from |
| 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)
| pBuf | the buffer to compare from |
| bytes | the array to compare with |
| length | the array length |
| bool ac_buffer_reader_cmp | ( | const ac_buffer_t * | pBuf1, |
| const ac_buffer_t * | pBuf2 | ||
| ) |
Compare buffer with array (does not advance read position)
| pBuf1 | the buffer to compare from |
| pBuf2 | the buffer to compare with |