This file includes definitions for byte-ordering encoding.
More...
#include "openthread-core-config.h"
#include <limits.h>
#include "utils/wrap_stdint.h"
Go to the source code of this file.
|
#define | BitVectorBytes(x) (((x) + (CHAR_BIT-1)) / CHAR_BIT) |
|
|
uint16_t | ot::Encoding::Swap16 (uint16_t v) |
|
uint32_t | ot::Encoding::Swap32 (uint32_t v) |
|
uint64_t | ot::Encoding::Swap64 (uint64_t v) |
|
uint32_t | ot::Encoding::Reverse32 (uint32_t v) |
|
uint16_t | ot::Encoding::BigEndian::HostSwap16 (uint16_t v) |
|
uint32_t | ot::Encoding::BigEndian::HostSwap32 (uint32_t v) |
|
uint64_t | ot::Encoding::BigEndian::HostSwap64 (uint64_t v) |
|
uint16_t | ot::Encoding::BigEndian::ReadUint16 (const uint8_t *aBuffer) |
| This function reads a uint16_t value from a given buffer assuming big-ending encoding. More...
|
|
uint32_t | ot::Encoding::BigEndian::ReadUint32 (const uint8_t *aBuffer) |
| This function reads a uint32_t value from a given buffer assuming big-ending encoding. More...
|
|
void | ot::Encoding::BigEndian::WriteUint16 (uint16_t aValue, uint8_t *aBuffer) |
| This function writes a uint16_t value to a given buffer using big-ending encoding. More...
|
|
void | ot::Encoding::BigEndian::WriteUint32 (uint32_t aValue, uint8_t *aBuffer) |
| This function writes a uint32_t value to a given buffer using big-ending encoding. More...
|
|
uint16_t | ot::Encoding::LittleEndian::HostSwap16 (uint16_t v) |
|
uint32_t | ot::Encoding::LittleEndian::HostSwap32 (uint32_t v) |
|
uint64_t | ot::Encoding::LittleEndian::HostSwap64 (uint64_t v) |
|
uint16_t | ot::Encoding::LittleEndian::ReadUint16 (const uint8_t *aBuffer) |
| This function reads a uint16_t value from a given buffer assuming little-ending encoding. More...
|
|
uint32_t | ot::Encoding::LittleEndian::ReadUint32 (const uint8_t *aBuffer) |
| This function reads a uint32_t value from a given buffer assuming little-ending encoding. More...
|
|
void | ot::Encoding::LittleEndian::WriteUint16 (uint16_t aValue, uint8_t *aBuffer) |
| This function writes a uint16_t value to a given buffer using little-ending encoding. More...
|
|
void | ot::Encoding::LittleEndian::WriteUint32 (uint32_t aValue, uint8_t *aBuffer) |
| This function writes a uint32_t value to a given buffer using little-ending encoding. More...
|
|
This file includes definitions for byte-ordering encoding.
§ ReadUint16() [1/2]
uint16_t ot::Encoding::BigEndian::ReadUint16 |
( |
const uint8_t * |
aBuffer | ) |
|
|
inline |
This function reads a uint16_t
value from a given buffer assuming big-ending encoding.
- Parameters
-
[in] | aBuffer | Pointer to buffer to read from. |
- Returns
- The
uint16_t
value read from buffer.
§ ReadUint16() [2/2]
uint16_t ot::Encoding::LittleEndian::ReadUint16 |
( |
const uint8_t * |
aBuffer | ) |
|
|
inline |
This function reads a uint16_t
value from a given buffer assuming little-ending encoding.
- Parameters
-
[in] | aBuffer | Pointer to buffer to read from. |
- Returns
- The
uint16_t
value read from buffer.
§ ReadUint32() [1/2]
uint32_t ot::Encoding::BigEndian::ReadUint32 |
( |
const uint8_t * |
aBuffer | ) |
|
|
inline |
This function reads a uint32_t
value from a given buffer assuming big-ending encoding.
- Parameters
-
[in] | aBuffer | Pointer to buffer to read from. |
- Returns
- The
uint32_t
value read from buffer.
§ ReadUint32() [2/2]
uint32_t ot::Encoding::LittleEndian::ReadUint32 |
( |
const uint8_t * |
aBuffer | ) |
|
|
inline |
This function reads a uint32_t
value from a given buffer assuming little-ending encoding.
- Parameters
-
[in] | aBuffer | Pointer to buffer to read from. |
- Returns
- The
uint32_t
value read from buffer.
§ WriteUint16() [1/2]
void ot::Encoding::BigEndian::WriteUint16 |
( |
uint16_t |
aValue, |
|
|
uint8_t * |
aBuffer |
|
) |
| |
|
inline |
This function writes a uint16_t
value to a given buffer using big-ending encoding.
- Parameters
-
[in] | aValue | The value to write to buffer. |
[out] | aBuffer | Pointer to buffer where the value will be written. |
§ WriteUint16() [2/2]
void ot::Encoding::LittleEndian::WriteUint16 |
( |
uint16_t |
aValue, |
|
|
uint8_t * |
aBuffer |
|
) |
| |
|
inline |
This function writes a uint16_t
value to a given buffer using little-ending encoding.
- Parameters
-
[in] | aValue | The value to write to buffer. |
[out] | aBuffer | Pointer to buffer where the value will be written. |
§ WriteUint32() [1/2]
void ot::Encoding::BigEndian::WriteUint32 |
( |
uint32_t |
aValue, |
|
|
uint8_t * |
aBuffer |
|
) |
| |
|
inline |
This function writes a uint32_t
value to a given buffer using big-ending encoding.
- Parameters
-
[in] | aValue | The value to write to buffer. |
[out] | aBuffer | Pointer to buffer where the value will be written. |
§ WriteUint32() [2/2]
void ot::Encoding::LittleEndian::WriteUint32 |
( |
uint32_t |
aValue, |
|
|
uint8_t * |
aBuffer |
|
) |
| |
|
inline |
This function writes a uint32_t
value to a given buffer using little-ending encoding.
- Parameters
-
[in] | aValue | The value to write to buffer. |
[out] | aBuffer | Pointer to buffer where the value will be written. |