Skip to main content

DeviceInformation

Struct DeviceInformation 

Source
#[non_exhaustive]
pub struct DeviceInformation { pub entity_count: u8, pub unit_id: [u8; 4], pub transport: DeviceTransport, pub model_id: [u16; 3], pub extended_model_id: u8, pub capabilities: DeviceInformationCapabilities, }
Expand description

Represents information about the device as reported by DeviceInformationFeature::get_device_info.

Fields (Non-exhaustive)§

This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.
§entity_count: u8

The amount of entities in the device from which version information can be retrieved using DeviceInformationFeature::get_fw_info.

§unit_id: [u8; 4]

A 4-byte random value serving as a unique identifier (among all devices with the same Self::model_id) for the unit.

This field was added in feature version 1 and will always be 0 for older versions.

§transport: DeviceTransport

A bitfield about which transport protocols the device supports.

This field was added in feature version 1 and will always be 0 for older versions.

§model_id: [u16; 3]

A 6-byte array serving as the identifier for the device model.

This array will consist of the application PIDs of the different transport protocols supported by the device, as stated in Self::transport. The 16-bit PID for every supported transport protocol will be appended into this array, limiting the total amount of supported transport protocols to three.

This field was added in feature version 1 and will always be 0 for older versions.

§extended_model_id: u8

An 8-bit value representing an additional configurable attribute for a given Self::model_id, set on the production line. This could be the color of the device.

This field was added in feature version 2 and will always be 0 for older versions.

§capabilities: DeviceInformationCapabilities

Additional capability flags of this feature.

This field was added in feature version 4 together with the serial number retrieval function. All capabilities will be flagged as unsupported for older versions.

Trait Implementations§

Source§

impl Clone for DeviceInformation

Source§

fn clone(&self) -> DeviceInformation

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 Copy for DeviceInformation

Source§

impl Debug for DeviceInformation

Source§

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

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

impl Eq for DeviceInformation

Source§

impl Hash for DeviceInformation

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl PartialEq for DeviceInformation

Source§

fn eq(&self, other: &DeviceInformation) -> 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 StructuralPartialEq for DeviceInformation

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.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V