[][src]Struct hap::Config

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::{accessory::Category, Config};

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: String

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

ip: IpAddr

IP address to serve on.

port: u16

Port to serve on. Defaults to 32000.

pin: String

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

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

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

Model name of the accessory.

device_id: MacAddress

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

configuration_number: u64

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.

state_number: u8

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

category: Category

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

protocol_version: String

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

status_flag: StatusFlag

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

feature_flag: FeatureFlag

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

max_peers: Option<usize>

Optional maximum number of paired controllers.

version: u64config_hash: Option<u64>

Trait Implementations

impl Default for Config[src]

impl Hash for Config[src]

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

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

Auto Trait Implementations

impl Sync for Config

impl Send for Config

impl Unpin for Config

impl RefUnwindSafe for Config

impl UnwindSafe for Config

Blanket Implementations

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

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

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<T> BorrowMut<T> for T where
    T: ?Sized
[src]

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

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

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T> Erased for T