nl::Weave::Platform

Summary

Functions

BitsToByteLength(uint32_t aBits)
constexpr uint32_t
Converts value length in bits to length in bytes.
Divide(int64_t inDividend, int64_t inDivisor)
int64_t
Performs signed 64-bit divided by 64-bit operation and returns the quotient.
DivideBy1000(uint64_t inDividend)
uint32_t
Divide a 64-bit unsigned dividend by 1000 producing a 32-bit value.
RoundDown(uint32_t a, uint32_t b)
constexpr uint32_t
Performs rounding towards 0.
RoundUp(uint32_t a, uint32_t b)
constexpr uint32_t
Performs rounding away from 0.

Namespaces

nl::Weave::Platform::PersistedStorage
nl::Weave::Platform::Security

This namespace includes all interfaces within Weave for the Weave Security Monitor memory manager.

Functions

BitsToByteLength

constexpr uint32_t BitsToByteLength(
  uint32_t aBits
)

Converts value length in bits to length in bytes.

Details
Parameters
[in] aBits
Value in bits to be converted to bytes.
Returns
Length in bytes.

Divide

int64_t Divide(
  int64_t inDividend,
  int64_t inDivisor
)

Performs signed 64-bit divided by 64-bit operation and returns the quotient.

Details
Parameters
[in] inDividend
The dividend in this function.
[in] inDivisor
The divisor in this function.
Returns
The quotient of inDividend divided by inDivisor

DivideBy1000

uint32_t DivideBy1000(
  uint64_t inDividend
)

Divide a 64-bit unsigned dividend by 1000 producing a 32-bit value.

Details
Parameters
[in] inDividend
64-bit value to be divided
Returns
the 32-bit quotient.

RoundDown

constexpr uint32_t RoundDown(
  uint32_t a,
  uint32_t b
)

Performs rounding towards 0.

Details
Parameters
[in] a
Value to be rounded.
[in] b
Rounding granularity.
Returns
Value rounded down to the nearest multiple of rounding granularity.

RoundUp

constexpr uint32_t RoundUp(
  uint32_t a,
  uint32_t b
)

Performs rounding away from 0.

Details
Parameters
[in] a
Value to be rounded.
[in] b
Rounding granularity.
Returns
Value rounded up to the nearest multiple of rounding granularity.