Block list element.
More...
#include <nfcf.hpp>
|
| constexpr | block_t (const uint16_t num, const uint8_t access=0, const uint8_t order=0) |
| | Construct from block number, access mode, and service order.
|
| |
| constexpr bool | is_2byte () const |
| | Is 2-byte block list element?
|
| |
| constexpr bool | is_3byte () const |
| | Is 3-byte block list element?
|
| |
| constexpr uint8_t | access_mode () const |
| | Gets access mode bits.
|
| |
| constexpr uint8_t | order () const |
| | Gets service order.
|
| |
| constexpr uint16_t | block () const |
| | Gets block number.
|
| |
| void | block (const uint16_t num) |
| | Set block number.
|
| |
| void | access_mode (const uint8_t a) |
| | Set access mode bits.
|
| |
| void | order (const uint8_t o) |
| | Set service order.
|
| |
| | operator uint16_t () const |
| | Convert to block number.
|
| |
| uint8_t | store (uint8_t buf[3]) const |
| | Store encoded block list element.
|
| |
|
| static block_t | from (const uint8_t v[3]) |
| | Construct from encoded block list element.
|
| |
|
|
uint8_t | pad {} |
| |
|
uint8_t | header {} |
| | size:1 access:3 order:4
|
| |
|
uint16_t | number {} |
| | block number (using low byte if 2 byte mode)
|
| |
◆ block_t()
| m5::nfc::f::block_t::block_t |
( |
const uint16_t | num, |
|
|
const uint8_t | access = 0, |
|
|
const uint8_t | order = 0 ) |
|
inlineconstexpr |
Construct from block number, access mode, and service order.
- Parameters
-
| num | Block number |
| access | Access mode bits |
| order | Service order bits |
◆ access_mode() [1/2]
| uint8_t m5::nfc::f::block_t::access_mode |
( |
| ) |
const |
|
inlineconstexpr |
Gets access mode bits.
- Returns
- Access mode bits
◆ access_mode() [2/2]
| void m5::nfc::f::block_t::access_mode |
( |
const uint8_t | a | ) |
|
|
inline |
Set access mode bits.
- Parameters
-
◆ block() [1/2]
| uint16_t m5::nfc::f::block_t::block |
( |
| ) |
const |
|
inlineconstexpr |
Gets block number.
- Returns
- Block number
◆ block() [2/2]
| void m5::nfc::f::block_t::block |
( |
const uint16_t | num | ) |
|
|
inline |
Set block number.
- Parameters
-
◆ from()
| static block_t m5::nfc::f::block_t::from |
( |
const uint8_t | v[3] | ) |
|
|
inlinestatic |
Construct from encoded block list element.
- Parameters
-
| v | Encoded block list element |
- Returns
- Decoded block list element
◆ is_2byte()
| bool m5::nfc::f::block_t::is_2byte |
( |
| ) |
const |
|
inlineconstexpr |
Is 2-byte block list element?
- Returns
- True if the element is encoded in 2-byte mode
◆ is_3byte()
| bool m5::nfc::f::block_t::is_3byte |
( |
| ) |
const |
|
inlineconstexpr |
Is 3-byte block list element?
- Returns
- True if the element is encoded in 3-byte mode
◆ operator uint16_t()
| m5::nfc::f::block_t::operator uint16_t |
( |
| ) |
const |
|
inline |
Convert to block number.
- Returns
- Block number
◆ order() [1/2]
| uint8_t m5::nfc::f::block_t::order |
( |
| ) |
const |
|
inlineconstexpr |
Gets service order.
- Returns
- Service order bits
◆ order() [2/2]
| void m5::nfc::f::block_t::order |
( |
const uint8_t | o | ) |
|
|
inline |
Set service order.
- Parameters
-
◆ store()
| uint8_t m5::nfc::f::block_t::store |
( |
uint8_t | buf[3] | ) |
const |
|
inline |
Store encoded block list element.
- Parameters
-
| [out] | buf | Output buffer at least 3 bytes |
- Returns
- Stored byte length