Struct hap::Config[][src]

pub struct Config {
    pub storage_path: String,
    pub ip: IpAddr,
    pub port: u16,
    pub pin: String,
    pub name: String,
    pub device_id: MacAddress,
    pub configuration_number: u64,
    pub state_number: u8,
    pub category: Category,
    pub protocol_version: String,
    pub status_flag: StatusFlag,
    pub feature_flag: FeatureFlag,
    pub max_peers: Option<usize>,
    pub version: u64,
    pub config_hash: Option<u64>,
}

The Config struct is used to store configuration options for the HomeKit Accessory Server.

Examples

use hap::{Config, accessory::Category};

let config = Config {
    storage_path: "/etc/homekit".into(),
    pin: "11122333".into(),
    name: "Acme Outlet".into(),
    category: Category::Outlet,
    max_peers: Some(32),
    ..Default::default()
};

Fields

Storage path for the persisted data. If no path is specified, the current working directory is used.

IP address to serve on.

Port to serve on. Defaults to 32000.

8 digit pin used for pairing. Defaults to "11122333".

The following pins are considered too easy by Apple and therefore not allowed:

  • "12345678"
  • "87654321"
  • "00000000"
  • "11111111"
  • "22222222"
  • "33333333"
  • "44444444"
  • "55555555"
  • "66666666"
  • "77777777"
  • "88888888"
  • "99999999"

Model name of the accessory.

Device ID of the accessory. Generated randomly if not specified. This value is also used as the accessory's Pairing Identifier.

Current configuration number. Is updated when an accessory, service, or characteristic is added or removed on the accessory server. Accessories must increment the config number after a firmware update.

Current state number. This must have a value of 1.

Accessory Category. Indicates the category that best describes the primary function of the accessory.

Protocol version string <major>.<minor> (e.g. "1.0"). Defaults to "1.0" Required if value is not "1.0".

Bonjour Status Flag. Defaults to StatusFlag::NotPaired and is changed to StatusFlag::Zero after a successful pairing.

Bonjour Feature Flag. Currently only used to indicate MFi compliance.

Optional maximum number of paired controllers.

Trait Implementations

impl Hash for Config
[src]

Feeds this value into the given [Hasher]. Read more

Feeds a slice of this type into the given [Hasher]. Read more

impl Default for Config
[src]

Returns the "default value" for a type. Read more

Auto Trait Implementations

impl Send for Config

impl Sync for Config