Embedded SDK
Embedded SDK
Functions
read.h File Reference
#include <stdint.h>
#include <stddef.h>
Include dependency graph for read.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

uint16_t read_u16_be (const uint8_t *ptr, size_t offset)
 
uint32_t read_u32_be (const uint8_t *ptr, size_t offset)
 
uint64_t read_u64_be (const uint8_t *ptr, size_t offset)
 
uint16_t read_u16_le (const uint8_t *ptr, size_t offset)
 
uint32_t read_u32_le (const uint8_t *ptr, size_t offset)
 
uint64_t read_u64_le (const uint8_t *ptr, size_t offset)
 

Function Documentation

◆ read_u16_be()

uint16_t read_u16_be ( const uint8_t ptr,
size_t  offset 
)

Read 2 bytes as Big Endian from byte buffer.

Parameters
[in]ptrPointer to byte buffer.
[in]offsetOffset in the byte buffer.
Returns
2 bytes value read from buffer.

Definition at line 20 of file read.c.

◆ read_u16_le()

uint16_t read_u16_le ( const uint8_t ptr,
size_t  offset 
)

Read 2 bytes as Little Endian from byte buffer.

Parameters
[in]ptrPointer to byte buffer.
[in]offsetOffset in the byte buffer.
Returns
2 bytes value read from buffer.

Definition at line 46 of file read.c.

◆ read_u32_be()

uint32_t read_u32_be ( const uint8_t ptr,
size_t  offset 
)

Read 4 bytes as Big Endian from byte buffer.

Parameters
[in]ptrPointer to byte buffer.
[in]offsetOffset in the byte buffer.
Returns
4 bytes value read from buffer.

Definition at line 26 of file read.c.

◆ read_u32_le()

uint32_t read_u32_le ( const uint8_t ptr,
size_t  offset 
)

Read 4 bytes as Little Endian from byte buffer.

Parameters
[in]ptrPointer to byte buffer.
[in]offsetOffset in the byte buffer.
Returns
4 bytes value read from buffer.

Definition at line 52 of file read.c.

◆ read_u64_be()

uint64_t read_u64_be ( const uint8_t ptr,
size_t  offset 
)

Read 8 bytes as Big Endian from byte buffer.

Parameters
[in]ptrPointer to byte buffer.
[in]offsetOffset in the byte buffer.
Returns
8 bytes value read from buffer.

Definition at line 34 of file read.c.

◆ read_u64_le()

uint64_t read_u64_le ( const uint8_t ptr,
size_t  offset 
)

Read 8 bytes as Little Endian from byte buffer.

Parameters
[in]ptrPointer to byte buffer.
[in]offsetOffset in the byte buffer.
Returns
8 bytes value read from buffer.

Definition at line 60 of file read.c.