ManufacturerDataAppleHomeKit
@available(swift 4.0)
@available(iOS 10.0, tvOS 10.0, watchOS 3.0, macOS 10.12, *)
final public class ManufacturerDataAppleHomeKit : ManufacturerData
extension ManufacturerDataAppleHomeKit: Hashable
extension ManufacturerDataAppleHomeKit: Equatable
Apple HomeKit Manufacturer Specific Data
-
Types of Status Flags
See moreDeclaration
Swift
public struct StatusFlags : OptionSet, Hashable
extension ManufacturerDataAppleHomeKit.StatusFlags: Encodable
-
Manufacturer
Declaration
Swift
public var manufacturer: CompanyIdentifier
-
Data
Declaration
Swift
public var specificData: Data?
-
Status Flags
Declaration
Swift
private(set) public var statusFlag: StatusFlags { get }
-
Device ID
Declaration
Swift
private(set) public var deviceId: MACAddress { get }
-
Accessory Category Identifier
Identifier, which indicates the category that best describes the primary function of the accessory
Declaration
Swift
private(set) public var accessoryCategory: HomeKitAccessoryCategory { get }
-
Global State Number
Represents a change in the value of any of the characteristics that supports Disconnected Events.
Declaration
Swift
private(set) public var globalState: UInt16 { get }
-
Configuration Number
Accessories must increment the config number after a firmware update. This value must have a range of 1-255 and wrap to 1 when it overflows. This value must persist across reboots, power cycles and firmware updates
Declaration
Swift
private(set) public var configuration: UInt8 { get }
-
Compatible Version
The version of the HomeKit Accessory Protocol Used
Declaration
Swift
private(set) public var compatibleVersion: UInt8 { get }
-
Setup ID
String of 4 Characters in Length
Declaration
Swift
private(set) public var setupID: String? { get }
-
Setup Hash
Declaration
Swift
private(set) public var setupHash: UInt32 { get }
-
Creates an Apple HomeKit Manufacturer Specific Data Class
Declaration
Swift
public init(statusFlag: StatusFlags, deviceId: MACAddress, accessoryCategory: HomeKitAccessoryCategory, globalState: UInt16, configuration: UInt8, compatibleVersion: UInt8 = 2, setupID: String)
Parameters
statusFlag
Status Flags
deviceId
Device ID
accessoryCategory
Accessory Category Identifier
globalState
Global State Number
configuration
Configuration Number
compatibleVersion
Compatible Version
setupID
Setup ID String
-
Decodes Apple HomeKit Manufacturer Specific Data
Declaration
Swift
public class func decode(with data: Data) -> Result<ManufacturerDataAppleHomeKit, BluetoothDecodeError>
Parameters
data
ManufacturerData Data
Return Value
ManufacturerData Result
-
Encodes Apple HomeKit Manufacturer Specific Data
Declaration
Swift
public func encode() -> Result<Data, BluetoothEncodeError>
Return Value
ManufacturerData Result
-
Encodes this value into the given encoder.
If the value fails to encode anything,
encoder
will encode an empty keyed container in its place.This function throws an error if any values are invalid for the given encoder’s format.
Declaration
Swift
public func encode(to encoder: Encoder) throws
Parameters
encoder
The encoder to write data to.
-
Hashes the essential components of this value by feeding them into the given hasher.
Implement this method to conform to the
Hashable
protocol. The components used for hashing must be the same as the components compared in your type’s==
operator implementation. Callhasher.combine(_:)
with each of these components.Important
Never call
finalize()
onhasher
. Doing so may become a compile-time error in the future.Declaration
Swift
public func hash(into hasher: inout Hasher)
Parameters
hasher
The hasher to use when combining the components of this instance.
-
Returns a Boolean value indicating whether two values are equal.
Equality is the inverse of inequality. For any values
a
andb
,a == b
implies thata != b
isfalse
.Declaration
Swift
public static func == (lhs: ManufacturerDataAppleHomeKit, rhs: ManufacturerDataAppleHomeKit) -> Bool
Parameters
lhs
A value to compare.
rhs
Another value to compare.