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: 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
impl Hash for Config
[src]
impl Hash for Config
fn hash<H: Hasher>(&self, state: &mut H)
[src]
fn hash<H: Hasher>(&self, state: &mut H)
Feeds this value into the given [Hasher
]. Read more
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
Feeds a slice of this type into the given [Hasher
]. Read more
impl Default for Config
[src]
impl Default for Config