[][src]Struct hap::accessory::AccessoryInformation

pub struct AccessoryInformation {
    pub manufacturer: String,
    pub model: String,
    pub name: String,
    pub serial_number: String,
    pub firmware_revision: String,
    pub hardware_revision: Option<String>,
    pub accessory_flags: Option<u32>,
}

The AccessoryInformationInformation struct is used to store metadata about an Accessory and is converted to the Accessory Information Service of the Accessory it is passed to on its creation.

Examples

use hap::accessory::{outlet::OutletAccessory, AccessoryInformation};

let information = AccessoryInformation {
    manufacturer: "Acme".into(),
    model: "A1234".into(),
    name: "Acme Outlet".into(),
    serial_number: "1A2B3C4D5E6F".into(),
    ..Default::default()
};

let outlet = OutletAccessory::new(1, information).unwrap();

Fields

manufacturer: String

Contains the name of the company whose brand will appear on the Accessory, e.g., "Acme".

model: String

Contains the manufacturer-specific model of the Accessory, e.g. "A1234".

name: String

Describes the name of the Accessory.

serial_number: String

Contains the manufacturer-specific serial number of the Accessory, e.g. "1A2B3C4D5E6F". The length must be greater than 1.

firmware_revision: String

Describes a firmware revision string x[.y[.z]] (e.g. "100.1.1"):

  • is the major version number, required.
  • is the minor version number, required if it is non-zero or if is present.
  • is the revision version number, required if non-zero.

The firmware revision must follow the below rules:

  • is incremented when there is significant change. e.g.,1.0.0, 2.0.0, 3.0.0, etc.
  • is incremented when minor changes are introduced such as 1.1.0, 2.1.0, 3.1.0 etc.
  • is incremented when bug-fixes are introduced such as 1.0.1, 2.0.1, 3.0.1 etc.
  • Subsequent firmware updates can have a lower version only if is incremented
  • Subsequent firmware updates can have a lower version only if or is incremented

The value must change after every firmware update.

hardware_revision: Option<String>

Describes a hardware revision string x[.y[.z]] (e.g. "100.1.1") and tracked when the board or components of the same accessory is changed:

  • is the major version number, required.
  • is the minor version number, required if it is non-zero or if is present.
  • is the revision version number, required if non-zero.

The hardware revision must follow the below rules:

  • is incremented when there is significant change. e.g.,1.0.0, 2.0.0, 3.0.0, etc.
  • is incremented when minor changes are introduced such as 1.1.0, 2.1.0, 3.1.0 etc.
  • is incremented when bug-fixes are introduced such as 1.0.1, 2.0.1, 3.0.1 etc.
  • Subsequent firmware updates can have a lower version only if is incremented
  • Subsequent firmware updates can have a lower version only if or is incremented

The value must change after every hardware update.

accessory_flags: Option<u32>

When set indicates accessory requires additional setup. Use of Accessory Flags requires written approval by Apple in advance.

Trait Implementations

impl Debug for AccessoryInformation[src]

impl Default for AccessoryInformation[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T> Instrument for T[src]

impl<T> Instrument for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

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