ProsecCoAP 🥂
 
Loading...
Searching...
No Matches
Coap::Utils Namespace Reference

Functions

template<size_t N, typename T >
void toNetworkByteOrder (T value, uint8_t(&result)[N])
 Convert an integer-like value to network byte order (i.e. big-endian).
 
constexpr uint16_t ntohs (uint16_t net_short)
 Custom implementation of ntohs (Network to Host Short) for 16-bit integers.
 
constexpr uint32_t ntohl (uint32_t net_long)
 Custom implementation of ntohl (Network to Host Long) for 32-bit integers.
 
constexpr uint64_t ntohll (uint64_t net_longlong)
 Custom implementation of ntohll (Network to Host Long Long) for 64-bit integers.
 

Function Documentation

◆ ntohl()

uint32_t Coap::Utils::ntohl ( uint32_t net_long)
inlineconstexpr

Custom implementation of ntohl (Network to Host Long) for 32-bit integers.

◆ ntohll()

uint64_t Coap::Utils::ntohll ( uint64_t net_longlong)
inlineconstexpr

Custom implementation of ntohll (Network to Host Long Long) for 64-bit integers.

◆ ntohs()

uint16_t Coap::Utils::ntohs ( uint16_t net_short)
inlineconstexpr

Custom implementation of ntohs (Network to Host Short) for 16-bit integers.

◆ toNetworkByteOrder()

template<size_t N, typename T >
void Coap::Utils::toNetworkByteOrder ( T value,
uint8_t(&) result[N] )

Convert an integer-like value to network byte order (i.e. big-endian).

The result must be stored in an array of bytes with the exact required size.