These functions take host endian values and serialize them into
explicit endianess buffers and vice versa. The 64-bit versions
of these functions can be found under @ref SixtyFourBit
Here's an example usage that serializes a struct into a big-endian buffer:
*
* struct mystruct
* {
* posh_u16_t u16;
* posh_s32_t s32;
* };
*
* void WriteStruct( void *buffer, const struct mystruct *s )
* {
* void *p = buffer;
*
* //The POSH_Write??? functions return a pointer to the next write address
* p = POSH_WriteU16ToBig( p, &s->u16 );
* p = POSH_WriteS32ToBig( p, &s->s32 );
* }
*
*
posh_s16_t POSH_ReadS16FromBig |
( |
const void * |
src) | |
|
Reads a signed 16-bit value from a big-endian buffer
- Parameters
-
- Returns
- host-endian signed 16-bit value
Definition at line 562 of file posh.cpp.
posh_s16_t POSH_ReadS16FromLittle |
( |
const void * |
src) | |
|
Reads a signed 16-bit value from a little-endian buffer
- Parameters
-
- Returns
- host-endian signed 16-bit value
Definition at line 522 of file posh.cpp.
posh_s32_t POSH_ReadS32FromBig |
( |
const void * |
src) | |
|
Reads a signed 32-bit value from a big-endian buffer
- Parameters
-
- Returns
- host-endian signed 32-bit value
Definition at line 582 of file posh.cpp.
posh_s32_t POSH_ReadS32FromLittle |
( |
const void * |
src) | |
|
Reads a signed 32-bit value from a little-endian buffer
- Parameters
-
- Returns
- host-endian signed 32-bit value
Definition at line 542 of file posh.cpp.
posh_u16_t POSH_ReadU16FromBig |
( |
const void * |
src) | |
|
Reads an unsigned 16-bit value from a big-endian buffer
- Parameters
-
- Returns
- host-endian unsigned 16-bit value
Definition at line 552 of file posh.cpp.
posh_u16_t POSH_ReadU16FromLittle |
( |
const void * |
src) | |
|
Reads an unsigned 16-bit value from a little-endian buffer
- Parameters
-
- Returns
- host-endian unsigned 16-bit value
Definition at line 512 of file posh.cpp.
posh_u32_t POSH_ReadU32FromBig |
( |
const void * |
src) | |
|
Reads an unsigned 32-bit value from a big-endian buffer
- Parameters
-
- Returns
- host-endian unsigned 32-bit value
Definition at line 572 of file posh.cpp.
posh_u32_t POSH_ReadU32FromLittle |
( |
const void * |
src) | |
|
Reads an unsigned 32-bit value from a little-endian buffer
- Parameters
-
- Returns
- host-endian unsigned 32-bit value
Definition at line 532 of file posh.cpp.
Writes a signed 16-bit value to a big endian buffer
- Parameters
-
dst[out] | pointer to the destination buffer, may not be NULL |
value[in] | host-endian signed 16-bit value |
- Returns
- a pointer to the location two bytes after dst
Definition at line 398 of file posh.cpp.
Writes a signed 16-bit value to a little endian buffer
- Parameters
-
dst[out] | pointer to the destination buffer, may not be NULL |
value[in] | host-endian signed 16-bit value |
- Returns
- a pointer to the location two bytes after dst
Definition at line 336 of file posh.cpp.
Writes a signed 32-bit value to a big endian buffer
- Parameters
-
dst[out] | pointer to the destination buffer, may not be NULL |
value[in] | host-endian signed 32-bit value |
- Returns
- a pointer to the location four bytes after dst
Definition at line 429 of file posh.cpp.
Writes a signed 32-bit value to a little endian buffer
- Parameters
-
dst[out] | pointer to the destination buffer, may not be NULL |
value[in] | host-endian signed 32-bit value |
- Returns
- a pointer to the location four bytes after dst
Definition at line 367 of file posh.cpp.
Writes an unsigned 16-bit value to a big endian buffer
- Parameters
-
dst[out] | pointer to the destination buffer, may not be NULL |
value[in] | host-endian unsigned 16-bit value |
- Returns
- a pointer to the location two bytes after dst
Definition at line 380 of file posh.cpp.
Writes an unsigned 16-bit value to a little endian buffer
- Parameters
-
dst[out] | pointer to the destination buffer, may not be NULL |
value[in] | host-endian unsigned 16-bit value |
- Returns
- a pointer to the location two bytes after dst
Definition at line 318 of file posh.cpp.
Writes an unsigned 32-bit value to a big endian buffer
- Parameters
-
dst[out] | pointer to the destination buffer, may not be NULL |
value[in] | host-endian unsigned 32-bit value |
- Returns
- a pointer to the location four bytes after dst
Definition at line 411 of file posh.cpp.
Writes an unsigned 32-bit value to a little endian buffer
- Parameters
-
dst[out] | pointer to the destination buffer, may not be NULL |
value[in] | host-endian signed 32-bit value |
- Returns
- a pointer to the location four bytes after dst
Definition at line 349 of file posh.cpp.