6 #import <Foundation/Foundation.h>
7 #import <Security/SecureObjectSync/SOSTypes.h>
9 extern NSString
*kKCPairingChannelErrorDomain
;
11 #define KCPairingErrorNoControlChannel 1
12 #define KCPairingErrorTooManySteps 2
13 #define KCPairingErrorAccountCredentialMissing 3
15 typedef void(^KCPairingChannelCompletion
)(BOOL complete
, NSData
*packet
, NSError
*error
);
17 @interface KCPairingChannelContext
: NSObject
18 @
property (strong
) NSString
*model
;
19 @
property (strong
) NSString
*modelVersion
;
20 @
property (strong
) NSString
*modelClass
;
21 @
property (strong
) NSString
*osVersion
;
24 @interface KCPairingChannel
: NSObject
26 @
property (assign
,readonly
) BOOL needInitialSync
;
28 + (instancetype
)pairingChannelInitiator
:(KCPairingChannelContext
*)peerVersionContext
;
29 + (instancetype
)pairingChannelAcceptor
:(KCPairingChannelContext
*)peerVersionContext
;
31 - (instancetype
)initAsInitiator
:(bool)initator version
:(KCPairingChannelContext
*)peerVersionContext
;
32 - (void)validateStart
:(void(^)(bool result
, NSError
*error
))complete
;
34 - (NSData
*)exchangePacket
:(NSData
*)data complete
:(bool *)complete error
:(NSError
**)error
;
36 /* for tests cases only */
37 - (void)setXPCConnectionObject
:(NSXPCConnection
*)connection
;
38 + (bool)isSupportedPlatform
;