ot::Preference::From2BitUint() method
Converts a 2-bit `uint8_t` value to a signed preference value `kHigh`, `kMedium`, and `kLow`. Only the first two bits (LSB) of @p a2BitUint are used and the rest of the bits are ignored. - `0b01` (or 1) is mapped to `kHigh`. - `0b00` (or 0) is mapped to `kMedium`. - `0b11` (or 3) is mapped to `kLow`. - `0b10` (or 2) is reserved for future and is also mapped to `kMedium` (this complies with RFC-4191 where the reserved value `0b10` MUST be treated as `0b00` for Route Preference).
Syntax
static int8_t From2BitUint(uint8_t a2BitUint); Arguments
a2BitUint
The 2-bit unsigned value to convert from. Only two LSB bits are used and the reset are ignored.
Return value
The signed preference `kHigh`, `kMedium`, or `kLow` corresponding to @p a2BitUint.