Skip to main content

MetadataFlags

Struct MetadataFlags 

Source
pub struct MetadataFlags(/* private fields */);
Expand description

Metadata flags that control which per-tag metadata fields the reader includes in inventory responses.

Defined in the Single Tag Inventory (0x21), Get Tag Buffer (0x29), and Asynchronous Inventory (0xAA) command specifications.

Each enabled bit requests one additional metadata field in the response. When all bits are zero the reader returns only the EPC and tag CRC.

BitValueFieldSizeDescription
00x0001Read Count1 byteNumber of times the tag was archived
10x0002RSSI1 byteSignal strength, signed (dBm)
20x0004Antenna ID1 byteLogic antenna number
30x0008Frequency3 bytesFrequency at archival (kHz)
40x0010Timestamp4 bytesElapsed time from inventory start (ms)
50x0020RFU2 bytesReserved for future use
60x0040Protocol ID1 byteTag protocol (0x05 = Gen2)
70x0080Data Length2 bytesTag data length (0x0000 for 0x21)

Implementations§

Source§

impl MetadataFlags

Source

pub const NONE: Self

No metadata: only EPC and tag CRC are returned.

Source

pub const ALL: Self

All defined metadata bits set (0x00FF).

Source

pub const fn from_raw(raw: u16) -> Self

Create from the raw protocol value.

Source

pub const fn raw(self) -> u16

Return the raw protocol value.

Source

pub const fn read_count(self) -> bool

Whether the Read Count field is requested (bit 0).

Source

pub const fn rssi(self) -> bool

Whether the RSSI field is requested (bit 1).

Source

pub const fn antenna_id(self) -> bool

Whether the Antenna ID field is requested (bit 2).

Source

pub const fn frequency(self) -> bool

Whether the Frequency field is requested (bit 3).

Source

pub const fn timestamp(self) -> bool

Whether the Timestamp field is requested (bit 4).

Source

pub const fn rfu(self) -> bool

Whether the RFU reserved field is requested (bit 5).

Source

pub const fn protocol_id(self) -> bool

Whether the Protocol ID field is requested (bit 6).

Source

pub const fn data_length(self) -> bool

Whether the Data Length field is requested (bit 7).

Source

pub const fn with_read_count(self, en: bool) -> Self

Set or clear the Read Count bit (bit 0).

Source

pub const fn with_rssi(self, en: bool) -> Self

Set or clear the RSSI bit (bit 1).

Source

pub const fn with_antenna_id(self, en: bool) -> Self

Set or clear the Antenna ID bit (bit 2).

Source

pub const fn with_frequency(self, en: bool) -> Self

Set or clear the Frequency bit (bit 3).

Source

pub const fn with_timestamp(self, en: bool) -> Self

Set or clear the Timestamp bit (bit 4).

Source

pub const fn with_rfu(self, en: bool) -> Self

Set or clear the RFU reserved bit (bit 5).

Source

pub const fn with_protocol_id(self, en: bool) -> Self

Set or clear the Protocol ID bit (bit 6).

Source

pub const fn with_data_length(self, en: bool) -> Self

Set or clear the Data Length bit (bit 7).

Trait Implementations§

Source§

impl Clone for MetadataFlags

Source§

fn clone(&self) -> MetadataFlags

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for MetadataFlags

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for MetadataFlags

Source§

fn default() -> MetadataFlags

Returns the “default value” for a type. Read more
Source§

impl From<MetadataFlags> for u16

Source§

fn from(value: MetadataFlags) -> Self

Converts to this type from the input type.
Source§

impl From<u16> for MetadataFlags

Source§

fn from(value: u16) -> Self

Converts to this type from the input type.
Source§

impl PartialEq for MetadataFlags

Source§

fn eq(&self, other: &MetadataFlags) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Copy for MetadataFlags

Source§

impl Eq for MetadataFlags

Source§

impl StructuralPartialEq for MetadataFlags

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.