[][src]Struct hap::accessory::Information

pub struct Information {
    pub identify: bool,
    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 Information 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, Information};

let info = Information {
    manufacturer: "Acme".into(),
    model: "A1234".into(),
    name: "Acme Outlet".into(),
    serial_number: "11122333".into(),
    ..Default::default()
};

let outlet = outlet::new(info).unwrap();

Fields

identify: bool

Used to cause the Accessory to run its identify routine.

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.

Methods

impl Information[src]

pub fn to_service(self) -> Result<AccessoryInformation, Error>[src]

Converts the Information struct to an Accessory Information Service.

Trait Implementations

impl Default for Information[src]

Auto Trait Implementations

impl Send for Information

impl Sync for Information

Blanket Implementations

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

impl<T> From for T[src]

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

type Error = Infallible

The type returned in the event of a conversion error.

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

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

impl<T, U> TryInto 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<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Same for T

type Output = T

Should always be Self

impl<T> Erased for T