[−][src]Struct hap::Config
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 by Apple and 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: u64
config_hash: Option<u64>
Trait Implementations
Auto Trait Implementations
Blanket Implementations
impl<T, U> Into for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From for T
[src]
impl<T, U> TryFrom for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T> Borrow for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Same for T
type Output = T
Should always be Self