├── .gitignore ├── HomeKitBridge.xcodeproj ├── project.pbxproj └── project.xcworkspace │ └── contents.xcworkspacedata ├── HomeKitBridge ├── AppDelegate.h ├── AppDelegate.m ├── Base.lproj │ └── MainMenu.xib ├── HAKAccessory.h ├── HAKAccessoryDelegate.h ├── HAKAccessoryInformationService.h ├── HAKAccessoryKeychainObject.h ├── HAKAddPairingSession.h ├── HAKAddPairingSessionDelegate.h ├── HAKBTLEConnection.h ├── HAKBTLESecuritySession.h ├── HAKBTLETransport.h ├── HAKChaCha20.h ├── HAKChaCha20Poly1305.h ├── HAKChaChaPolyData.h ├── HAKCharacteristic.h ├── HAKCharacteristicMetadata.h ├── HAKCharacteristicReadRequest.h ├── HAKCharacteristicReadResponse.h ├── HAKCharacteristicRequest.h ├── HAKCharacteristicResponse.h ├── HAKCharacteristicWriteRequest.h ├── HAKCharacteristicWriteResponse.h ├── HAKConnection.h ├── HAKConnectionDelegate.h ├── HAKConstraintsFactory.h ├── HAKControllerKeychainObject.h ├── HAKCurve25519.h ├── HAKEnumerationConstraints.h ├── HAKHKDF.h ├── HAKHTTPMessage.h ├── HAKHTTPRequestMessage.h ├── HAKHTTPResponseMessage.h ├── HAKIPCharacteristicReadRequest.h ├── HAKIPConnection.h ├── HAKIPConnectionDelegate.h ├── HAKIPSecuritySession.h ├── HAKIPTransport.h ├── HAKIdentifier.h ├── HAKIdentifyCharacteristic.h ├── HAKInstanceIDPool.h ├── HAKKeychainKey.h ├── HAKKeychainService.h ├── HAKListPairingsSession.h ├── HAKListPairingsSessionDataSource.h ├── HAKListPairingsSessionDelegate.h ├── HAKLogger.h ├── HAKMetadata.h ├── HAKMetadataService.h ├── HAKNetService.h ├── HAKNumberConstraints.h ├── HAKPairSetupCharacteristic.h ├── HAKPairSetupSession.h ├── HAKPairSetupSessionDelegate.h ├── HAKPairVerifyCharacteristic.h ├── HAKPairVerifySession.h ├── HAKPairVerifySessionDelegate.h ├── HAKPairing.h ├── HAKPairingCharacteristic.h ├── HAKPairingService.h ├── HAKPairingSession.h ├── HAKPairingSessionDelegate.h ├── HAKPairingsCharacteristic.h ├── HAKPoly1305.h ├── HAKRemovePairingSession.h ├── HAKRemovePairingSessionDelegate.h ├── HAKSecuritySession.h ├── HAKSecuritySessionPacket.h ├── HAKService.h ├── HAKServiceDelegate.h ├── HAKServiceMetadata.h ├── HAKSocket.h ├── HAKSocketDelegate.h ├── HAKStringConstraints.h ├── HAKTLV8Container.h ├── HAKTLV8Packet.h ├── HAKTransport.h ├── HAKUUID.h ├── HAKValueConstraints.h ├── HueLight.h ├── HueLight.m ├── HueSDK_OSX.framework │ ├── Headers │ ├── HueSDK_OSX │ ├── Resources │ └── Versions │ │ ├── A │ │ ├── Headers │ │ │ ├── HueSDK.h │ │ │ ├── PHBridgeConfiguration.h │ │ │ ├── PHBridgeResource.h │ │ │ ├── PHBridgeResourcesCache.h │ │ │ ├── PHBridgeResourcesReader.h │ │ │ ├── PHBridgeSearching.h │ │ │ ├── PHBridgeSendAPI.h │ │ │ ├── PHError.h │ │ │ ├── PHGroup.h │ │ │ ├── PHHueSDK.h │ │ │ ├── PHLight.h │ │ │ ├── PHLightState.h │ │ │ ├── PHNotificationManager.h │ │ │ ├── PHOverallFactory.h │ │ │ ├── PHScene.h │ │ │ ├── PHSchedule.h │ │ │ ├── PHSoftwareUpdateStatus.h │ │ │ └── PHUtilities.h │ │ ├── HueSDK_OSX │ │ └── Resources │ │ │ ├── Info.plist │ │ │ └── en.lproj │ │ │ └── InfoPlist.strings │ │ └── Current ├── Images.xcassets │ ├── AppIcon.appiconset │ │ ├── Contents.json │ │ ├── icon-1.png │ │ ├── icon-128.png │ │ ├── icon-256-1.png │ │ ├── icon-256.png │ │ ├── icon.png │ │ └── icon@2x.png │ └── closeButton.imageset │ │ ├── Contents.json │ │ ├── closeButton.png │ │ └── closeButton@2x.png ├── Info.plist ├── Lumberjack │ ├── DDASLLogger.h │ ├── DDASLLogger.m │ ├── DDAbstractDatabaseLogger.h │ ├── DDAbstractDatabaseLogger.m │ ├── DDFileLogger.h │ ├── DDFileLogger.m │ ├── DDLog.h │ ├── DDLog.m │ ├── DDTTYLogger.h │ ├── DDTTYLogger.m │ └── Extensions │ │ ├── ContextFilterLogFormatter.h │ │ ├── ContextFilterLogFormatter.m │ │ ├── DispatchQueueLogFormatter.h │ │ └── DispatchQueueLogFormatter.m ├── NSBezierPath+BezierPathQuartzUtilities.h ├── NSBezierPath+BezierPathQuartzUtilities.m ├── NSData-Enumeration.h ├── NSData-HAKChaChaPoly.h ├── NSDictionary-HAK.h ├── NSDictionary-Safe.h ├── NSError-HAKError.h ├── NSFileManager-HAK.h ├── NSMapTable-HAK.h ├── NSNumber-HAK.h ├── NSString-NSData.h ├── NSURL-Query.h ├── NSUserDefaults-HAK.h ├── OTIContainerView.h ├── OTIContainerView.m ├── OTIContentController.h ├── OTIContentController.m ├── OTIHAPCore.h ├── OTIHAPCore.m ├── OTIWindow.h ├── OTIWindow.m ├── SimpleHue.h ├── SimpleHue.m └── main.m └── README.md /.gitignore: -------------------------------------------------------------------------------- 1 | ######################### 2 | # .gitignore file for Xcode4 / OS X Source projects 3 | # 4 | # Version 2.0 5 | # For latest version, see: http://stackoverflow.com/questions/49478/git-ignore-file-for-xcode-projects 6 | # 7 | # 2013 updates: 8 | # - fixed the broken "save personal Schemes" 9 | # 10 | # NB: if you are storing "built" products, this WILL NOT WORK, 11 | # and you should use a different .gitignore (or none at all) 12 | # This file is for SOURCE projects, where there are many extra 13 | # files that we want to exclude 14 | # 15 | ######################### 16 | 17 | ##### 18 | # OS X temporary files that should never be committed 19 | 20 | .DS_Store 21 | *.swp 22 | *.lock 23 | profile 24 | 25 | 26 | #### 27 | # Xcode temporary files that should never be committed 28 | # 29 | # NB: NIB/XIB files still exist even on Storyboard projects, so we want this... 30 | 31 | *~.nib 32 | 33 | 34 | #### 35 | # Xcode build files - 36 | # 37 | # NB: slash on the end, so we only remove the FOLDER, not any files that were badly named "DerivedData" 38 | 39 | DerivedData/ 40 | 41 | # NB: slash on the end, so we only remove the FOLDER, not any files that were badly named "build" 42 | 43 | build/ 44 | 45 | 46 | ##### 47 | # Xcode private settings (window sizes, bookmarks, breakpoints, custom executables, smart groups) 48 | # 49 | # This is complicated: 50 | # 51 | # SOMETIMES you need to put this file in version control. 52 | # Apple designed it poorly - if you use "custom executables", they are 53 | # saved in this file. 54 | # 99% of projects do NOT use those, so they do NOT want to version control this file. 55 | # ..but if you're in the 1%, comment out the line "*.pbxuser" 56 | 57 | *.pbxuser 58 | *.mode1v3 59 | *.mode2v3 60 | *.perspectivev3 61 | # NB: also, whitelist the default ones, some projects need to use these 62 | !default.pbxuser 63 | !default.mode1v3 64 | !default.mode2v3 65 | !default.perspectivev3 66 | 67 | 68 | #### 69 | # Xcode 4 - semi-personal settings 70 | # 71 | # 72 | # OPTION 1: --------------------------------- 73 | # throw away ALL personal settings (including custom schemes! 74 | # - unless they are "shared") 75 | # 76 | # NB: this is exclusive with OPTION 2 below 77 | xcuserdata 78 | 79 | # OPTION 2: --------------------------------- 80 | # get rid of ALL personal settings, but KEEP SOME OF THEM 81 | # - NB: you must manually uncomment the bits you want to keep 82 | # 83 | # NB: this is exclusive with OPTION 1 above 84 | # 85 | #xcuserdata/**/* 86 | 87 | # (requires option 2 above): Personal Schemes 88 | # 89 | #!xcuserdata/**/xcschemes/* 90 | 91 | #### 92 | # XCode 4 workspaces - more detailed 93 | # 94 | # Workspaces are important! They are a core feature of Xcode - don't exclude them :) 95 | # 96 | # Workspace layout is quite spammy. For reference: 97 | # 98 | # /(root)/ 99 | # /(project-name).xcodeproj/ 100 | # project.pbxproj 101 | # /project.xcworkspace/ 102 | # contents.xcworkspacedata 103 | # /xcuserdata/ 104 | # /(your name)/xcuserdatad/ 105 | # UserInterfaceState.xcuserstate 106 | # /xcsshareddata/ 107 | # /xcschemes/ 108 | # (shared scheme name).xcscheme 109 | # /xcuserdata/ 110 | # /(your name)/xcuserdatad/ 111 | # (private scheme).xcscheme 112 | # xcschememanagement.plist 113 | # 114 | # 115 | 116 | #### 117 | # Xcode 4 - Deprecated classes 118 | # 119 | # Allegedly, if you manually "deprecate" your classes, they get moved here. 120 | # 121 | # We're using source-control, so this is a "feature" that we do not want! 122 | 123 | *.moved-aside 124 | 125 | 126 | #### 127 | # UNKNOWN: recommended by others, but I can't discover what these files are 128 | # 129 | # ...none. Everything is now explained. 130 | -------------------------------------------------------------------------------- /HomeKitBridge.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /HomeKitBridge/AppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.h 3 | // HomeKitBridge 4 | // 5 | // Created by Khaos Tian on 7/18/14. 6 | // Copyright (c) 2014 Oltica. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface AppDelegate : NSObject 12 | 13 | 14 | @end 15 | 16 | -------------------------------------------------------------------------------- /HomeKitBridge/AppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.m 3 | // HomeKitBridge 4 | // 5 | // Created by Khaos Tian on 7/18/14. 6 | // Copyright (c) 2014 Oltica. All rights reserved. 7 | // 8 | 9 | #import "AppDelegate.h" 10 | #import "OTIContentController.h" 11 | #import "OTIHAPCore.h" 12 | #import "SimpleHue.h" 13 | 14 | @interface AppDelegate () 15 | 16 | @property (weak) IBOutlet NSWindow *window; 17 | 18 | @property (strong,nonatomic) OTIContentController *contentController; 19 | @property (strong,nonatomic) OTIHAPCore *accessoryCore; 20 | @property (strong,nonatomic) SimpleHue *hueController; 21 | 22 | @property (weak) IBOutlet NSTextField *passwordLabel; 23 | @property (weak) IBOutlet NSButton *closeButton; 24 | @property (weak) IBOutlet NSView *contentView; 25 | 26 | - (IBAction)closeApp:(id)sender; 27 | 28 | @end 29 | 30 | @implementation AppDelegate 31 | 32 | - (void)applicationDidFinishLaunching:(NSNotification *)aNotification { 33 | _accessoryCore = [[OTIHAPCore alloc]initAsBridge:YES]; 34 | [_accessoryCore startTransport]; 35 | 36 | _contentController = [[OTIContentController alloc]init]; 37 | _contentController.view = _contentView; 38 | 39 | _closeButton.layer = [CALayer layer]; 40 | _closeButton.layer.backgroundColor = [NSColor whiteColor].CGColor; 41 | _closeButton.wantsLayer = YES; 42 | 43 | _passwordLabel.stringValue = _accessoryCore.password; 44 | _passwordLabel.wantsLayer = YES; 45 | _passwordLabel.layer.backgroundColor = [NSColor whiteColor].CGColor; 46 | 47 | _hueController = [[SimpleHue alloc]init]; 48 | _hueController.accessoryCore = _accessoryCore; 49 | // Insert code here to initialize your application 50 | } 51 | 52 | - (void)applicationWillTerminate:(NSNotification *)aNotification { 53 | // Insert code here to tear down your application 54 | } 55 | 56 | - (IBAction)closeApp:(id)sender { 57 | [[NSApplication sharedApplication] hide:self]; 58 | } 59 | 60 | - (IBAction)resetPairings:(id)sender { 61 | [_accessoryCore resetTransportPairings]; 62 | } 63 | 64 | @end 65 | -------------------------------------------------------------------------------- /HomeKitBridge/HAKAccessory.h: -------------------------------------------------------------------------------- 1 | // 2 | // Generated by class-dump 3.5 (64 bit). 3 | // 4 | // class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2013 by Steve Nygard. 5 | // 6 | 7 | @import Foundation; 8 | #import "HAKService.h" 9 | 10 | @interface HAKAccessory : NSObject 11 | { 12 | NSMutableArray *_services; 13 | NSNumber *_instanceID; 14 | NSHashTable *_transportRefs; 15 | NSObject *_workQueue; 16 | } 17 | 18 | + (id)pairingUUID; 19 | + (id)accessoryInformationUUID; 20 | + (id)servicesToFilter; 21 | @property(retain, nonatomic) NSObject *workQueue; // @synthesize workQueue=_workQueue; 22 | @property(retain, nonatomic) NSHashTable *transportRefs; // @synthesize transportRefs=_transportRefs; 23 | //@property(retain, nonatomic) HAKInstanceIDPool *instanceIDPool; // @synthesize instanceIDPool=_instanceIDPool; 24 | @property(retain, nonatomic) NSNumber *instanceID; // @synthesize instanceID=_instanceID; 25 | @property(nonatomic) __weak id delegate; // @synthesize delegate=_delegate; 26 | @property(retain, nonatomic) NSArray *services; // @synthesize services=_services; 27 | @property(copy, nonatomic) NSString *serialNumber; 28 | @property(copy, nonatomic) NSString *manufacturer; 29 | @property(copy, nonatomic) NSString *model; 30 | @property(copy, nonatomic) NSString *name; 31 | @property(readonly, nonatomic) __weak HAKService *accessoryInformationService; 32 | - (id)serviceWithType:(id)arg1; 33 | - (id)serviceWithInstanceId:(unsigned long long)arg1; 34 | - (BOOL)_removeService:(id)arg1; 35 | - (void)removeService:(id)arg1; 36 | - (BOOL)_addService:(id)arg1 error:(id *)arg2; 37 | - (void)addService:(id)arg1; 38 | - (void)removeTransport:(id)arg1; 39 | - (void)addTransport:(id)arg1; 40 | @property(readonly, nonatomic) NSArray *transports; 41 | - (void)_handleUpdatedService:(id)arg1; 42 | - (void)service:(id)arg1 didRemoveCharacteristic:(id)arg2; 43 | - (void)service:(id)arg1 didAddCharacteristic:(id)arg2; 44 | - (void)encodeWithCoder:(id)arg1; 45 | - (id)initWithCoder:(id)arg1; 46 | - (id)copyWithZone:(struct _NSZone *)arg1; 47 | - (id)initWithAccessoryInformationService:(id)arg1 pairingService:(id)arg2; 48 | - (id)init; 49 | - (id)characteristicWithInstanceId:(unsigned long long)arg1; 50 | - (id)JSONObject; 51 | 52 | // Remaining properties 53 | @property(readonly, copy) NSString *debugDescription; 54 | @property(readonly, copy) NSString *description; 55 | @property(readonly) unsigned long long hash; 56 | @property(readonly) Class superclass; 57 | 58 | @end 59 | 60 | -------------------------------------------------------------------------------- /HomeKitBridge/HAKAccessoryDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // Generated by class-dump 3.5 (64 bit). 3 | // 4 | // class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2013 by Steve Nygard. 5 | // 6 | 7 | @import Foundation; 8 | 9 | @class HAKAccessory, HAKService, NSError; 10 | 11 | @protocol HAKAccessoryDelegate 12 | 13 | @optional 14 | - (void)accessory:(HAKAccessory *)arg1 didUpdateService:(HAKService *)arg2; 15 | - (void)accessory:(HAKAccessory *)arg1 didRemoveService:(HAKService *)arg2; 16 | - (void)accessory:(HAKAccessory *)arg1 didFailToAddService:(HAKService *)arg2 error:(NSError *)arg3; 17 | - (void)accessory:(HAKAccessory *)arg1 didAddService:(HAKService *)arg2; 18 | @end 19 | 20 | -------------------------------------------------------------------------------- /HomeKitBridge/HAKAccessoryInformationService.h: -------------------------------------------------------------------------------- 1 | // 2 | // Generated by class-dump 3.5 (64 bit). 3 | // 4 | // class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2013 by Steve Nygard. 5 | // 6 | 7 | #import "HAKService.h" 8 | 9 | @class HAKCharacteristic; 10 | 11 | @interface HAKAccessoryInformationService : HAKService 12 | { 13 | } 14 | 15 | + (id)accessoryInformationService; 16 | @property(readonly, nonatomic) HAKCharacteristic *serialNumberCharacteristic; 17 | @property(readonly, nonatomic) HAKCharacteristic *modelCharacteristic; 18 | @property(readonly, nonatomic) HAKCharacteristic *manufacturerCharacteristic; 19 | @property(readonly, nonatomic) HAKCharacteristic *nameCharacteristic; 20 | @property(readonly, nonatomic) HAKCharacteristic *identifyCharacteristic; 21 | - (void)addIncludedService:(id)arg1; 22 | - (void)removeCharacteristic:(id)arg1; 23 | - (id)_restrictedCharacteristicSet; 24 | - (id)initWithType:(id)arg1 isPrimary:(BOOL)arg2 characteristics:(id)arg3 includedServices:(id)arg4; 25 | - (id)init; 26 | 27 | @end 28 | 29 | -------------------------------------------------------------------------------- /HomeKitBridge/HAKAccessoryKeychainObject.h: -------------------------------------------------------------------------------- 1 | // 2 | // Generated by class-dump 3.5 (64 bit). 3 | // 4 | // class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2013 by Steve Nygard. 5 | // 6 | 7 | @import Foundation; 8 | 9 | @class HAKKeychainKey, NSArray, NSString; 10 | 11 | @interface HAKAccessoryKeychainObject : NSObject 12 | { 13 | NSString *_identifier; 14 | HAKKeychainKey *_key; 15 | } 16 | 17 | @property(retain, nonatomic) HAKKeychainKey *key; // @synthesize key=_key; 18 | @property(copy, nonatomic) NSString *identifier; // @synthesize identifier=_identifier; 19 | - (BOOL)removeController:(id)arg1 error:(id *)arg2; 20 | - (BOOL)addController:(id)arg1 error:(id *)arg2; 21 | - (id)controllerWithIdentifier:(id)arg1; 22 | @property(readonly, nonatomic) NSArray *controllers; 23 | - (id)initWithIdentifier:(id)arg1; 24 | 25 | @end 26 | 27 | -------------------------------------------------------------------------------- /HomeKitBridge/HAKAddPairingSession.h: -------------------------------------------------------------------------------- 1 | // 2 | // Generated by class-dump 3.5 (64 bit). 3 | // 4 | // class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2013 by Steve Nygard. 5 | // 6 | 7 | #import "HAKPairingSession.h" 8 | 9 | @class HAKTLV8Container; 10 | 11 | @interface HAKAddPairingSession : HAKPairingSession 12 | { 13 | unsigned char _state; 14 | id _delegate; 15 | HAKTLV8Container *_stateData; 16 | } 17 | 18 | @property(retain, nonatomic) HAKTLV8Container *stateData; // @synthesize stateData=_stateData; 19 | @property(nonatomic) unsigned char state; // @synthesize state=_state; 20 | @property __weak id delegate; // @synthesize delegate=_delegate; 21 | - (id)handlePairingSessionReadRequest; 22 | - (long long)handlePairingSessionWriteRequest:(id)arg1; 23 | - (void)_lockSession; 24 | - (id)_tlv8ResponseWithError:(unsigned char)arg1; 25 | - (id)init; 26 | 27 | @end 28 | 29 | -------------------------------------------------------------------------------- /HomeKitBridge/HAKAddPairingSessionDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // Generated by class-dump 3.5 (64 bit). 3 | // 4 | // class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2013 by Steve Nygard. 5 | // 6 | 7 | #import "HAKPairingSessionDelegate.h" 8 | 9 | @class HAKAddPairingSession, HAKPairing; 10 | 11 | @protocol HAKAddPairingSessionDelegate 12 | - (void)addPairingSession:(HAKAddPairingSession *)arg1 didAddPairing:(HAKPairing *)arg2; 13 | - (BOOL)controllerIsAdminForAddPairingSession:(HAKAddPairingSession *)arg1; 14 | @end 15 | 16 | -------------------------------------------------------------------------------- /HomeKitBridge/HAKBTLEConnection.h: -------------------------------------------------------------------------------- 1 | // 2 | // Generated by class-dump 3.5 (64 bit). 3 | // 4 | // class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2013 by Steve Nygard. 5 | // 6 | 7 | #import "HAKConnection.h" 8 | 9 | @class CBCentral; 10 | 11 | @interface HAKBTLEConnection : HAKConnection 12 | { 13 | CBCentral *_central; 14 | } 15 | 16 | @property(readonly, nonatomic) CBCentral *central; // @synthesize central=_central; 17 | - (void)handleWriteRequests:(id)arg1; 18 | - (void)handleReadRequest:(id)arg1; 19 | - (BOOL)encryptWithIdentifier:(id)arg1 sharedSecret:(id)arg2; 20 | - (id)description; 21 | - (BOOL)isEqual:(id)arg1; 22 | - (unsigned long long)hash; 23 | - (id)initWithTransport:(id)arg1 central:(id)arg2; 24 | 25 | @end 26 | 27 | -------------------------------------------------------------------------------- /HomeKitBridge/HAKBTLESecuritySession.h: -------------------------------------------------------------------------------- 1 | // 2 | // Generated by class-dump 3.5 (64 bit). 3 | // 4 | // class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2013 by Steve Nygard. 5 | // 6 | 7 | #import "HAKSecuritySession.h" 8 | 9 | @interface HAKBTLESecuritySession : HAKSecuritySession 10 | { 11 | } 12 | 13 | - (id)decryptData:(id)arg1; 14 | - (id)encryptData:(id)arg1; 15 | 16 | @end 17 | 18 | -------------------------------------------------------------------------------- /HomeKitBridge/HAKBTLETransport.h: -------------------------------------------------------------------------------- 1 | // 2 | // Generated by class-dump 3.5 (64 bit). 3 | // 4 | // class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2013 by Steve Nygard. 5 | // 6 | 7 | #import "HAKTransport.h" 8 | 9 | #import "CBPeripheralManagerDelegate.h" 10 | 11 | @class CBPeripheralManager, HAKPairingService, NSMapTable, NSString; 12 | 13 | @interface HAKBTLETransport : HAKTransport 14 | { 15 | CBPeripheralManager *_peripheralManager; 16 | HAKPairingService *_pairingService; 17 | NSMapTable *_cbServices; 18 | NSMapTable *_pendingReadRequests; 19 | } 20 | 21 | + (unsigned long long)maxSupportedAccessories; 22 | @property(retain, nonatomic) NSMapTable *pendingReadRequests; // @synthesize pendingReadRequests=_pendingReadRequests; 23 | @property(retain, nonatomic, setter=setCBServices:) NSMapTable *cbServices; // @synthesize cbServices=_cbServices; 24 | @property(retain, nonatomic) HAKPairingService *pairingService; // @synthesize pairingService=_pairingService; 25 | @property(retain, nonatomic) CBPeripheralManager *peripheralManager; // @synthesize peripheralManager=_peripheralManager; 26 | - (id)_connectionForCentral:(id)arg1; 27 | - (id)_characteristicForCBCharacteristic:(id)arg1; 28 | - (void)_addCBServices; 29 | - (void)_removeService:(id)arg1; 30 | - (void)_addService:(id)arg1; 31 | - (void)_startAdvertising; 32 | - (id)_advertisementData; 33 | - (unsigned long long)type; 34 | - (BOOL)updateValue:(id)arg1 forCharacteristic:(id)arg2 onSubscribedConnections:(id)arg3; 35 | - (void)stop; 36 | - (void)start; 37 | - (void)accessory:(id)arg1 didUpdateService:(id)arg2; 38 | - (void)accessory:(id)arg1 didRemoveService:(id)arg2; 39 | - (void)accessory:(id)arg1 didAddService:(id)arg2; 40 | - (void)peripheralManager:(id)arg1 didReceiveWriteRequests:(id)arg2; 41 | - (void)peripheralManager:(id)arg1 didReceiveReadRequest:(id)arg2; 42 | - (void)peripheralManager:(id)arg1 central:(id)arg2 didUnsubscribeFromCharacteristic:(id)arg3; 43 | - (void)peripheralManager:(id)arg1 central:(id)arg2 didSubscribeToCharacteristic:(id)arg3; 44 | - (void)peripheralManagerDidStartAdvertising:(id)arg1 error:(id)arg2; 45 | - (void)peripheralManagerDidUpdateState:(id)arg1; 46 | - (id)initWithCoder:(id)arg1; 47 | - (id)init; 48 | 49 | // Remaining properties 50 | @property(readonly, copy) NSString *debugDescription; 51 | @property(readonly, copy) NSString *description; 52 | @property(readonly) unsigned long long hash; 53 | @property(readonly) Class superclass; 54 | 55 | @end 56 | 57 | -------------------------------------------------------------------------------- /HomeKitBridge/HAKChaCha20.h: -------------------------------------------------------------------------------- 1 | // 2 | // Generated by class-dump 3.5 (64 bit). 3 | // 4 | // class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2013 by Steve Nygard. 5 | // 6 | 7 | @import Foundation; 8 | 9 | @interface HAKChaCha20 : NSObject 10 | { 11 | struct { 12 | unsigned int _field1[16]; 13 | } *_wContext; 14 | } 15 | 16 | + (BOOL)isNonceValid:(id)arg1; 17 | + (BOOL)isKeyValid:(id)arg1; 18 | - (id)decryptData:(id)arg1; 19 | - (id)encryptData:(id)arg1; 20 | - (void)dealloc; 21 | - (id)initWithKey:(id)arg1 nonce:(id)arg2; 22 | 23 | @end 24 | 25 | -------------------------------------------------------------------------------- /HomeKitBridge/HAKChaCha20Poly1305.h: -------------------------------------------------------------------------------- 1 | // 2 | // Generated by class-dump 3.5 (64 bit). 3 | // 4 | // class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2013 by Steve Nygard. 5 | // 6 | 7 | @import Foundation; 8 | 9 | @class HAKChaCha20, HAKPoly1305; 10 | 11 | @interface HAKChaCha20Poly1305 : NSObject 12 | { 13 | HAKChaCha20 *_chaCha20; 14 | HAKPoly1305 *_poly1305; 15 | } 16 | 17 | @property(retain, nonatomic) HAKPoly1305 *poly1305; // @synthesize poly1305=_poly1305; 18 | @property(retain, nonatomic) HAKChaCha20 *chaCha20; // @synthesize chaCha20=_chaCha20; 19 | - (id)decryptFromData:(id)arg1 additionalAuthenticatedData:(id)arg2 error:(id *)arg3; 20 | - (id)encryptWithData:(id)arg1 additionalAuthenticatedData:(id)arg2 error:(id *)arg3; 21 | - (void)_updateWithPadding:(id)arg1; 22 | - (id)authTagFromEncryptedData:(id)arg1 additionalAuthenticatedData:(id)arg2; 23 | - (id)initWithKey:(id)arg1 nonce:(id)arg2; 24 | 25 | @end 26 | 27 | -------------------------------------------------------------------------------- /HomeKitBridge/HAKChaChaPolyData.h: -------------------------------------------------------------------------------- 1 | // 2 | // Generated by class-dump 3.5 (64 bit). 3 | // 4 | // class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2013 by Steve Nygard. 5 | // 6 | 7 | @import Foundation; 8 | 9 | @class NSData; 10 | 11 | @interface HAKChaChaPolyData : NSObject 12 | { 13 | NSData *_data; 14 | } 15 | 16 | @property(copy, nonatomic) NSData *data; // @synthesize data=_data; 17 | @property(readonly, nonatomic) NSData *authTag; 18 | @property(readonly, nonatomic) NSData *encryptedData; 19 | - (id)description; 20 | - (id)initWithData:(id)arg1; 21 | 22 | @end 23 | 24 | -------------------------------------------------------------------------------- /HomeKitBridge/HAKCharacteristic.h: -------------------------------------------------------------------------------- 1 | // 2 | // Generated by class-dump 3.5 (64 bit). 3 | // 4 | // class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2013 by Steve Nygard. 5 | // 6 | 7 | @import Foundation; 8 | 9 | @class HAKService, HAKUUID, HAKValueConstraints, NSArray, NSHashTable, NSNumber, NSString; 10 | 11 | @interface HAKCharacteristic : NSObject 12 | { 13 | id _value; 14 | HAKService *_service; 15 | HAKUUID *_type; 16 | NSNumber *_instanceID; 17 | NSString *_manufacturerDescription; 18 | unsigned long long _properties; 19 | unsigned long long _permissions; 20 | unsigned long long _format; 21 | unsigned long long _unit; 22 | HAKValueConstraints *_constraints; 23 | NSObject *_workQueue; 24 | NSHashTable *_subscribedConnectionsTable; 25 | } 26 | 27 | + (id)stringForUnit:(unsigned long long)arg1; 28 | + (id)stringForFormat:(unsigned long long)arg1; 29 | @property(retain, nonatomic) NSHashTable *subscribedConnectionsTable; // @synthesize subscribedConnectionsTable=_subscribedConnectionsTable; 30 | @property(retain, nonatomic) NSObject *workQueue; // @synthesize workQueue=_workQueue; 31 | @property(copy, nonatomic) HAKValueConstraints *constraints; // @synthesize constraints=_constraints; 32 | @property(nonatomic) unsigned long long unit; // @synthesize unit=_unit; 33 | @property(readonly, nonatomic) unsigned long long format; // @synthesize format=_format; 34 | @property(nonatomic) unsigned long long permissions; // @synthesize permissions=_permissions; 35 | @property(readonly, nonatomic) unsigned long long properties; // @synthesize properties=_properties; 36 | @property(copy, nonatomic) NSString *manufacturerDescription; // @synthesize manufacturerDescription=_manufacturerDescription; 37 | @property(copy, nonatomic) NSNumber *instanceID; // @synthesize instanceID=_instanceID; 38 | @property(retain, nonatomic) HAKUUID *type; // @synthesize type=_type; 39 | @property(nonatomic) __weak HAKService *service; // @synthesize service=_service; 40 | //@property(nonatomic) __weak id delegate; // @synthesize delegate=_delegate; 41 | - (BOOL)_handleValueValidation:(id)arg1; 42 | - (BOOL)validateValue:(id)arg1; 43 | - (void)_handleNotifyingSubscribedConnectionsValueUpdate:(id)arg1 exceptConnection:(id)arg2; 44 | - (void)_handleValueWrite:(id)arg1; 45 | - (id)handleWriteRequest:(id)arg1; 46 | - (id)handleReadRequest:(id)arg1; 47 | - (BOOL)unsubscribeConnection:(id)arg1; 48 | - (BOOL)subscribeConnection:(id)arg1; 49 | - (id)_subscribedConnections; 50 | @property(readonly, nonatomic) NSArray *subscribedConnections; 51 | @property(copy, nonatomic) id value; // @synthesize value=_value; 52 | @property(readonly, nonatomic, getter=isNotifying) BOOL notifying; 53 | - (void)encodeWithCoder:(id)arg1; 54 | - (id)initWithCoder:(id)arg1; 55 | - (id)copyWithZone:(struct _NSZone *)arg1; 56 | - (BOOL)isEqual:(id)arg1; 57 | - (unsigned long long)hash; 58 | - (id)_description; 59 | - (id)description; 60 | - (id)initWithType:(id)arg1 properties:(unsigned long long)arg2 format:(unsigned long long)arg3; 61 | - (id)initWithType:(id)arg1; 62 | - (id)init; 63 | - (id)responseJSONObjectWithReadRequest:(id)arg1 status:(long long *)arg2; 64 | - (id)responseJSONObjectWithMetadata:(BOOL)arg1 properties:(BOOL)arg2 type:(BOOL)arg3 events:(BOOL)arg4 cachedValue:(BOOL)arg5; 65 | - (id)propertiesJSONObject; 66 | - (id)JSONObject; 67 | - (id)transformJSONValue:(id)arg1; 68 | - (id)JSONTransformValue:(id)arg1; 69 | - (id)JSONValue; 70 | - (id)cbDecodeValue:(id)arg1; 71 | - (id)cbEncodeValue:(id)arg1; 72 | - (id)cbMutableCharacteristic; 73 | - (id)cbUserDescriptor; 74 | 75 | @end 76 | 77 | -------------------------------------------------------------------------------- /HomeKitBridge/HAKCharacteristicMetadata.h: -------------------------------------------------------------------------------- 1 | // 2 | // Generated by class-dump 3.5 (64 bit). 3 | // 4 | // class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2013 by Steve Nygard. 5 | // 6 | 7 | @import Foundation; 8 | 9 | @class HAKUUID, HAKValueConstraints, NSString; 10 | 11 | @interface HAKCharacteristicMetadata : NSObject 12 | { 13 | HAKUUID *_type; 14 | NSString *_name; 15 | unsigned long long _properties; 16 | unsigned long long _permissions; 17 | unsigned long long _format; 18 | unsigned long long _unit; 19 | HAKValueConstraints *_constraints; 20 | } 21 | 22 | @property(readonly, nonatomic) HAKValueConstraints *constraints; // @synthesize constraints=_constraints; 23 | @property(readonly, nonatomic) unsigned long long unit; // @synthesize unit=_unit; 24 | @property(readonly, nonatomic) unsigned long long format; // @synthesize format=_format; 25 | @property(readonly, nonatomic) unsigned long long permissions; // @synthesize permissions=_permissions; 26 | @property(readonly, nonatomic) unsigned long long properties; // @synthesize properties=_properties; 27 | @property(readonly, nonatomic) NSString *name; // @synthesize name=_name; 28 | @property(readonly, nonatomic) HAKUUID *type; // @synthesize type=_type; 29 | - (id)description; 30 | - (BOOL)_setUnitWithString:(id)arg1; 31 | - (BOOL)_setFormatWithString:(id)arg1; 32 | - (id)initWithAttributes:(id)arg1 error:(id *)arg2; 33 | 34 | @end 35 | 36 | -------------------------------------------------------------------------------- /HomeKitBridge/HAKCharacteristicReadRequest.h: -------------------------------------------------------------------------------- 1 | // 2 | // Generated by class-dump 3.5 (64 bit). 3 | // 4 | // class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2013 by Steve Nygard. 5 | // 6 | 7 | #import "HAKCharacteristicRequest.h" 8 | 9 | @interface HAKCharacteristicReadRequest : HAKCharacteristicRequest 10 | { 11 | } 12 | 13 | @end 14 | 15 | -------------------------------------------------------------------------------- /HomeKitBridge/HAKCharacteristicReadResponse.h: -------------------------------------------------------------------------------- 1 | // 2 | // Generated by class-dump 3.5 (64 bit). 3 | // 4 | // class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2013 by Steve Nygard. 5 | // 6 | 7 | #import "HAKCharacteristicResponse.h" 8 | 9 | @interface HAKCharacteristicReadResponse : HAKCharacteristicResponse 10 | { 11 | long long _status; 12 | id _value; 13 | } 14 | 15 | + (id)responseWithRequest:(id)arg1 status:(long long)arg2 value:(id)arg3; 16 | @property(readonly, copy, nonatomic) id value; // @synthesize value=_value; 17 | @property(readonly, nonatomic) long long status; // @synthesize status=_status; 18 | - (BOOL)isEqual:(id)arg1; 19 | - (unsigned long long)hash; 20 | - (id)initWithRequest:(id)arg1 status:(long long)arg2 value:(id)arg3; 21 | - (id)initWithRequest:(id)arg1; 22 | 23 | @end 24 | 25 | -------------------------------------------------------------------------------- /HomeKitBridge/HAKCharacteristicRequest.h: -------------------------------------------------------------------------------- 1 | // 2 | // Generated by class-dump 3.5 (64 bit). 3 | // 4 | // class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2013 by Steve Nygard. 5 | // 6 | 7 | @import Foundation; 8 | 9 | @class HAKCharacteristic, HAKConnection; 10 | 11 | @interface HAKCharacteristicRequest : NSObject 12 | { 13 | HAKConnection *_connection; 14 | HAKCharacteristic *_characteristic; 15 | } 16 | 17 | @property(readonly, nonatomic) HAKCharacteristic *characteristic; // @synthesize characteristic=_characteristic; 18 | @property(readonly, nonatomic) HAKConnection *connection; // @synthesize connection=_connection; 19 | - (BOOL)isEqual:(id)arg1; 20 | - (unsigned long long)hash; 21 | - (id)initWithConnection:(id)arg1 characteristic:(id)arg2; 22 | 23 | @end 24 | 25 | -------------------------------------------------------------------------------- /HomeKitBridge/HAKCharacteristicResponse.h: -------------------------------------------------------------------------------- 1 | // 2 | // Generated by class-dump 3.5 (64 bit). 3 | // 4 | // class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2013 by Steve Nygard. 5 | // 6 | 7 | @import Foundation; 8 | 9 | @class HAKCharacteristicRequest; 10 | 11 | @interface HAKCharacteristicResponse : NSObject 12 | { 13 | BOOL _success; 14 | HAKCharacteristicRequest *_request; 15 | } 16 | 17 | @property(nonatomic) BOOL success; // @synthesize success=_success; 18 | @property(readonly, nonatomic) HAKCharacteristicRequest *request; // @synthesize request=_request; 19 | - (BOOL)isEqual:(id)arg1; 20 | - (unsigned long long)hash; 21 | - (id)initWithRequest:(id)arg1; 22 | 23 | @end 24 | 25 | -------------------------------------------------------------------------------- /HomeKitBridge/HAKCharacteristicWriteRequest.h: -------------------------------------------------------------------------------- 1 | // 2 | // Generated by class-dump 3.5 (64 bit). 3 | // 4 | // class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2013 by Steve Nygard. 5 | // 6 | 7 | #import "HAKCharacteristicRequest.h" 8 | 9 | @class NSData; 10 | 11 | @interface HAKCharacteristicWriteRequest : HAKCharacteristicRequest 12 | { 13 | BOOL _remote; 14 | NSData *_authorizationData; 15 | id _value; 16 | } 17 | 18 | @property(readonly, copy, nonatomic) id value; // @synthesize value=_value; 19 | @property(readonly, nonatomic, getter=isRemote) BOOL remote; // @synthesize remote=_remote; 20 | @property(readonly, nonatomic) NSData *authorizationData; // @synthesize authorizationData=_authorizationData; 21 | - (BOOL)isEqual:(id)arg1; 22 | - (unsigned long long)hash; 23 | - (id)initWithConnection:(id)arg1 characteristic:(id)arg2 authorizationData:(id)arg3 remote:(BOOL)arg4 value:(id)arg5; 24 | - (id)initWithConnection:(id)arg1 characteristic:(id)arg2; 25 | 26 | @end 27 | 28 | -------------------------------------------------------------------------------- /HomeKitBridge/HAKCharacteristicWriteResponse.h: -------------------------------------------------------------------------------- 1 | // 2 | // Generated by class-dump 3.5 (64 bit). 3 | // 4 | // class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2013 by Steve Nygard. 5 | // 6 | 7 | #import "HAKCharacteristicResponse.h" 8 | 9 | @interface HAKCharacteristicWriteResponse : HAKCharacteristicResponse 10 | { 11 | long long _status; 12 | } 13 | 14 | + (id)responseWithRequest:(id)arg1 status:(long long)arg2; 15 | @property(readonly, nonatomic) long long status; // @synthesize status=_status; 16 | - (BOOL)isEqual:(id)arg1; 17 | - (unsigned long long)hash; 18 | - (id)initWithRequest:(id)arg1 status:(long long)arg2; 19 | - (id)initWithRequest:(id)arg1; 20 | 21 | @end 22 | 23 | -------------------------------------------------------------------------------- /HomeKitBridge/HAKConnection.h: -------------------------------------------------------------------------------- 1 | // 2 | // Generated by class-dump 3.5 (64 bit). 3 | // 4 | // class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2013 by Steve Nygard. 5 | // 6 | 7 | @import Foundation; 8 | 9 | @class HAKPairing, HAKSecuritySession, HAKTransport, NSString; 10 | 11 | @interface HAKConnection : NSObject 12 | { 13 | BOOL _open; 14 | id _delegate; 15 | HAKTransport *_transport; 16 | HAKPairing *_pairing; 17 | HAKSecuritySession *_securitySession; 18 | } 19 | 20 | @property(retain, nonatomic) HAKSecuritySession *securitySession; // @synthesize securitySession=_securitySession; 21 | @property(nonatomic, getter=isOpen) BOOL open; // @synthesize open=_open; 22 | @property(nonatomic) __weak HAKPairing *pairing; // @synthesize pairing=_pairing; 23 | @property(readonly, nonatomic) __weak HAKTransport *transport; // @synthesize transport=_transport; 24 | @property __weak id delegate; // @synthesize delegate=_delegate; 25 | - (BOOL)encryptWithIdentifier:(id)arg1 sharedSecret:(id)arg2; 26 | - (BOOL)close; 27 | @property(readonly, nonatomic, getter=isEncrypted) BOOL encrypted; 28 | @property(readonly, nonatomic) NSString *identifier; 29 | - (id)description; 30 | - (void)dealloc; 31 | - (id)initWithTransport:(id)arg1; 32 | 33 | @end 34 | 35 | -------------------------------------------------------------------------------- /HomeKitBridge/HAKConnectionDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // Generated by class-dump 3.5 (64 bit). 3 | // 4 | // class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2013 by Steve Nygard. 5 | // 6 | 7 | @import Foundation; 8 | 9 | @class HAKConnection; 10 | 11 | @protocol HAKConnectionDelegate 12 | 13 | @optional 14 | - (void)connectionDidEncrypt:(HAKConnection *)arg1; 15 | - (void)connectionDidClose:(HAKConnection *)arg1; 16 | @end 17 | 18 | -------------------------------------------------------------------------------- /HomeKitBridge/HAKConstraintsFactory.h: -------------------------------------------------------------------------------- 1 | // 2 | // Generated by class-dump 3.5 (64 bit). 3 | // 4 | // class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2013 by Steve Nygard. 5 | // 6 | 7 | @import Foundation; 8 | 9 | @interface HAKConstraintsFactory : NSObject 10 | { 11 | } 12 | 13 | + (id)constraintsForAttributes:(id)arg1; 14 | 15 | @end 16 | 17 | -------------------------------------------------------------------------------- /HomeKitBridge/HAKControllerKeychainObject.h: -------------------------------------------------------------------------------- 1 | // 2 | // Generated by class-dump 3.5 (64 bit). 3 | // 4 | // class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2013 by Steve Nygard. 5 | // 6 | 7 | @import Foundation; 8 | 9 | @class HAKAccessoryKeychainObject, HAKKeychainKey, NSString; 10 | 11 | @interface HAKControllerKeychainObject : NSObject 12 | { 13 | BOOL _admin; 14 | NSString *_identifier; 15 | HAKKeychainKey *_key; 16 | HAKAccessoryKeychainObject *_accessoryKeychainObject; 17 | } 18 | 19 | @property(nonatomic) __weak HAKAccessoryKeychainObject *accessoryKeychainObject; // @synthesize accessoryKeychainObject=_accessoryKeychainObject; 20 | @property(retain, nonatomic) HAKKeychainKey *key; // @synthesize key=_key; 21 | @property(readonly, nonatomic, getter=isAdmin) BOOL admin; // @synthesize admin=_admin; 22 | @property(copy, nonatomic) NSString *identifier; // @synthesize identifier=_identifier; 23 | - (id)initWithIdentifier:(id)arg1 publicKey:(id)arg2 admin:(BOOL)arg3; 24 | - (id)initWithKey:(id)arg1; 25 | 26 | @end 27 | 28 | -------------------------------------------------------------------------------- /HomeKitBridge/HAKCurve25519.h: -------------------------------------------------------------------------------- 1 | // 2 | // Generated by class-dump 3.5 (64 bit). 3 | // 4 | // class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2013 by Steve Nygard. 5 | // 6 | 7 | @import Foundation; 8 | 9 | @interface HAKCurve25519 : NSObject 10 | { 11 | } 12 | 13 | + (id)sharedKeyWithSecretKey:(id)arg1 publicKey:(id)arg2; 14 | + (id)publicKeyWithSecretKey:(id)arg1; 15 | + (id)secretKey; 16 | 17 | @end 18 | 19 | -------------------------------------------------------------------------------- /HomeKitBridge/HAKEnumerationConstraints.h: -------------------------------------------------------------------------------- 1 | // 2 | // Generated by class-dump 3.5 (64 bit). 3 | // 4 | // class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2013 by Steve Nygard. 5 | // 6 | 7 | #import "HAKValueConstraints.h" 8 | 9 | @class NSDictionary; 10 | 11 | @interface HAKEnumerationConstraints : HAKValueConstraints 12 | { 13 | NSDictionary *_validValues; 14 | } 15 | 16 | @property(readonly, copy, nonatomic) NSDictionary *validValues; // @synthesize validValues=_validValues; 17 | - (void)encodeWithCoder:(id)arg1; 18 | - (id)initWithCoder:(id)arg1; 19 | - (id)copyWithZone:(struct _NSZone *)arg1; 20 | - (BOOL)validateValue:(id)arg1; 21 | - (id)description; 22 | - (id)initWithValidValues:(id)arg1; 23 | - (id)init; 24 | 25 | @end 26 | 27 | -------------------------------------------------------------------------------- /HomeKitBridge/HAKHKDF.h: -------------------------------------------------------------------------------- 1 | // 2 | // Generated by class-dump 3.5 (64 bit). 3 | // 4 | // class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2013 by Steve Nygard. 5 | // 6 | 7 | @import Foundation; 8 | 9 | @class NSData; 10 | 11 | @interface HAKHKDF : NSObject 12 | { 13 | unsigned long long _type; 14 | NSData *_pseudoRandomKey; 15 | } 16 | 17 | + (id)hashWithType:(unsigned long long)arg1 key:(id)arg2 salt:(id)arg3 info:(id)arg4 length:(unsigned long long)arg5; 18 | @property(retain, nonatomic) NSData *pseudoRandomKey; // @synthesize pseudoRandomKey=_pseudoRandomKey; 19 | - (id)expandWithInfo:(id)arg1 length:(unsigned long long)arg2; 20 | - (void)extractWithSalt:(id)arg1 inputKey:(id)arg2; 21 | - (unsigned int)hmacAlgorithm; 22 | - (unsigned long long)digestLength; 23 | - (id)initWithHKDFType:(unsigned long long)arg1; 24 | - (id)init; 25 | 26 | @end 27 | 28 | -------------------------------------------------------------------------------- /HomeKitBridge/HAKHTTPMessage.h: -------------------------------------------------------------------------------- 1 | // 2 | // Generated by class-dump 3.5 (64 bit). 3 | // 4 | // class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2013 by Steve Nygard. 5 | // 6 | 7 | @import Foundation; 8 | 9 | @class NSData, NSDate, NSDictionary, NSString; 10 | 11 | @interface HAKHTTPMessage : NSObject 12 | { 13 | struct __CFHTTPMessage *_message; 14 | BOOL _encrypted; 15 | } 16 | 17 | + (id)dateFormatter; 18 | @property(nonatomic, getter=isEncrypted) BOOL encrypted; // @synthesize encrypted=_encrypted; 19 | @property(readonly, nonatomic) NSDate *date; 20 | @property(readonly, nonatomic) NSString *contentType; 21 | @property(readonly, nonatomic) unsigned long long contentLength; 22 | - (id)serialize; 23 | @property(readonly, nonatomic) NSString *version; 24 | @property(readonly, nonatomic) NSData *body; 25 | - (id)fieldValueForFieldName:(id)arg1; 26 | @property(readonly, nonatomic) NSDictionary *allHeaderFields; 27 | - (void)appendData:(id)arg1; 28 | @property(readonly, nonatomic) BOOL isHeaderComplete; 29 | - (id)description; 30 | - (void)dealloc; 31 | @property(readonly, nonatomic) NSData *tlv8Data; 32 | @property(readonly, nonatomic) id JSONObject; 33 | 34 | @end 35 | 36 | -------------------------------------------------------------------------------- /HomeKitBridge/HAKHTTPRequestMessage.h: -------------------------------------------------------------------------------- 1 | // 2 | // Generated by class-dump 3.5 (64 bit). 3 | // 4 | // class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2013 by Steve Nygard. 5 | // 6 | 7 | #import "HAKHTTPMessage.h" 8 | 9 | @class HAKIPConnection, NSString, NSURL; 10 | 11 | @interface HAKHTTPRequestMessage : HAKHTTPMessage 12 | { 13 | HAKIPConnection *_connection; 14 | } 15 | 16 | @property(readonly, nonatomic) HAKIPConnection *connection; // @synthesize connection=_connection; 17 | @property(readonly, nonatomic) BOOL isComplete; 18 | @property(readonly, nonatomic) BOOL isBodyComplete; 19 | @property(readonly, nonatomic) unsigned long long bodyLength; 20 | @property(readonly, nonatomic) NSURL *url; 21 | @property(readonly, nonatomic) NSString *method; 22 | - (id)description; 23 | - (id)initWithConnection:(id)arg1; 24 | 25 | @end 26 | 27 | -------------------------------------------------------------------------------- /HomeKitBridge/HAKHTTPResponseMessage.h: -------------------------------------------------------------------------------- 1 | // 2 | // Generated by class-dump 3.5 (64 bit). 3 | // 4 | // class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2013 by Steve Nygard. 5 | // 6 | 7 | #import "HAKHTTPMessage.h" 8 | 9 | @class NSData, NSDate, NSString; 10 | 11 | @interface HAKHTTPResponseMessage : HAKHTTPMessage 12 | { 13 | NSString *_statusDescription; 14 | } 15 | 16 | @property(readonly, nonatomic) NSString *statusDescription; // @synthesize statusDescription=_statusDescription; 17 | - (void)setDateToNow; 18 | @property(retain, nonatomic) NSDate *date; 19 | @property(retain, nonatomic) NSString *contentType; 20 | @property(nonatomic) unsigned long long contentLength; 21 | - (void)setValue:(id)arg1 forHeaderField:(id)arg2; 22 | @property(retain, nonatomic) NSData *body; 23 | @property(readonly, nonatomic) unsigned long long statusCode; 24 | - (id)description; 25 | - (id)initWithRequest:(id)arg1 statusCode:(unsigned long long)arg2 statusDescription:(id)arg3 httpVersion:(id)arg4; 26 | - (id)initWithRequest:(id)arg1 statusCode:(unsigned long long)arg2; 27 | - (id)init; 28 | @property(retain, nonatomic) id JSONObject; 29 | @property(retain, nonatomic) NSData *tlv8Data; 30 | 31 | @end 32 | 33 | -------------------------------------------------------------------------------- /HomeKitBridge/HAKIPCharacteristicReadRequest.h: -------------------------------------------------------------------------------- 1 | // 2 | // Generated by class-dump 3.5 (64 bit). 3 | // 4 | // class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2013 by Steve Nygard. 5 | // 6 | 7 | #import "HAKCharacteristicReadRequest.h" 8 | 9 | @interface HAKIPCharacteristicReadRequest : HAKCharacteristicReadRequest 10 | { 11 | BOOL _metadata; 12 | BOOL _permissions; 13 | BOOL _format; 14 | BOOL _notify; 15 | } 16 | 17 | @property(readonly, nonatomic) BOOL notify; // @synthesize notify=_notify; 18 | @property(readonly, nonatomic) BOOL format; // @synthesize format=_format; 19 | @property(readonly, nonatomic) BOOL permissions; // @synthesize permissions=_permissions; 20 | @property(readonly, nonatomic) BOOL metadata; // @synthesize metadata=_metadata; 21 | - (BOOL)isEqual:(id)arg1; 22 | - (unsigned long long)hash; 23 | - (id)initWithConnection:(id)arg1 characteristic:(id)arg2 metadata:(BOOL)arg3 permissions:(BOOL)arg4 format:(BOOL)arg5 notify:(BOOL)arg6; 24 | 25 | @end 26 | 27 | -------------------------------------------------------------------------------- /HomeKitBridge/HAKIPConnection.h: -------------------------------------------------------------------------------- 1 | // 2 | // Generated by class-dump 3.5 (64 bit). 3 | // 4 | // class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2013 by Steve Nygard. 5 | // 6 | 7 | #import "HAKConnection.h" 8 | 9 | #import "NSStreamDelegate.h" 10 | 11 | @class HAKHTTPRequestMessage, HAKSecuritySessionPacket, NSHost, NSInputStream, NSOutputStream, NSString; 12 | 13 | @interface HAKIPConnection : HAKConnection 14 | { 15 | NSInputStream *_inputStream; 16 | NSOutputStream *_outputStream; 17 | NSHost *_host; 18 | NSObject *_workQueue; 19 | HAKSecuritySessionPacket *_currentPacket; 20 | HAKHTTPRequestMessage *_currentRequest; 21 | } 22 | 23 | @property(retain, nonatomic) HAKHTTPRequestMessage *currentRequest; // @synthesize currentRequest=_currentRequest; 24 | @property(retain, nonatomic) HAKSecuritySessionPacket *currentPacket; // @synthesize currentPacket=_currentPacket; 25 | @property(retain, nonatomic) NSObject *workQueue; // @synthesize workQueue=_workQueue; 26 | @property(readonly, nonatomic) NSHost *host; // @synthesize host=_host; 27 | - (void)stream:(id)arg1 handleEvent:(unsigned long long)arg2; 28 | - (void)_handleIncomingData:(id)arg1; 29 | - (void)_handleHTTPRequestData:(id)arg1 encrypted:(BOOL)arg2; 30 | - (void)sendResponseMessage:(id)arg1; 31 | - (void)_sendResponseData:(id)arg1 encrypt:(BOOL)arg2; 32 | - (BOOL)close; 33 | - (BOOL)open; 34 | - (BOOL)encryptWithIdentifier:(id)arg1 sharedSecret:(id)arg2; 35 | @property(readonly, copy) NSString *description; 36 | - (id)initWithTransport:(id)arg1 host:(id)arg2 inputStream:(id)arg3 outputStream:(id)arg4; 37 | 38 | // Remaining properties 39 | @property(readonly, copy) NSString *debugDescription; 40 | @property(readonly) unsigned long long hash; 41 | @property(readonly) Class superclass; 42 | 43 | @end 44 | 45 | -------------------------------------------------------------------------------- /HomeKitBridge/HAKIPConnectionDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // Generated by class-dump 3.5 (64 bit). 3 | // 4 | // class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2013 by Steve Nygard. 5 | // 6 | 7 | #import "HAKConnectionDelegate.h" 8 | 9 | @class HAKConnection, HAKHTTPRequestMessage; 10 | 11 | @protocol HAKIPConnectionDelegate 12 | - (void)connection:(HAKConnection *)arg1 didReceiveRequest:(HAKHTTPRequestMessage *)arg2; 13 | @end 14 | 15 | -------------------------------------------------------------------------------- /HomeKitBridge/HAKIPSecuritySession.h: -------------------------------------------------------------------------------- 1 | // 2 | // Generated by class-dump 3.5 (64 bit). 3 | // 4 | // class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2013 by Steve Nygard. 5 | // 6 | 7 | #import "HAKSecuritySession.h" 8 | 9 | @interface HAKIPSecuritySession : HAKSecuritySession 10 | { 11 | } 12 | 13 | - (id)decryptPacket:(id)arg1; 14 | - (id)encryptData:(id)arg1; 15 | 16 | @end 17 | 18 | -------------------------------------------------------------------------------- /HomeKitBridge/HAKIPTransport.h: -------------------------------------------------------------------------------- 1 | // 2 | // Generated by class-dump 3.5 (64 bit). 3 | // 4 | // class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2013 by Steve Nygard. 5 | // 6 | 7 | #import "HAKTransport.h" 8 | 9 | #import "HAKIPConnectionDelegate.h" 10 | #import "HAKSocketDelegate.h" 11 | 12 | @class HAKNetService, HAKSocket, NSString, NSThread; 13 | 14 | @interface HAKIPTransport : HAKTransport 15 | { 16 | BOOL _dirty; 17 | BOOL _serverThreadShouldRun; 18 | HAKSocket *_socket; 19 | HAKNetService *_netService; 20 | NSThread *_serverThread; 21 | } 22 | 23 | + (unsigned long long)httpResponseCodeWithReadResponseStatus:(long long)arg1; 24 | + (unsigned long long)httpResponseCodeWithWriteResponseStatus:(long long)arg1; 25 | + (long long)ipErrorCodeWithReadResponseStatus:(long long)arg1; 26 | + (long long)ipErrorCodeWithWriteResponseStatus:(long long)arg1; 27 | + (unsigned long long)maxSupportedAccessories; 28 | @property BOOL serverThreadShouldRun; // @synthesize serverThreadShouldRun=_serverThreadShouldRun; 29 | @property(getter=isDirty) BOOL dirty; // @synthesize dirty=_dirty; 30 | @property(retain, nonatomic) NSThread *serverThread; // @synthesize serverThread=_serverThread; 31 | @property(retain, nonatomic) HAKNetService *netService; // @synthesize netService=_netService; 32 | @property(retain, nonatomic) HAKSocket *socket; // @synthesize socket=_socket; 33 | - (void)serverThreadMain; 34 | - (void)removeSources; 35 | - (id)_characteristicWriteWithConnection:(id)arg1 request:(id)arg2 characteristicWriteRequests:(id)arg3 attributes:(id)arg4 error:(char *)arg5; 36 | - (void)_handleCharacteristicWriteWithConnection:(id)arg1 request:(id)arg2; 37 | - (void)_handleCharacteristicReadRequest:(id)arg1; 38 | - (void)_handleAllAccessoriesRequestWithConnection:(id)arg1 request:(id)arg2; 39 | - (void)_postRequestWithConnection:(id)arg1 request:(id)arg2; 40 | - (void)_putRequestWithConnection:(id)arg1 request:(id)arg2; 41 | - (void)_getRequestWithConnection:(id)arg1 request:(id)arg2; 42 | - (void)identifyWithConnection:(id)arg1 request:(id)arg2; 43 | @property(readonly, nonatomic) unsigned long long port; 44 | - (BOOL)updateValue:(id)arg1 forCharacteristic:(id)arg2 onSubscribedConnections:(id)arg3; 45 | - (void)stop; 46 | - (void)start; 47 | - (void)setPaired:(BOOL)arg1; 48 | - (void)setStateNumber:(id)arg1; 49 | - (void)setConfigurationNumber:(id)arg1; 50 | - (void)setIdentifier:(id)arg1; 51 | - (unsigned long long)type; 52 | - (void)netServiceDidStop:(id)arg1; 53 | - (void)netService:(id)arg1 didNotPublish:(id)arg2; 54 | - (void)netServiceDidPublish:(id)arg1; 55 | - (void)newConnectionWithHost:(id)arg1 inputStream:(id)arg2 outputStream:(id)arg3; 56 | - (void)connection:(id)arg1 didReceiveRequest:(id)arg2; 57 | - (id)initWithCoder:(id)arg1; 58 | - (void)dealloc; 59 | - (id)init; 60 | 61 | // Remaining properties 62 | @property(readonly, copy) NSString *debugDescription; 63 | @property(readonly, copy) NSString *description; 64 | @property(readonly) Class superclass; 65 | 66 | @end 67 | 68 | -------------------------------------------------------------------------------- /HomeKitBridge/HAKIdentifier.h: -------------------------------------------------------------------------------- 1 | // 2 | // Generated by class-dump 3.5 (64 bit). 3 | // 4 | // class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2013 by Steve Nygard. 5 | // 6 | 7 | @import Foundation; 8 | 9 | 10 | 11 | 12 | @class NSData; 13 | 14 | @interface HAKIdentifier : NSObject 15 | { 16 | NSData *_data; 17 | } 18 | 19 | + (id)identifier; 20 | @property(retain, nonatomic) NSData *data; // @synthesize data=_data; 21 | - (id)identifierString; 22 | - (BOOL)isEqual:(id)arg1; 23 | - (unsigned long long)hash; 24 | - (id)description; 25 | - (void)encodeWithCoder:(id)arg1; 26 | - (id)initWithCoder:(id)arg1; 27 | - (id)copyWithZone:(struct _NSZone *)arg1; 28 | - (id)initWithBytes:(unsigned char [6])arg1; 29 | - (id)initWithIdentifierString:(id)arg1; 30 | - (id)init; 31 | 32 | @end 33 | 34 | -------------------------------------------------------------------------------- /HomeKitBridge/HAKIdentifyCharacteristic.h: -------------------------------------------------------------------------------- 1 | // 2 | // Generated by class-dump 3.5 (64 bit). 3 | // 4 | // class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2013 by Steve Nygard. 5 | // 6 | 7 | #import "HAKCharacteristic.h" 8 | 9 | @interface HAKIdentifyCharacteristic : HAKCharacteristic 10 | { 11 | double _routineDuration; 12 | } 13 | 14 | @property(retain, nonatomic) NSObject *routineDurationTimer; // @synthesize routineDurationTimer=_routineDurationTimer; 15 | @property(retain, nonatomic) NSObject *workQueue; // @synthesize workQueue=_workQueue; 16 | @property(nonatomic) double routineDuration; // @synthesize routineDuration=_routineDuration; 17 | - (id)initWithCoder:(id)arg1; 18 | - (id)copyWithZone:(struct _NSZone *)arg1; 19 | - (void)dealloc; 20 | - (id)handleWriteRequest:(id)arg1; 21 | - (id)initWithType:(id)arg1 properties:(unsigned long long)arg2 format:(unsigned long long)arg3; 22 | 23 | @end 24 | 25 | -------------------------------------------------------------------------------- /HomeKitBridge/HAKInstanceIDPool.h: -------------------------------------------------------------------------------- 1 | // 2 | // Generated by class-dump 3.5 (64 bit). 3 | // 4 | // class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2013 by Steve Nygard. 5 | // 6 | 7 | @import Foundation; 8 | 9 | 10 | 11 | @interface HAKInstanceIDPool : NSObject 12 | { 13 | unsigned long long _currentInstanceID; 14 | } 15 | 16 | + (id)instanceIDPoolWithInstanceID:(unsigned long long)arg1; 17 | + (id)instanceIDPool; 18 | @property(readonly, nonatomic) unsigned long long currentInstanceID; // @synthesize currentInstanceID=_currentInstanceID; 19 | - (id)copyWithZone:(struct _NSZone *)arg1; 20 | - (id)instanceID; 21 | - (id)initWithInstanceID:(unsigned long long)arg1; 22 | - (id)init; 23 | 24 | @end 25 | 26 | -------------------------------------------------------------------------------- /HomeKitBridge/HAKKeychainKey.h: -------------------------------------------------------------------------------- 1 | // 2 | // Generated by class-dump 3.5 (64 bit). 3 | // 4 | // class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2013 by Steve Nygard. 5 | // 6 | 7 | @import Foundation; 8 | 9 | @class NSData, NSString; 10 | 11 | @interface HAKKeychainKey : NSObject 12 | { 13 | void *_secItemRef; 14 | NSString *_label; 15 | NSString *_userDescription; 16 | unsigned long long _keyClass; 17 | NSString *_service; 18 | NSString *_account; 19 | NSData *_privateKey; 20 | NSData *_publicKey; 21 | id _userInfo; 22 | } 23 | 24 | + (id)typeFromKeyClass:(unsigned long long)arg1; 25 | + (unsigned long long)keyClassFromType:(id)arg1; 26 | @property(copy, nonatomic) id userInfo; // @synthesize userInfo=_userInfo; 27 | @property(readonly, copy, nonatomic) NSData *publicKey; // @synthesize publicKey=_publicKey; 28 | @property(readonly, copy, nonatomic) NSData *privateKey; // @synthesize privateKey=_privateKey; 29 | @property(copy, nonatomic) NSString *account; // @synthesize account=_account; 30 | @property(copy, nonatomic) NSString *service; // @synthesize service=_service; 31 | @property(readonly, nonatomic) unsigned long long keyClass; // @synthesize keyClass=_keyClass; 32 | @property(copy, nonatomic) NSString *userDescription; // @synthesize userDescription=_userDescription; 33 | @property(copy, nonatomic) NSString *label; // @synthesize label=_label; 34 | @property(nonatomic) void *secItemRef; // @synthesize secItemRef=_secItemRef; 35 | - (id)attributes; 36 | - (BOOL)isEqual:(id)arg1; 37 | - (unsigned long long)hash; 38 | - (void)dealloc; 39 | - (id)initWithPublicKey:(id)arg1 privateKey:(id)arg2; 40 | - (id)initWithPrivateKey:(id)arg1; 41 | - (id)initWithPublicKey:(id)arg1; 42 | - (id)initWithQuery:(id)arg1; 43 | 44 | @end 45 | 46 | -------------------------------------------------------------------------------- /HomeKitBridge/HAKKeychainService.h: -------------------------------------------------------------------------------- 1 | // 2 | // Generated by class-dump 3.5 (64 bit). 3 | // 4 | // class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2013 by Steve Nygard. 5 | // 6 | 7 | @import Foundation; 8 | 9 | @class NSObject, NSString; 10 | 11 | @interface HAKKeychainService : NSObject 12 | { 13 | struct OpaqueSecKeychainRef *_keychain; 14 | BOOL _authenticationDisabled; 15 | NSObject *_workQueue; 16 | } 17 | 18 | + (id)keychainURL; 19 | + (id)defaultKeychainService; 20 | @property(nonatomic, getter=isAuthenticationDisabled) BOOL authenticationDisabled; // @synthesize authenticationDisabled=_authenticationDisabled; 21 | @property(retain) NSObject *workQueue; // @synthesize workQueue=_workQueue; 22 | - (void)_executePrivledgedKeychainBlock:(CDUnknownBlockType)arg1; 23 | - (void)_executeKeychainBlock:(CDUnknownBlockType)arg1; 24 | - (int)_unlockWithPassword:(id)arg1; 25 | - (BOOL)unlock; 26 | - (int)_isUnlocked:(char *)arg1; 27 | - (BOOL)isUnlocked; 28 | - (BOOL)_createKeychain; 29 | @property(readonly) struct OpaqueSecKeychainRef *keychain; 30 | - (BOOL)_keychainExists; 31 | @property(retain, nonatomic) NSString *password; 32 | - (int)_getPassword:(id *)arg1; 33 | - (int)_key:(id *)arg1 keyClass:(unsigned long long)arg2 account:(id)arg3 service:(id)arg4; 34 | - (id)keyWithKeyClass:(unsigned long long)arg1 account:(id)arg2 service:(id)arg3; 35 | - (int)_key:(id *)arg1 withKeyRef:(void *)arg2; 36 | - (int)_keys:(id *)arg1 keyClass:(unsigned long long)arg2 account:(id)arg3 service:(id)arg4; 37 | - (id)keysWithKeyClass:(unsigned long long)arg1 account:(id)arg2 service:(id)arg3; 38 | - (int)_removeKey:(id)arg1; 39 | - (BOOL)removeKey:(id)arg1 error:(id *)arg2; 40 | - (int)_addKey:(id)arg1; 41 | - (BOOL)addKey:(id)arg1 error:(id *)arg2; 42 | - (void)dealloc; 43 | - (id)init; 44 | 45 | @end 46 | 47 | -------------------------------------------------------------------------------- /HomeKitBridge/HAKListPairingsSession.h: -------------------------------------------------------------------------------- 1 | // 2 | // Generated by class-dump 3.5 (64 bit). 3 | // 4 | // class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2013 by Steve Nygard. 5 | // 6 | 7 | #import "HAKPairingSession.h" 8 | 9 | @class HAKTLV8Container; 10 | 11 | @interface HAKListPairingsSession : HAKPairingSession 12 | { 13 | unsigned char _state; 14 | id _delegate; 15 | id _dataSource; 16 | HAKTLV8Container *_stateData; 17 | } 18 | 19 | @property(retain, nonatomic) HAKTLV8Container *stateData; // @synthesize stateData=_stateData; 20 | @property(nonatomic) unsigned char state; // @synthesize state=_state; 21 | @property __weak id dataSource; // @synthesize dataSource=_dataSource; 22 | @property __weak id delegate; // @synthesize delegate=_delegate; 23 | - (id)handlePairingSessionReadRequest; 24 | - (long long)handlePairingSessionWriteRequest:(id)arg1; 25 | - (void)_lockSession; 26 | - (id)_tlv8ResponseWithError:(unsigned char)arg1; 27 | - (id)init; 28 | 29 | @end 30 | 31 | -------------------------------------------------------------------------------- /HomeKitBridge/HAKListPairingsSessionDataSource.h: -------------------------------------------------------------------------------- 1 | // 2 | // Generated by class-dump 3.5 (64 bit). 3 | // 4 | // class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2013 by Steve Nygard. 5 | // 6 | 7 | @import Foundation; 8 | 9 | @class HAKListPairingsSession, NSArray; 10 | 11 | @protocol HAKListPairingsSessionDataSource 12 | - (NSArray *)pairingsForListPairingsSession:(HAKListPairingsSession *)arg1; 13 | @end 14 | 15 | -------------------------------------------------------------------------------- /HomeKitBridge/HAKListPairingsSessionDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // Generated by class-dump 3.5 (64 bit). 3 | // 4 | // class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2013 by Steve Nygard. 5 | // 6 | 7 | #import "HAKPairingSessionDelegate.h" 8 | 9 | @class HAKListPairingsSession; 10 | 11 | @protocol HAKListPairingsSessionDelegate 12 | - (BOOL)controllerIsAdminForListPairingsSession:(HAKListPairingsSession *)arg1; 13 | @end 14 | 15 | -------------------------------------------------------------------------------- /HomeKitBridge/HAKLogger.h: -------------------------------------------------------------------------------- 1 | // 2 | // Generated by class-dump 3.5 (64 bit). 3 | // 4 | // class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2013 by Steve Nygard. 5 | // 6 | 7 | @import Foundation; 8 | 9 | @class NSMutableSet; 10 | 11 | @interface HAKLogger : NSObject 12 | { 13 | BOOL _loggingDisabled; 14 | BOOL _allowInternalLogging; 15 | unsigned long long _logLevel; 16 | NSObject *_loggerQueue; 17 | struct __asl_object_s *_aslClient; 18 | NSMutableSet *_loggerFileHandles; 19 | } 20 | 21 | + (void)_pruneOldLogs; 22 | + (id)logDirectory; 23 | + (id)defaultLogger; 24 | + (void)initialize; 25 | @property(retain, nonatomic) NSMutableSet *loggerFileHandles; // @synthesize loggerFileHandles=_loggerFileHandles; 26 | @property(setter=setASLClient:) struct __asl_object_s *aslClient; // @synthesize aslClient=_aslClient; 27 | @property(retain) NSObject *loggerQueue; // @synthesize loggerQueue=_loggerQueue; 28 | @property(nonatomic) BOOL allowInternalLogging; // @synthesize allowInternalLogging=_allowInternalLogging; 29 | @property(nonatomic, getter=isLoggingDisabled) BOOL loggingDisabled; // @synthesize loggingDisabled=_loggingDisabled; 30 | @property(nonatomic) unsigned long long logLevel; // @synthesize logLevel=_logLevel; 31 | - (void)logMessage:(id)arg1 level:(unsigned long long)arg2; 32 | - (void)logWithLevel:(unsigned long long)arg1 message:(id)arg2; 33 | - (BOOL)addLogFile:(id)arg1 error:(id *)arg2; 34 | - (void)addDefaultFileLogger; 35 | - (void)dealloc; 36 | - (id)init; 37 | 38 | @end 39 | 40 | -------------------------------------------------------------------------------- /HomeKitBridge/HAKMetadata.h: -------------------------------------------------------------------------------- 1 | // 2 | // Generated by class-dump 3.5 (64 bit). 3 | // 4 | // class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2013 by Steve Nygard. 5 | // 6 | 7 | @import Foundation; 8 | 9 | @class NSArray; 10 | 11 | @interface HAKMetadata : NSObject 12 | { 13 | NSArray *_characteristics; 14 | NSArray *_services; 15 | } 16 | 17 | + (BOOL)isValidMetadataWithURL:(id)arg1 error:(id *)arg2; 18 | + (id)defaultMetadata; 19 | @property(readonly, nonatomic) NSArray *services; // @synthesize services=_services; 20 | @property(readonly, nonatomic) NSArray *characteristics; // @synthesize characteristics=_characteristics; 21 | - (id)serviceMetadataWithType:(id)arg1; 22 | - (id)characteristicMetadataWithType:(id)arg1; 23 | - (BOOL)_parseServicesWithServiceMetadata:(id)arg1 error:(id *)arg2; 24 | - (BOOL)_parseCharacteristicsWithCharacteristicMetdata:(id)arg1 error:(id *)arg2; 25 | - (BOOL)_parseMetadata:(id)arg1 error:(id *)arg2; 26 | - (id)initWithURL:(id)arg1 error:(id *)arg2; 27 | 28 | @end 29 | 30 | -------------------------------------------------------------------------------- /HomeKitBridge/HAKMetadataService.h: -------------------------------------------------------------------------------- 1 | // 2 | // Generated by class-dump 3.5 (64 bit). 3 | // 4 | // class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2013 by Steve Nygard. 5 | // 6 | 7 | @import Foundation; 8 | 9 | @class HAKMetadata; 10 | 11 | @interface HAKMetadataService : NSObject 12 | { 13 | HAKMetadata *_metadata; 14 | NSObject *_workQueue; 15 | } 16 | 17 | + (id)defaultMetadataService; 18 | @property(retain, nonatomic) NSObject *workQueue; // @synthesize workQueue=_workQueue; 19 | @property(retain, nonatomic) HAKMetadata *metadata; 20 | - (id)init; 21 | 22 | @end 23 | 24 | -------------------------------------------------------------------------------- /HomeKitBridge/HAKNetService.h: -------------------------------------------------------------------------------- 1 | // 2 | // Generated by class-dump 3.5 (64 bit). 3 | // 4 | // class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2013 by Steve Nygard. 5 | // 6 | 7 | #import "NSNetService.h" 8 | 9 | @class NSObject, NSString; 10 | 11 | @interface HAKNetService : NSNetService 12 | { 13 | NSObject *_txtRecordQueue; 14 | } 15 | 16 | + (id)defaultTXTRecord; 17 | + (id)generateUniqueMACAddress; 18 | @property(retain, nonatomic) NSObject *txtRecordQueue; // @synthesize txtRecordQueue=_txtRecordQueue; 19 | @property(nonatomic) unsigned char statusOptions; 20 | - (void)incrementStateNumber; 21 | @property(nonatomic) unsigned short stateNumber; 22 | @property(nonatomic) unsigned long long protocolVersion; 23 | @property(copy, nonatomic) NSString *modelName; 24 | @property(copy, nonatomic) NSString *identifier; 25 | @property(nonatomic) unsigned char featureOptions; 26 | - (void)incrementConfigurationNumber; 27 | @property(nonatomic) unsigned short configurationNumber; 28 | - (id)txtRecordValueForKey:(id)arg1; 29 | - (void)setTXTRecordValue:(id)arg1 forKey:(id)arg2; 30 | - (BOOL)_setTXTRecord:(id)arg1; 31 | - (void)setTXTRecord:(id)arg1; 32 | - (id)txtRecord; 33 | - (void)publishWithOptions:(unsigned long long)arg1; 34 | - (id)initWithName:(id)arg1 port:(unsigned long long)arg2; 35 | 36 | @end 37 | 38 | -------------------------------------------------------------------------------- /HomeKitBridge/HAKNumberConstraints.h: -------------------------------------------------------------------------------- 1 | // 2 | // Generated by class-dump 3.5 (64 bit). 3 | // 4 | // class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2013 by Steve Nygard. 5 | // 6 | 7 | #import "HAKValueConstraints.h" 8 | 9 | @class NSNumber; 10 | 11 | @interface HAKNumberConstraints : HAKValueConstraints 12 | { 13 | NSNumber *_minimumValue; 14 | NSNumber *_maximumValue; 15 | NSNumber *_stepValue; 16 | } 17 | 18 | @property(copy, nonatomic) NSNumber *stepValue; // @synthesize stepValue=_stepValue; 19 | @property(readonly, copy, nonatomic) NSNumber *maximumValue; // @synthesize maximumValue=_maximumValue; 20 | @property(readonly, copy, nonatomic) NSNumber *minimumValue; // @synthesize minimumValue=_minimumValue; 21 | - (void)encodeWithCoder:(id)arg1; 22 | - (id)initWithCoder:(id)arg1; 23 | - (id)copyWithZone:(struct _NSZone *)arg1; 24 | - (BOOL)validateValue:(id)arg1; 25 | - (id)description; 26 | - (id)initWithMinimumValue:(id)arg1 maximumValue:(id)arg2; 27 | - (id)init; 28 | - (id)attributes; 29 | 30 | @end 31 | 32 | -------------------------------------------------------------------------------- /HomeKitBridge/HAKPairSetupCharacteristic.h: -------------------------------------------------------------------------------- 1 | // 2 | // Generated by class-dump 3.5 (64 bit). 3 | // 4 | // class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2013 by Steve Nygard. 5 | // 6 | 7 | #import "HAKPairingCharacteristic.h" 8 | 9 | #import "HAKPairSetupSessionDelegate.h" 10 | 11 | @class HAKConnection, HAKPairSetupSession, NSString; 12 | 13 | @interface HAKPairSetupCharacteristic : HAKPairingCharacteristic 14 | { 15 | HAKConnection *_currentConnection; 16 | HAKPairSetupSession *_pairSetupSession; 17 | NSObject *_pairSetupQueue; 18 | } 19 | 20 | + (id)pairSetupCharacteristic; 21 | @property(retain, nonatomic) NSObject *pairSetupQueue; // @synthesize pairSetupQueue=_pairSetupQueue; 22 | @property(retain, nonatomic) HAKPairSetupSession *pairSetupSession; // @synthesize pairSetupSession=_pairSetupSession; 23 | @property(nonatomic) __weak HAKConnection *currentConnection; // @synthesize currentConnection=_currentConnection; 24 | - (void)pairSetupSession:(id)arg1 didAddPairing:(id)arg2; 25 | - (id)handleReadRequest:(id)arg1; 26 | - (id)handleWriteRequest:(id)arg1; 27 | - (id)passwordForPairSetupSession:(id)arg1; 28 | - (id)identifierForPairingSession:(id)arg1; 29 | - (id)initWithType:(id)arg1 properties:(unsigned long long)arg2 format:(unsigned long long)arg3; 30 | - (id)init; 31 | 32 | // Remaining properties 33 | @property(readonly, copy) NSString *debugDescription; 34 | @property(readonly, copy) NSString *description; 35 | @property(readonly) unsigned long long hash; 36 | @property(readonly) Class superclass; 37 | 38 | @end 39 | 40 | -------------------------------------------------------------------------------- /HomeKitBridge/HAKPairSetupSession.h: -------------------------------------------------------------------------------- 1 | // 2 | // Generated by class-dump 3.5 (64 bit). 3 | // 4 | // class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2013 by Steve Nygard. 5 | // 6 | 7 | #import "HAKPairingSession.h" 8 | 9 | @class HAKTLV8Container, NSData, NSString; 10 | 11 | @interface HAKPairSetupSession : HAKPairingSession 12 | { 13 | struct srp_st *_session; 14 | NSData *_salt; 15 | NSData *_publicKey; 16 | NSData *_secretKey; 17 | unsigned char _state; 18 | NSData *_sessionKey; 19 | HAKTLV8Container *_stateData; 20 | NSString *_username; 21 | NSString *_password; 22 | unsigned long long _failedAttempts; 23 | id _delegate; 24 | } 25 | 26 | @property __weak id delegate; // @synthesize delegate=_delegate; 27 | @property(readonly, nonatomic) unsigned long long failedAttempts; // @synthesize failedAttempts=_failedAttempts; 28 | @property(readonly, nonatomic) HAKTLV8Container *stateData; // @synthesize stateData=_stateData; 29 | @property(readonly, nonatomic) NSData *sessionKey; // @synthesize sessionKey=_sessionKey; 30 | @property(retain, nonatomic) NSString *password; // @synthesize password=_password; 31 | @property(retain, nonatomic) NSString *username; // @synthesize username=_username; 32 | @property(readonly, nonatomic) struct srp_st *session; // @synthesize session=_session; 33 | @property(readonly, nonatomic) unsigned char state; // @synthesize state=_state; 34 | @property(readonly, nonatomic) NSData *secretKey; // @synthesize secretKey=_secretKey; 35 | - (id)handlePairingSessionReadRequest; 36 | - (long long)handlePairingSessionWriteRequest:(id)arg1; 37 | - (id)_tlv8ResponseWithError:(unsigned char)arg1; 38 | - (void)_lock; 39 | - (void)_resetState; 40 | - (void)reset; 41 | - (BOOL)isComplete; 42 | - (BOOL)isLocked; 43 | - (id)proofResponseWithClientProof:(id)arg1; 44 | - (id)generateSecretKeyWithPublicKey:(id)arg1; 45 | @property(readonly, nonatomic) NSData *publicKey; // @synthesize publicKey=_publicKey; 46 | @property(readonly, nonatomic) NSData *salt; // @synthesize salt=_salt; 47 | - (id)init; 48 | 49 | @end 50 | 51 | -------------------------------------------------------------------------------- /HomeKitBridge/HAKPairSetupSessionDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // Generated by class-dump 3.5 (64 bit). 3 | // 4 | // class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2013 by Steve Nygard. 5 | // 6 | 7 | #import "HAKPairingSessionDelegate.h" 8 | 9 | @class HAKPairSetupSession, HAKPairing, NSString; 10 | 11 | @protocol HAKPairSetupSessionDelegate 12 | 13 | @optional 14 | - (void)pairSetupSession:(HAKPairSetupSession *)arg1 didAddPairing:(HAKPairing *)arg2; 15 | - (NSString *)passwordForPairSetupSession:(HAKPairSetupSession *)arg1; 16 | @end 17 | 18 | -------------------------------------------------------------------------------- /HomeKitBridge/HAKPairVerifyCharacteristic.h: -------------------------------------------------------------------------------- 1 | // 2 | // Generated by class-dump 3.5 (64 bit). 3 | // 4 | // class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2013 by Steve Nygard. 5 | // 6 | 7 | #import "HAKPairingCharacteristic.h" 8 | 9 | #import "HAKPairVerifySessionDelegate.h" 10 | 11 | @class NSString; 12 | 13 | @interface HAKPairVerifyCharacteristic : HAKPairingCharacteristic 14 | { 15 | } 16 | 17 | + (id)pairVerifyCharacteristic; 18 | - (id)handleReadRequest:(id)arg1; 19 | - (id)handleWriteRequest:(id)arg1; 20 | - (void)pairVerifySession:(id)arg1 verifiedPairingWithIdentifier:(id)arg2 sharedSecret:(id)arg3; 21 | - (id)initWithType:(id)arg1 properties:(unsigned long long)arg2 format:(unsigned long long)arg3; 22 | - (id)init; 23 | 24 | // Remaining properties 25 | @property(readonly, copy) NSString *debugDescription; 26 | @property(readonly, copy) NSString *description; 27 | @property(readonly) unsigned long long hash; 28 | @property(readonly) Class superclass; 29 | 30 | @end 31 | 32 | -------------------------------------------------------------------------------- /HomeKitBridge/HAKPairVerifySession.h: -------------------------------------------------------------------------------- 1 | // 2 | // Generated by class-dump 3.5 (64 bit). 3 | // 4 | // class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2013 by Steve Nygard. 5 | // 6 | 7 | #import "HAKPairingSession.h" 8 | 9 | @class HAKAccessoryKeychainObject, HAKTLV8Container, NSData; 10 | 11 | @interface HAKPairVerifySession : HAKPairingSession 12 | { 13 | unsigned char _state; 14 | id _delegate; 15 | NSData *_publicKey; 16 | NSData *_sharedSecret; 17 | HAKAccessoryKeychainObject *_accessoryKeychain; 18 | NSData *_controllerPublicKey; 19 | NSData *_sessionKey; 20 | HAKTLV8Container *_stateData; 21 | } 22 | 23 | @property(retain, nonatomic) HAKTLV8Container *stateData; // @synthesize stateData=_stateData; 24 | @property(nonatomic) unsigned char state; // @synthesize state=_state; 25 | @property(retain, nonatomic) NSData *sessionKey; // @synthesize sessionKey=_sessionKey; 26 | @property(retain, nonatomic) NSData *controllerPublicKey; // @synthesize controllerPublicKey=_controllerPublicKey; 27 | @property(retain, nonatomic) HAKAccessoryKeychainObject *accessoryKeychain; // @synthesize accessoryKeychain=_accessoryKeychain; 28 | @property(retain, nonatomic) NSData *sharedSecret; // @synthesize sharedSecret=_sharedSecret; 29 | @property(retain, nonatomic) NSData *publicKey; // @synthesize publicKey=_publicKey; 30 | @property __weak id delegate; // @synthesize delegate=_delegate; 31 | - (id)handlePairingSessionReadRequest; 32 | - (long long)handlePairingSessionWriteRequest:(id)arg1; 33 | - (void)_resetState; 34 | - (id)_tlv8ResponseWithError:(unsigned char)arg1; 35 | - (id)init; 36 | 37 | @end 38 | 39 | -------------------------------------------------------------------------------- /HomeKitBridge/HAKPairVerifySessionDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // Generated by class-dump 3.5 (64 bit). 3 | // 4 | // class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2013 by Steve Nygard. 5 | // 6 | 7 | #import "HAKPairingSessionDelegate.h" 8 | 9 | @class HAKPairVerifySession, NSData, NSString; 10 | 11 | @protocol HAKPairVerifySessionDelegate 12 | - (void)pairVerifySession:(HAKPairVerifySession *)arg1 verifiedPairingWithIdentifier:(NSString *)arg2 sharedSecret:(NSData *)arg3; 13 | @end 14 | 15 | -------------------------------------------------------------------------------- /HomeKitBridge/HAKPairing.h: -------------------------------------------------------------------------------- 1 | // 2 | // Generated by class-dump 3.5 (64 bit). 3 | // 4 | // class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2013 by Steve Nygard. 5 | // 6 | 7 | @import Foundation; 8 | 9 | @class HAKTransport, NSArray, NSHashTable, NSString; 10 | 11 | @interface HAKPairing : NSObject 12 | { 13 | NSHashTable *_connections; 14 | BOOL _admin; 15 | HAKTransport *_transport; 16 | NSString *_identifier; 17 | NSObject *_workQueue; 18 | } 19 | 20 | @property(retain, nonatomic) NSObject *workQueue; // @synthesize workQueue=_workQueue; 21 | @property(readonly, nonatomic, getter=isAdmin) BOOL admin; // @synthesize admin=_admin; 22 | @property(copy, nonatomic) NSString *identifier; // @synthesize identifier=_identifier; 23 | @property(nonatomic) __weak HAKTransport *transport; // @synthesize transport=_transport; 24 | - (id)keychainObject; 25 | - (void)_addConnection:(id)arg1; 26 | - (void)addConnection:(id)arg1; 27 | @property(readonly, nonatomic) NSArray *connections; 28 | - (id)description; 29 | - (BOOL)isEqual:(id)arg1; 30 | - (unsigned long long)hash; 31 | - (id)initWithIdentifier:(id)arg1 admin:(BOOL)arg2; 32 | 33 | @end 34 | 35 | -------------------------------------------------------------------------------- /HomeKitBridge/HAKPairingCharacteristic.h: -------------------------------------------------------------------------------- 1 | // 2 | // Generated by class-dump 3.5 (64 bit). 3 | // 4 | // class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2013 by Steve Nygard. 5 | // 6 | 7 | #import "HAKCharacteristic.h" 8 | 9 | #import "HAKPairingSessionDelegate.h" 10 | 11 | @class NSMapTable, NSString; 12 | 13 | @interface HAKPairingCharacteristic : HAKCharacteristic 14 | { 15 | NSMapTable *_connections; 16 | NSObject *_connectionsQ; 17 | } 18 | 19 | + (long long)writeResponseStatusWithPairingSessionStatus:(long long)arg1; 20 | @property(retain, nonatomic) NSObject *connectionsQ; // @synthesize connectionsQ=_connectionsQ; 21 | @property(retain, nonatomic) NSMapTable *connections; // @synthesize connections=_connections; 22 | - (id)handleWriteRequest:(id)arg1; 23 | - (id)handleReadRequest:(id)arg1; 24 | - (void)setValue:(id)arg1 forKey:(id)arg2; 25 | - (id)value; 26 | - (id)identifierForPairingSession:(id)arg1; 27 | - (void)removePairingSessionForConnection:(id)arg1; 28 | - (void)setPairingSession:(id)arg1 forConnection:(id)arg2; 29 | - (id)pairingSessionForConnection:(id)arg1; 30 | - (id)connectionForPairingSession:(id)arg1; 31 | - (id)initWithType:(id)arg1 properties:(unsigned long long)arg2 format:(unsigned long long)arg3; 32 | 33 | // Remaining properties 34 | @property(readonly, copy) NSString *debugDescription; 35 | @property(readonly, copy) NSString *description; 36 | @property(readonly) unsigned long long hash; 37 | @property(readonly) Class superclass; 38 | 39 | @end 40 | 41 | -------------------------------------------------------------------------------- /HomeKitBridge/HAKPairingService.h: -------------------------------------------------------------------------------- 1 | // 2 | // Generated by class-dump 3.5 (64 bit). 3 | // 4 | // class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2013 by Steve Nygard. 5 | // 6 | 7 | #import "HAKService.h" 8 | 9 | @class HAKCharacteristic, HAKPairSetupCharacteristic, HAKPairVerifyCharacteristic; 10 | 11 | @interface HAKPairingService : HAKService 12 | { 13 | } 14 | 15 | + (id)pairingService; 16 | - (void)addIncludedService:(id)arg1; 17 | - (void)removeCharacteristic:(id)arg1; 18 | - (id)_restrictedCharacteristicSet; 19 | @property(readonly, nonatomic) HAKCharacteristic *pairingsCharacteristic; 20 | @property(readonly, nonatomic) HAKCharacteristic *pairingFeaturesCharacteristic; 21 | @property(readonly, nonatomic) HAKPairVerifyCharacteristic *pairVerifyCharacteristic; 22 | @property(readonly, nonatomic) HAKPairSetupCharacteristic *pairSetupCharacteristic; 23 | - (id)initWithType:(id)arg1 isPrimary:(BOOL)arg2 characteristics:(id)arg3 includedServices:(id)arg4; 24 | - (id)init; 25 | 26 | @end 27 | 28 | -------------------------------------------------------------------------------- /HomeKitBridge/HAKPairingSession.h: -------------------------------------------------------------------------------- 1 | // 2 | // Generated by class-dump 3.5 (64 bit). 3 | // 4 | // class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2013 by Steve Nygard. 5 | // 6 | 7 | @import Foundation; 8 | 9 | @interface HAKPairingSession : NSObject 10 | { 11 | } 12 | 13 | - (id)handlePairingSessionReadRequest; 14 | - (long long)handlePairingSessionWriteRequest:(id)arg1; 15 | 16 | @end 17 | 18 | -------------------------------------------------------------------------------- /HomeKitBridge/HAKPairingSessionDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // Generated by class-dump 3.5 (64 bit). 3 | // 4 | // class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2013 by Steve Nygard. 5 | // 6 | 7 | @import Foundation; 8 | 9 | @class HAKIdentifier, HAKPairingSession; 10 | 11 | @protocol HAKPairingSessionDelegate 12 | - (HAKIdentifier *)identifierForPairingSession:(HAKPairingSession *)arg1; 13 | @end 14 | 15 | -------------------------------------------------------------------------------- /HomeKitBridge/HAKPairingsCharacteristic.h: -------------------------------------------------------------------------------- 1 | // 2 | // Generated by class-dump 3.5 (64 bit). 3 | // 4 | // class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2013 by Steve Nygard. 5 | // 6 | 7 | #import "HAKPairingCharacteristic.h" 8 | 9 | #import "HAKAddPairingSessionDelegate.h" 10 | #import "HAKListPairingsSessionDataSource.h" 11 | #import "HAKListPairingsSessionDelegate.h" 12 | #import "HAKRemovePairingSessionDelegate.h" 13 | 14 | @class NSString; 15 | 16 | @interface HAKPairingsCharacteristic : HAKPairingCharacteristic 17 | { 18 | } 19 | 20 | + (id)pairingsCharacteristic; 21 | - (id)pairingsForListPairingsSession:(id)arg1; 22 | - (BOOL)controllerIsAdminForListPairingsSession:(id)arg1; 23 | - (BOOL)removePairingSession:(id)arg1 removePairingForIdentifier:(id)arg2; 24 | - (BOOL)controllerIsAdminForRemovePairingSession:(id)arg1; 25 | - (void)addPairingSession:(id)arg1 didAddPairing:(id)arg2; 26 | - (BOOL)controllerIsAdminForAddPairingSession:(id)arg1; 27 | - (id)handleReadRequest:(id)arg1; 28 | - (id)handleWriteRequest:(id)arg1; 29 | - (id)initWithType:(id)arg1 properties:(unsigned long long)arg2 format:(unsigned long long)arg3; 30 | - (id)init; 31 | 32 | // Remaining properties 33 | @property(readonly, copy) NSString *debugDescription; 34 | @property(readonly, copy) NSString *description; 35 | @property(readonly) unsigned long long hash; 36 | @property(readonly) Class superclass; 37 | 38 | @end 39 | 40 | -------------------------------------------------------------------------------- /HomeKitBridge/HAKPoly1305.h: -------------------------------------------------------------------------------- 1 | // 2 | // Generated by class-dump 3.5 (64 bit). 3 | // 4 | // class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2013 by Steve Nygard. 5 | // 6 | 7 | @import Foundation; 8 | 9 | @interface HAKPoly1305 : NSObject 10 | { 11 | struct poly1305_context *_pContext; 12 | } 13 | 14 | + (BOOL)isKeyValid:(id)arg1; 15 | - (id)tag; 16 | - (void)updateWithData:(id)arg1; 17 | - (void)dealloc; 18 | - (id)initWithKey:(id)arg1; 19 | 20 | @end 21 | 22 | -------------------------------------------------------------------------------- /HomeKitBridge/HAKRemovePairingSession.h: -------------------------------------------------------------------------------- 1 | // 2 | // Generated by class-dump 3.5 (64 bit). 3 | // 4 | // class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2013 by Steve Nygard. 5 | // 6 | 7 | #import "HAKPairingSession.h" 8 | 9 | @class HAKTLV8Container; 10 | 11 | @interface HAKRemovePairingSession : HAKPairingSession 12 | { 13 | unsigned char _state; 14 | id _delegate; 15 | HAKTLV8Container *_stateData; 16 | } 17 | 18 | @property(retain, nonatomic) HAKTLV8Container *stateData; // @synthesize stateData=_stateData; 19 | @property(nonatomic) unsigned char state; // @synthesize state=_state; 20 | @property __weak id delegate; // @synthesize delegate=_delegate; 21 | - (id)handlePairingSessionReadRequest; 22 | - (long long)handlePairingSessionWriteRequest:(id)arg1; 23 | - (void)_lockSession; 24 | - (id)_tlv8ResponseWithError:(unsigned char)arg1; 25 | - (id)init; 26 | 27 | @end 28 | 29 | -------------------------------------------------------------------------------- /HomeKitBridge/HAKRemovePairingSessionDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // Generated by class-dump 3.5 (64 bit). 3 | // 4 | // class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2013 by Steve Nygard. 5 | // 6 | 7 | #import "HAKPairingSessionDelegate.h" 8 | 9 | @class HAKRemovePairingSession, NSString; 10 | 11 | @protocol HAKRemovePairingSessionDelegate 12 | - (BOOL)removePairingSession:(HAKRemovePairingSession *)arg1 removePairingForIdentifier:(NSString *)arg2; 13 | - (BOOL)controllerIsAdminForRemovePairingSession:(HAKRemovePairingSession *)arg1; 14 | @end 15 | 16 | -------------------------------------------------------------------------------- /HomeKitBridge/HAKSecuritySession.h: -------------------------------------------------------------------------------- 1 | // 2 | // Generated by class-dump 3.5 (64 bit). 3 | // 4 | // class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2013 by Steve Nygard. 5 | // 6 | 7 | @import Foundation; 8 | 9 | @class NSData; 10 | 11 | @interface HAKSecuritySession : NSObject 12 | { 13 | NSData *_accessoryToControllerKey; 14 | unsigned long long _accessoryToControllerCount; 15 | NSData *_controllerToAccessoryKey; 16 | unsigned long long _controllerToAccessoryCount; 17 | } 18 | 19 | - (id)encryptData:(id)arg1; 20 | - (id)initWithSharedSecret:(id)arg1; 21 | 22 | @end 23 | 24 | -------------------------------------------------------------------------------- /HomeKitBridge/HAKSecuritySessionPacket.h: -------------------------------------------------------------------------------- 1 | // 2 | // Generated by class-dump 3.5 (64 bit). 3 | // 4 | // class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2013 by Steve Nygard. 5 | // 6 | 7 | @import Foundation; 8 | 9 | @class NSData, NSMutableData; 10 | 11 | @interface HAKSecuritySessionPacket : NSObject 12 | { 13 | NSMutableData *_encryptedData; 14 | NSMutableData *_authTag; 15 | BOOL _complete; 16 | unsigned long long _length; 17 | } 18 | 19 | @property(nonatomic) unsigned long long length; // @synthesize length=_length; 20 | @property(nonatomic, getter=isComplete) BOOL complete; // @synthesize complete=_complete; 21 | @property(readonly, nonatomic) NSData *authTag; // @synthesize authTag=_authTag; 22 | @property(readonly, nonatomic) NSData *encryptedData; // @synthesize encryptedData=_encryptedData; 23 | - (id)chaChaPolyData; 24 | - (long long)appendData:(id)arg1; 25 | - (id)init; 26 | 27 | @end 28 | 29 | -------------------------------------------------------------------------------- /HomeKitBridge/HAKService.h: -------------------------------------------------------------------------------- 1 | // 2 | // Generated by class-dump 3.5 (64 bit). 3 | // 4 | // class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2013 by Steve Nygard. 5 | // 6 | 7 | @import Foundation; 8 | 9 | #import "HAKServiceDelegate.h" 10 | 11 | @class HAKAccessory, HAKUUID; 12 | 13 | @interface HAKService : NSObject 14 | { 15 | NSMutableArray *_characteristics; 16 | NSHashTable *_includedServices; 17 | BOOL _primary; 18 | id _delegate; 19 | HAKAccessory *_accessory; 20 | HAKUUID *_type; 21 | NSNumber *_instanceID; 22 | NSObject *_workQueue; 23 | } 24 | 25 | + (id)_nameUUID; 26 | + (id)characteristicsToFilter; 27 | @property(retain, nonatomic) NSObject *workQueue; // @synthesize workQueue=_workQueue; 28 | @property(readonly, nonatomic, getter=isPrimary) BOOL primary; // @synthesize primary=_primary; 29 | @property(copy, nonatomic) NSNumber *instanceID; // @synthesize instanceID=_instanceID; 30 | @property(retain, nonatomic) HAKUUID *type; // @synthesize type=_type; 31 | @property(nonatomic) __weak HAKAccessory *accessory; // @synthesize accessory=_accessory; 32 | @property(nonatomic) __weak id delegate; // @synthesize delegate=_delegate; 33 | @property(retain, nonatomic) NSArray *characteristics; // @synthesize characteristics=_characteristics; 34 | - (BOOL)_removeIncludedService:(id)arg1; 35 | - (void)removeIncludedService:(id)arg1; 36 | - (BOOL)_addIncludedService:(id)arg1; 37 | - (void)addIncludedService:(id)arg1; 38 | @property(readonly, nonatomic) NSArray *includedServices; 39 | - (id)characteristicWithType:(id)arg1; 40 | - (id)characteristicWithInstanceId:(unsigned long long)arg1; 41 | - (void)removeAllCharacteristicsWithType:(id)arg1; 42 | - (BOOL)_removeCharacteristic:(id)arg1; 43 | - (void)removeCharacteristic:(id)arg1; 44 | - (BOOL)_addCharacteristic:(id)arg1 error:(id *)arg2; 45 | - (void)addCharacteristic:(id)arg1; 46 | @property(readonly, copy, nonatomic) NSString *name; 47 | - (id)description; 48 | - (void)encodeWithCoder:(id)arg1; 49 | - (id)initWithCoder:(id)arg1; 50 | - (id)copyWithZone:(struct _NSZone *)arg1; 51 | - (id)initWithType:(id)arg1 isPrimary:(BOOL)arg2 name:(id)arg3 characteristics:(id)arg4 includedServices:(id)arg5; 52 | - (id)initWithType:(id)arg1 name:(id)arg2; 53 | - (id)init; 54 | - (id)JSONObject; 55 | - (id)cbMutableService; 56 | - (id)cbCharactersitics; 57 | 58 | @end 59 | 60 | -------------------------------------------------------------------------------- /HomeKitBridge/HAKServiceDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // Generated by class-dump 3.5 (64 bit). 3 | // 4 | // class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2013 by Steve Nygard. 5 | // 6 | 7 | @import Foundation; 8 | 9 | @class HAKCharacteristic, HAKService, NSError; 10 | 11 | @protocol HAKServiceDelegate 12 | 13 | @optional 14 | - (void)service:(HAKService *)arg1 didRemoveCharacteristic:(HAKCharacteristic *)arg2; 15 | - (void)service:(HAKService *)arg1 didFailToAddCharacteristic:(HAKCharacteristic *)arg2 error:(NSError *)arg3; 16 | - (void)service:(HAKService *)arg1 didAddCharacteristic:(HAKCharacteristic *)arg2; 17 | @end 18 | 19 | -------------------------------------------------------------------------------- /HomeKitBridge/HAKServiceMetadata.h: -------------------------------------------------------------------------------- 1 | // 2 | // Generated by class-dump 3.5 (64 bit). 3 | // 4 | // class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2013 by Steve Nygard. 5 | // 6 | 7 | @import Foundation; 8 | 9 | @class HAKUUID, NSArray, NSString; 10 | 11 | @interface HAKServiceMetadata : NSObject 12 | { 13 | BOOL _primary; 14 | HAKUUID *_type; 15 | HAKUUID *_ipUUID; 16 | HAKUUID *_btleUUID; 17 | NSString *_name; 18 | NSArray *_requiredCharacteristics; 19 | NSArray *_optionalCharacteristics; 20 | NSArray *_includedServices; 21 | } 22 | 23 | @property(readonly, nonatomic) NSArray *includedServices; // @synthesize includedServices=_includedServices; 24 | @property(readonly, nonatomic) NSArray *optionalCharacteristics; // @synthesize optionalCharacteristics=_optionalCharacteristics; 25 | @property(readonly, nonatomic) NSArray *requiredCharacteristics; // @synthesize requiredCharacteristics=_requiredCharacteristics; 26 | @property(readonly, nonatomic, getter=isPrimary) BOOL primary; // @synthesize primary=_primary; 27 | @property(readonly, nonatomic) NSString *name; // @synthesize name=_name; 28 | @property(readonly, nonatomic) HAKUUID *btleUUID; // @synthesize btleUUID=_btleUUID; 29 | @property(readonly, nonatomic) HAKUUID *ipUUID; // @synthesize ipUUID=_ipUUID; 30 | @property(readonly, nonatomic) HAKUUID *type; // @synthesize type=_type; 31 | - (id)description; 32 | - (id)initWithAttributes:(id)arg1 characteristics:(id)arg2 error:(id *)arg3; 33 | 34 | @end 35 | 36 | -------------------------------------------------------------------------------- /HomeKitBridge/HAKSocket.h: -------------------------------------------------------------------------------- 1 | // 2 | // Generated by class-dump 3.5 (64 bit). 3 | // 4 | // class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2013 by Steve Nygard. 5 | // 6 | 7 | @import Foundation; 8 | 9 | @interface HAKSocket : NSObject 10 | { 11 | unsigned long long _port; 12 | struct __CFSocket *_ipv4Socket; 13 | struct __CFSocket *_ipv6Socket; 14 | id _delegate; 15 | } 16 | 17 | + (unsigned long long)_portFromSocket:(struct __CFSocket *)arg1; 18 | @property(nonatomic) struct __CFSocket *ipv6Socket; // @synthesize ipv6Socket=_ipv6Socket; 19 | @property(nonatomic) struct __CFSocket *ipv4Socket; // @synthesize ipv4Socket=_ipv4Socket; 20 | @property __weak id delegate; // @synthesize delegate=_delegate; 21 | @property(nonatomic) unsigned long long port; // @synthesize port=_port; 22 | - (void)removeFromRunLoop:(id)arg1 forMode:(id)arg2; 23 | - (void)scheduleInRunLoop:(id)arg1 forMode:(id)arg2; 24 | - (BOOL)_bindIPV6Socket; 25 | - (BOOL)_bindIPV4Socket; 26 | - (id)description; 27 | - (void)dealloc; 28 | - (id)init; 29 | - (id)initWithPort:(unsigned long long)arg1; 30 | 31 | @end 32 | 33 | -------------------------------------------------------------------------------- /HomeKitBridge/HAKSocketDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // Generated by class-dump 3.5 (64 bit). 3 | // 4 | // class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2013 by Steve Nygard. 5 | // 6 | 7 | @import Foundation; 8 | 9 | @class NSHost, NSInputStream, NSOutputStream; 10 | 11 | @protocol HAKSocketDelegate 12 | - (void)newConnectionWithHost:(NSHost *)arg1 inputStream:(NSInputStream *)arg2 outputStream:(NSOutputStream *)arg3; 13 | @end 14 | 15 | -------------------------------------------------------------------------------- /HomeKitBridge/HAKStringConstraints.h: -------------------------------------------------------------------------------- 1 | // 2 | // Generated by class-dump 3.5 (64 bit). 3 | // 4 | // class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2013 by Steve Nygard. 5 | // 6 | 7 | #import "HAKValueConstraints.h" 8 | 9 | @class NSNumber; 10 | 11 | @interface HAKStringConstraints : HAKValueConstraints 12 | { 13 | NSNumber *_maximumLength; 14 | } 15 | 16 | @property(copy, nonatomic) NSNumber *maximumLength; // @synthesize maximumLength=_maximumLength; 17 | - (void)encodeWithCoder:(id)arg1; 18 | - (id)initWithCoder:(id)arg1; 19 | - (id)copyWithZone:(struct _NSZone *)arg1; 20 | - (BOOL)validateValue:(id)arg1; 21 | - (id)description; 22 | - (id)initWithMaximumLength:(id)arg1; 23 | - (id)init; 24 | - (id)attributes; 25 | 26 | @end 27 | 28 | -------------------------------------------------------------------------------- /HomeKitBridge/HAKTLV8Container.h: -------------------------------------------------------------------------------- 1 | // 2 | // Generated by class-dump 3.5 (64 bit). 3 | // 4 | // class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2013 by Steve Nygard. 5 | // 6 | 7 | @import Foundation; 8 | 9 | 10 | 11 | 12 | @class NSMutableArray; 13 | 14 | @interface HAKTLV8Container : NSObject 15 | { 16 | NSMutableArray *_packets; 17 | } 18 | 19 | - (void)encodeWithCoder:(id)arg1; 20 | - (id)initWithCoder:(id)arg1; 21 | - (id)copyWithZone:(struct _NSZone *)arg1; 22 | - (id)numberForType:(unsigned char)arg1; 23 | - (void)setUnsignedLongLong:(unsigned long long)arg1 forType:(unsigned char)arg2; 24 | - (void)setUnsignedInt:(unsigned int)arg1 forType:(unsigned char)arg2; 25 | - (void)setUnsignedShort:(unsigned short)arg1 forType:(unsigned char)arg2; 26 | - (void)setUnsignedChar:(unsigned char)arg1 forType:(unsigned char)arg2; 27 | - (unsigned long long)sizeOfNumber:(id)arg1; 28 | - (id)stringForType:(unsigned char)arg1; 29 | - (void)setString:(id)arg1 forType:(unsigned char)arg2; 30 | - (id)dataForType:(unsigned char)arg1; 31 | - (void)setData:(id)arg1 forType:(unsigned char)arg2; 32 | - (BOOL)voidForType:(unsigned char)arg1; 33 | - (void)setVoidType:(unsigned char)arg1; 34 | - (id)serialize; 35 | - (void)removePacketsWithType:(unsigned char)arg1; 36 | - (id)description; 37 | - (id)initWithData:(id)arg1; 38 | - (id)init; 39 | 40 | @end 41 | 42 | -------------------------------------------------------------------------------- /HomeKitBridge/HAKTLV8Packet.h: -------------------------------------------------------------------------------- 1 | // 2 | // Generated by class-dump 3.5 (64 bit). 3 | // 4 | // class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2013 by Steve Nygard. 5 | // 6 | 7 | @import Foundation; 8 | 9 | @class NSData; 10 | 11 | @interface HAKTLV8Packet : NSObject 12 | { 13 | unsigned char _type; 14 | NSData *_value; 15 | } 16 | 17 | @property(readonly, nonatomic) unsigned char type; // @synthesize type=_type; 18 | @property(readonly, nonatomic) NSData *value; // @synthesize value=_value; 19 | @property(readonly, nonatomic) unsigned char length; 20 | - (id)description; 21 | - (id)initWithType:(unsigned char)arg1 value:(id)arg2; 22 | - (id)initWithData:(id)arg1; 23 | 24 | @end 25 | 26 | -------------------------------------------------------------------------------- /HomeKitBridge/HAKTransport.h: -------------------------------------------------------------------------------- 1 | // 2 | // Generated by class-dump 3.5 (64 bit). 3 | // 4 | // class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2013 by Steve Nygard. 5 | // 6 | 7 | @import Foundation; 8 | 9 | #import "HAKAccessoryDelegate.h" 10 | #import "HAKConnectionDelegate.h" 11 | 12 | 13 | 14 | @class HAKAccessory, HAKAccessoryKeychainObject, HAKIdentifier, HAKInstanceIDPool, NSArray, NSMutableArray, NSNumber, NSString; 15 | 16 | @interface HAKTransport : NSObject 17 | { 18 | NSMutableArray *_pairings; 19 | NSMutableArray *_accessories; 20 | NSMutableArray *_connections; 21 | BOOL _started; 22 | BOOL _paired; 23 | BOOL _allowUnencryptedConnections; 24 | NSString *_password; 25 | HAKIdentifier *_identifier; 26 | NSNumber *_configurationNumber; 27 | NSNumber *_stateNumber; 28 | NSObject *_workQueue; 29 | HAKInstanceIDPool *_instanceIDPool; 30 | HAKAccessoryKeychainObject *_accessoryKey; 31 | } 32 | 33 | + (id)restrictedPasswordSet; 34 | + (unsigned long long)maxSupportedAccessories; 35 | + (id)transportWithType:(unsigned long long)arg1; 36 | @property(retain, nonatomic) HAKAccessoryKeychainObject *accessoryKey; // @synthesize accessoryKey=_accessoryKey; 37 | @property(retain, nonatomic) HAKInstanceIDPool *instanceIDPool; // @synthesize instanceIDPool=_instanceIDPool; 38 | @property(readonly, nonatomic) BOOL allowUnencryptedConnections; // @synthesize allowUnencryptedConnections=_allowUnencryptedConnections; 39 | @property(retain, nonatomic) NSObject *workQueue; // @synthesize workQueue=_workQueue; 40 | @property(nonatomic, getter=isPaired) BOOL paired; // @synthesize paired=_paired; 41 | @property(retain, nonatomic) NSNumber *stateNumber; // @synthesize stateNumber=_stateNumber; 42 | @property(retain, nonatomic) NSNumber *configurationNumber; // @synthesize configurationNumber=_configurationNumber; 43 | //@property(nonatomic) __weak id delegate; // @synthesize delegate=_delegate; 44 | @property(retain, nonatomic) NSArray *connections; // @synthesize connections=_connections; 45 | @property(retain, nonatomic) NSArray *pairings; // @synthesize pairings=_pairings; 46 | @property(retain, nonatomic) NSArray *accessories; // @synthesize accessories=_accessories; 47 | - (id)_accessoryWithInstanceID:(unsigned long long)arg1; 48 | - (id)accessoryWithInstanceID:(unsigned long long)arg1; 49 | - (void)removeAccessory:(id)arg1; 50 | - (BOOL)_addAccessory:(id)arg1 error:(id *)arg2; 51 | - (void)addAccessory:(id)arg1; 52 | @property(readonly, nonatomic) HAKAccessory *primaryAccessory; 53 | - (void)removeAllConnections; 54 | - (void)removeConnection:(id)arg1; 55 | - (void)addConnection:(id)arg1; 56 | - (id)_pairingWithIdentifier:(id)arg1; 57 | - (id)pairingWithIdentifier:(id)arg1; 58 | - (void)removeAllPairings; 59 | - (BOOL)_removePairing:(id)arg1 error:(id *)arg2; 60 | - (BOOL)removePairing:(id)arg1 error:(id *)arg2; 61 | - (BOOL)_addPairing:(id)arg1; 62 | - (void)addPairing:(id)arg1; 63 | - (void)_incrementStateNumber; 64 | - (void)incrementStateNumber; 65 | - (void)_incrementConfigurationNumber; 66 | - (void)incrementConfigurationNumber; 67 | @property(nonatomic, getter=isStarted) BOOL started; // @synthesize started=_started; 68 | - (void)_setIdentifier:(id)arg1; 69 | @property(copy, nonatomic) HAKIdentifier *identifier; // @synthesize identifier=_identifier; 70 | @property(readonly, nonatomic) NSString *name; 71 | @property(readonly, nonatomic) unsigned long long type; 72 | - (BOOL)updateValue:(id)arg1 forCharacteristic:(id)arg2 onSubscribedConnections:(id)arg3; 73 | - (void)stop; 74 | - (void)start; 75 | - (void)_setPassword:(id)arg1; 76 | @property(copy, nonatomic) NSString *password; // @synthesize password=_password; 77 | - (void)connectionDidEncrypt:(id)arg1; 78 | - (void)connectionDidClose:(id)arg1; 79 | - (void)accessory:(id)arg1 didUpdateValue:(id)arg2 forCharacteristic:(id)arg3; 80 | - (void)accessory:(id)arg1 didUpdateService:(id)arg2; 81 | - (void)accessory:(id)arg1 didRemoveService:(id)arg2; 82 | - (void)accessory:(id)arg1 didAddService:(id)arg2; 83 | - (void)encodeWithCoder:(id)arg1; 84 | - (id)initWithCoder:(id)arg1; 85 | - (id)copyWithZone:(struct _NSZone *)arg1; 86 | @property(readonly, copy) NSString *description; 87 | - (id)init; 88 | - (id)initWithTransportType:(unsigned long long)arg1; 89 | 90 | // Remaining properties 91 | @property(readonly, copy) NSString *debugDescription; 92 | @property(readonly) Class superclass; 93 | 94 | @end 95 | 96 | -------------------------------------------------------------------------------- /HomeKitBridge/HAKUUID.h: -------------------------------------------------------------------------------- 1 | // 2 | // Generated by class-dump 3.5 (64 bit). 3 | // 4 | // class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2013 by Steve Nygard. 5 | // 6 | 7 | @import Foundation; 8 | 9 | 10 | 11 | 12 | @class NSUUID; 13 | 14 | @interface HAKUUID : NSObject 15 | { 16 | unsigned long long _type; 17 | NSUUID *_uuid; 18 | } 19 | 20 | + (BOOL)isValidUUIDString:(id)arg1; 21 | + (id)cbUUIDMapping; 22 | + (id)UUIDWithUUID:(id)arg1; 23 | + (id)UUIDWithUUIDString:(id)arg1; 24 | + (id)nameMapping; 25 | @property(retain, nonatomic, setter=setUUID:) NSUUID *uuid; // @synthesize uuid=_uuid; 26 | @property(nonatomic) unsigned long long type; // @synthesize type=_type; 27 | - (void)encodeWithCoder:(id)arg1; 28 | - (id)initWithCoder:(id)arg1; 29 | - (id)copyWithZone:(struct _NSZone *)arg1; 30 | - (id)cbUUID; 31 | - (id)name; 32 | - (id)shortenedUUIDString; 33 | - (id)UUIDString; 34 | - (id)debugDescription; 35 | - (id)description; 36 | - (BOOL)isEqual:(id)arg1; 37 | - (unsigned long long)hash; 38 | - (id)initWithCBUUID:(id)arg1; 39 | - (id)initWithUUID:(id)arg1; 40 | - (id)initWithUUIDString:(id)arg1; 41 | - (id)init; 42 | - (id)truncatedUUIDString; 43 | 44 | @end 45 | 46 | -------------------------------------------------------------------------------- /HomeKitBridge/HAKValueConstraints.h: -------------------------------------------------------------------------------- 1 | // 2 | // Generated by class-dump 3.5 (64 bit). 3 | // 4 | // class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2013 by Steve Nygard. 5 | // 6 | 7 | @import Foundation; 8 | 9 | 10 | 11 | 12 | @interface HAKValueConstraints : NSObject 13 | { 14 | } 15 | 16 | - (void)encodeWithCoder:(id)arg1; 17 | - (id)initWithCoder:(id)arg1; 18 | - (id)copyWithZone:(struct _NSZone *)arg1; 19 | - (BOOL)validateValue:(id)arg1; 20 | - (id)attributes; 21 | 22 | @end 23 | 24 | -------------------------------------------------------------------------------- /HomeKitBridge/HueLight.h: -------------------------------------------------------------------------------- 1 | // 2 | // HueLight.h 3 | // HomeKitBridge 4 | // 5 | // Created by Khaos Tian on 7/18/14. 6 | // Copyright (c) 2014 Oltica. All rights reserved. 7 | // 8 | 9 | #import 10 | #import 11 | #import 12 | #import "HAKAccessory.h" 13 | #import "OTIHAPCore.h" 14 | 15 | @interface HueLight : NSObject 16 | 17 | @property (nonatomic,weak) OTIHAPCore *accessoryCore; 18 | @property (nonatomic,strong) NSString *identifier; 19 | @property (nonatomic,strong) HAKAccessory *lightAccesory; 20 | @property (nonatomic,strong) PHLight *huelight; 21 | 22 | - (id)initWithHAPCore:(OTIHAPCore *)core HueLight:(PHLight *)hueLight; 23 | - (void)updateLightValue; 24 | - (void)updateLightValueWithLight:(PHLight *)hueLight; 25 | 26 | @end 27 | -------------------------------------------------------------------------------- /HomeKitBridge/HueSDK_OSX.framework/Headers: -------------------------------------------------------------------------------- 1 | Versions/Current/Headers -------------------------------------------------------------------------------- /HomeKitBridge/HueSDK_OSX.framework/HueSDK_OSX: -------------------------------------------------------------------------------- 1 | Versions/Current/HueSDK_OSX -------------------------------------------------------------------------------- /HomeKitBridge/HueSDK_OSX.framework/Resources: -------------------------------------------------------------------------------- 1 | Versions/Current/Resources -------------------------------------------------------------------------------- /HomeKitBridge/HueSDK_OSX.framework/Versions/A/Headers/HueSDK.h: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | Copyright (c) 2013 Koninklijke Philips N.V. 3 | All Rights Reserved. 4 | ********************************************************************************/ 5 | 6 | #import "PHBridgeResourcesCache.h" 7 | #import "PHBridgeResourcesReader.h" 8 | #import "PHBridgeSearching.h" 9 | #import "PHBridgeSendAPI.h" 10 | #import "PHBridgeConfiguration.h" 11 | #import "PHError.h" 12 | #import "PHGroup.h" 13 | #import "PHLight.h" 14 | #import "PHLightState.h" 15 | #import "PHSchedule.h" 16 | #import "PHScene.h" 17 | #import "PHSoftwareUpdateStatus.h" 18 | #import "PHNotificationManager.h" 19 | #import "PHHueSDK.h" 20 | #import "PHBridgeResource.h" 21 | #import "PHUtilities.h" 22 | #import "PHOverallFactory.h" 23 | -------------------------------------------------------------------------------- /HomeKitBridge/HueSDK_OSX.framework/Versions/A/Headers/PHBridgeConfiguration.h: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | Copyright (c) 2013 Koninklijke Philips N.V. 3 | All Rights Reserved. 4 | ********************************************************************************/ 5 | 6 | #import 7 | 8 | @class PHBridgeResource; 9 | @class PHSoftwareUpdateStatus; 10 | 11 | /** 12 | Contains the configuration data of the bridge 13 | */ 14 | @interface PHBridgeConfiguration : NSObject 15 | /** 16 | The IP address of this bridge 17 | */ 18 | @property (nonatomic, strong) NSString *ipaddress; 19 | 20 | /** 21 | The MAC address of this bridge 22 | */ 23 | @property (nonatomic, strong) NSString *mac; 24 | 25 | /** 26 | The id of this bridge 27 | */ 28 | @property (nonatomic, strong) NSString *bridgeId; 29 | 30 | /** 31 | The username of this bridge 32 | */ 33 | @property (nonatomic, strong) NSString *username; 34 | 35 | /** 36 | The current software version of this bridge 37 | */ 38 | @property (nonatomic, strong) NSString *swversion; 39 | 40 | /** 41 | The current name of the bridge 42 | */ 43 | @property (nonatomic, strong) NSString *name; 44 | 45 | /** 46 | The proxy state of the bridge 47 | */ 48 | @property (nonatomic, readonly) BOOL proxy; 49 | 50 | /** 51 | The current proxy address of the bridge 52 | */ 53 | @property (nonatomic, strong) NSString *proxyAddress; 54 | 55 | /** 56 | The current proxy port of the bridge 57 | */ 58 | @property (nonatomic, strong) NSNumber *proxyPort; 59 | 60 | /** 61 | A dictionary with values about available software updates 62 | */ 63 | @property (nonatomic, strong) PHSoftwareUpdateStatus *softwareUpdate; 64 | 65 | /** 66 | The current netmask address of the bridge 67 | */ 68 | @property (nonatomic, strong) NSString *netmask; 69 | 70 | /** 71 | The current gateway address of the bridge 72 | */ 73 | @property (nonatomic, strong) NSString *gateway; 74 | 75 | /** 76 | The current dhcp state of the bridge 77 | */ 78 | @property (nonatomic, strong) NSNumber *dhcp; 79 | 80 | /** 81 | Portal services state of the bridge 82 | */ 83 | @property(nonatomic, strong) NSNumber *portalServices; 84 | 85 | /** 86 | The date/time setting of the bridge 87 | */ 88 | @property (nonatomic, strong) NSString *time; 89 | 90 | /** 91 | Converts the bridge time string to an NSDate 92 | @returns The date/time setting of the bridge converted to an NSDate 93 | */ 94 | - (NSDate *)getBridgeTimeAsNSDate; 95 | 96 | /** 97 | Converts the bridge configuration to a NSDictionary 98 | @returns The configuration of the bridge to a NSDictionary 99 | */ 100 | - (NSDictionary *)bridgeConfigurationAsDictionary; 101 | 102 | @end 103 | -------------------------------------------------------------------------------- /HomeKitBridge/HueSDK_OSX.framework/Versions/A/Headers/PHBridgeResource.h: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | Copyright (c) 2013 Koninklijke Philips N.V. 3 | All Rights Reserved. 4 | ********************************************************************************/ 5 | 6 | #import 7 | 8 | @class PHError; 9 | 10 | /** 11 | Base object for bridge resourcs that have an identifier and name 12 | */ 13 | @interface PHBridgeResource : NSObject 14 | /** 15 | The identifier 16 | */ 17 | @property (nonatomic, strong) NSString *identifier; 18 | 19 | /** 20 | The name 21 | */ 22 | @property (nonatomic, strong) NSString *name; 23 | 24 | - (BOOL)isValid:(PHError **)errPtr; 25 | 26 | @end 27 | -------------------------------------------------------------------------------- /HomeKitBridge/HueSDK_OSX.framework/Versions/A/Headers/PHBridgeResourcesCache.h: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | Copyright (c) 2013 Koninklijke Philips N.V. 3 | All Rights Reserved. 4 | ********************************************************************************/ 5 | 6 | #import 7 | 8 | @class PHBridgeConfiguration; 9 | @class PHError; 10 | 11 | /** 12 | Contains the object graph of lights, groups, schedules, and bridge configuration. This is used to store the 13 | the current state of the bridge in object form 14 | */ 15 | @interface PHBridgeResourcesCache : NSObject 16 | 17 | @property (nonatomic, strong) NSDictionary *lights; 18 | @property (nonatomic, strong) NSDictionary *groups; 19 | @property (nonatomic, strong) NSDictionary *schedules; 20 | @property (nonatomic, strong) NSDictionary *scenes; 21 | @property (nonatomic, strong) PHBridgeConfiguration *bridgeConfiguration; 22 | 23 | /** 24 | Checks all cointained light, group and shedule objects are valid objects by calling isValid on each one. Returns NO if any are invalid, and optionally fills the PHError object with error information 25 | @param nsErrorPtr pointer to an PHError objet 26 | @returns YES if valid NO if not 27 | */ 28 | -(BOOL)isValid:(PHError **)nsErrorPtr; 29 | 30 | @end 31 | -------------------------------------------------------------------------------- /HomeKitBridge/HueSDK_OSX.framework/Versions/A/Headers/PHBridgeResourcesReader.h: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | Copyright (c) 2013 Koninklijke Philips N.V. 3 | All Rights Reserved. 4 | ********************************************************************************/ 5 | 6 | #import 7 | 8 | @class PHBridgeResourcesCache; 9 | 10 | /** 11 | This is used to obtain the PHBridgeResourcesCache object that contains the last read state of the bridge 12 | */ 13 | @interface PHBridgeResourcesReader : NSObject 14 | 15 | /** 16 | Reads the BridgeResourcesCache from cached storage 17 | @returns the PHBridgeResourcesCache object that contains that last fetched object view of the bridge data. 18 | */ 19 | + (PHBridgeResourcesCache *)readBridgeResourcesCache; 20 | 21 | @end 22 | -------------------------------------------------------------------------------- /HomeKitBridge/HueSDK_OSX.framework/Versions/A/Headers/PHBridgeSearching.h: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | Copyright (c) 2013 Koninklijke Philips N.V. 3 | All Rights Reserved. 4 | ********************************************************************************/ 5 | 6 | #import 7 | 8 | @class PHHttpRequester; 9 | @class AsyncUdpSocket; 10 | 11 | /** 12 | This is a block used for getting the response of the bridge search class. 13 | It takes a dictionary as parameter, which contains mac addresses as keys and 14 | ip addresses as values. 15 | */ 16 | typedef void (^PHBridgeSearchCompletionHandler)(NSDictionary *bridgesFound); 17 | 18 | /** 19 | This class is used for searching for SmartBridge using UPnP and portal based discovery. 20 | */ 21 | @interface PHBridgeSearching : NSObject 22 | 23 | /** 24 | Socket used for doing the UPnP search 25 | */ 26 | @property (nonatomic, strong) AsyncUdpSocket *ssdpSocket; 27 | 28 | /** 29 | Http requester used for portal search 30 | */ 31 | @property (nonatomic, strong) PHHttpRequester *httpRequester; 32 | 33 | /** 34 | Initializes a PHBridgeSearch object which can search for bridges 35 | @param searchUpnp Indicates whether UPnP should be used for searching 36 | @param searchPortal Indicates whether portal based discovery should be used for searching 37 | @returns PHBridgeSearch instance 38 | */ 39 | - (id)initWithUpnpSearch:(BOOL)searchUpnp andPortalSearch:(BOOL)searchPortal __attribute((deprecated("Use 'initWithUpnpSearch:andPortalSearch:andIpAdressSearch:' method as replacement"))); 40 | 41 | /** 42 | Initializes a PHBridgeSearch object which can search for bridges 43 | @param searchUpnp Indicates whether UPnP should be used for searching 44 | @param searchPortal Indicates whether portal based discovery should be used for searching 45 | @param searchIpAdress Indicates whether IP adress searcg should be used for searching 46 | @returns PHBridgeSearch instance 47 | */ 48 | - (id)initWithUpnpSearch:(BOOL)searchUpnp andPortalSearch:(BOOL)searchPortal andIpAdressSearch:(BOOL)searchIpAdress; 49 | 50 | 51 | /** 52 | Does a search for bridges, sends the result to the given completion handler. 53 | Searches configured with the initializer of this class will be executed in the following order: Upnp, Portal, Ip adress 54 | @param completionHandler the completion handler to call when done searching 55 | @see PHBridgeSearchCompletionHandler 56 | */ 57 | - (void)startSearchWithCompletionHandler:(PHBridgeSearchCompletionHandler)completionHandler; 58 | 59 | @end 60 | -------------------------------------------------------------------------------- /HomeKitBridge/HueSDK_OSX.framework/Versions/A/Headers/PHBridgeSendAPI.h: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | Copyright (c) 2013 Koninklijke Philips N.V. 3 | All Rights Reserved. 4 | ********************************************************************************/ 5 | 6 | #import 7 | 8 | @class PHError; 9 | @class PHLightState; 10 | @class PHBridgeConfiguration; 11 | @class PHLight; 12 | @class PHGroup; 13 | @class PHSchedule; 14 | @class PHSoftwareUpdateStatus; 15 | @class PHScene; 16 | 17 | /** 18 | This is a typedef for a block type. It takes an array of PHErrors. 19 | */ 20 | typedef void (^PHBridgeSendErrorArrayCompletionHandler)(NSArray *errors); 21 | 22 | /** 23 | This is a typedef for a block type. It takes an NSDictionary and an array of PHErrors. 24 | */ 25 | typedef void (^PHBridgeSendDictionaryCompletionHandler)(NSDictionary *dictionary, NSArray *errors); 26 | 27 | /** 28 | This is a typedef for a block type. It takes an NSDictionary, a string (this can be "never", "active" or a string representation of the UTC date of the last search and an array of PHErrors. 29 | */ 30 | typedef void (^PHBridgeSendGetNewLightsCompletionHandler)(NSDictionary *dictionary, NSString *lastScan, NSArray *errors); 31 | 32 | /* 33 | This is a typedef for a block type. It takes an NSArray and an array of PHErrors. 34 | */ 35 | typedef void (^PHBridgeSendArrayCompletionHandler)(NSArray *array, NSArray *errors); 36 | 37 | /** 38 | This is a typedef for a block type. It takes an PHLight and an array of PHErrors. 39 | */ 40 | typedef void (^PHBridgeSendLightCompletionHandler)(NSString *lightIdentifier, NSArray *errors); 41 | 42 | /** 43 | This is a typedef for a block type. It takes an PHGroup and an array of PHErrors. 44 | */ 45 | typedef void (^PHBridgeSendGroupCompletionHandler)(NSString *groupIdentifier, NSArray *errors); 46 | 47 | /** 48 | This is a typedef for a block type. It takes an PHSchedule and an array of PHErrors. 49 | */ 50 | typedef void (^PHBridgeSendScheduleCompletionHandler)(NSString *scheduleIdentifier, NSArray *errors); 51 | 52 | /** 53 | This is a typedef for a block type. It takes an PHSoftwareUpdateStatus and an array of PHErrors. 54 | */ 55 | typedef void (^PHBridgeSendSoftwareUpdateStatusCompletionHandler)(PHSoftwareUpdateStatus *softwareUpdateStatus, NSArray *errors); 56 | 57 | /** 58 | This API contain a set of method calls that operate asynchronously. The calls are made to the bridge to set or get data. 59 | Each method then returns immediately. 60 | The set or get of data is carried out on another thread and returned to the calling app by updating the BridgeResourcesCache. 61 | The BridgeResourceCache object data is updated on each SDK heartbeat. 62 | */ 63 | @protocol PHBridgeSendAPI 64 | 65 | @required 66 | 67 | /** 68 | Starts a search for new lights 69 | @param completionHandler completionHandler for error handling 70 | */ 71 | - (void)searchForNewLights:(PHBridgeSendErrorArrayCompletionHandler)completionHandler; 72 | 73 | /** 74 | Starts a search for new lights using the given serials. 75 | @param serials An array of serials (NSStrings of hex characters), maximum of 10 76 | @param completionHandler completionHandler for error handling 77 | */ 78 | - (void)searchForNewLightsWithSerials:(NSArray *)serials completionHandler:(PHBridgeSendErrorArrayCompletionHandler)completionHandler; 79 | 80 | /** 81 | Updates the light properties 82 | @param light the details of the light to be updated 83 | @param completionHandler completionHandler for error handling 84 | */ 85 | - (void)updateLightWithLight:(PHLight *)light completionHandler:(PHBridgeSendErrorArrayCompletionHandler)completionHandler; 86 | 87 | /** 88 | Updates the state settings of the light 89 | @param lightIdentifier the identifier of the light to be updated 90 | @param lightState the lightstate settings for to set the light to 91 | @param completionHandler completionHandler for error handling 92 | */ 93 | - (void)updateLightStateForId:(NSString *)lightIdentifier withLighState:(PHLightState *)lightState completionHandler:(PHBridgeSendErrorArrayCompletionHandler)completionHandler; 94 | 95 | /** 96 | Updates the bridge configuration 97 | @param bridgeConfiguration the new configuration for the bridge 98 | @param completionHandler completionHandler for error handling 99 | */ 100 | - (void)updateConfigurationWithConfiguration:(PHBridgeConfiguration *)bridgeConfiguration completionHandler:(PHBridgeSendErrorArrayCompletionHandler)completionHandler; 101 | 102 | /** 103 | Removes a username from the white list entries in the bridge 104 | @param username the username to be removed from the bridge 105 | @param completionHandler completionHandler for error handling 106 | */ 107 | - (void)removeWhitelistEntryWithUsername:(NSString *)username completionHandler:(PHBridgeSendErrorArrayCompletionHandler)completionHandler; 108 | 109 | /** 110 | Get newly found lights since last search for new lights 111 | @param completionHandler completionHandler for returning this lights found and error handling 112 | */ 113 | - (void)getNewFoundLights:(PHBridgeSendGetNewLightsCompletionHandler)completionHandler; 114 | 115 | /** 116 | Creates a new Group of lights 117 | @param name the name of the group 118 | @param lightIds the array of light ids to group 119 | @param completionHandler completionHandler for details of created group or error handling 120 | */ 121 | - (void)createGroupWithName:(NSString *)name lightIds:(NSArray *)lightIds completionHandler:(PHBridgeSendGroupCompletionHandler)completionHandler 122 | ; 123 | 124 | /** 125 | Update a given Group of lights 126 | @param group the details of the group to update 127 | @param completionHandler completionHandler for error handling 128 | */ 129 | - (void)updateGroupWithGroup:(PHGroup *)group completionHandler:(PHBridgeSendErrorArrayCompletionHandler)completionHandler; 130 | 131 | /** 132 | Remote the group with the given identifier 133 | @param groupIdentifier the identifier of the group to remove 134 | @param completionHandler completionHandler for error handling 135 | */ 136 | - (void)removeGroupWithId:(NSString *)groupIdentifier completionHandler:(PHBridgeSendErrorArrayCompletionHandler)completionHandler; 137 | 138 | /** 139 | Performs the action for the specified group 140 | @param groupIdentifier The group indentifier for the action 141 | @param lightState the lightState to set the group to 142 | @param completionHandler completionHandler for error handling 143 | */ 144 | - (void)setLightStateForGroupWithId:(NSString *)groupIdentifier lightState:(PHLightState *)lightState completionHandler:(PHBridgeSendErrorArrayCompletionHandler)completionHandler; 145 | 146 | /** 147 | Creates a new schedule 148 | @param schedule the details of the schedule 149 | @param completionHandler completionHandler for details of schedule created or error handling 150 | */ 151 | - (void)createSchedule:(PHSchedule *)schedule completionHandler:(PHBridgeSendScheduleCompletionHandler)completionHandler; 152 | 153 | /** 154 | Remove the schedule with the given identifier 155 | @param scheduleIdentifier the identifier of the schedule to remove 156 | @param completionHandler completionHandler for error handling 157 | */ 158 | - (void)removeScheduleWithId:(NSString *)scheduleIdentifier completionHandler:(PHBridgeSendErrorArrayCompletionHandler)completionHandler; 159 | 160 | /** 161 | Updates the schedule information 162 | @param schedule the schedule to be updated 163 | @param completionHandler completionHandler for error handling 164 | */ 165 | - (void)updateScheduleWithSchedule:(PHSchedule *)schedule completionHandler:(PHBridgeSendErrorArrayCompletionHandler)completionHandler; 166 | 167 | #pragma mark - Software update 168 | 169 | /** 170 | Starts the software update process. 171 | @param completionHandler completionHandler for error handling 172 | */ 173 | - (void)softwareUpdateStart:(PHBridgeSendErrorArrayCompletionHandler)completionHandler; 174 | 175 | /** 176 | Removes the notification which is set when a software update was finished. 177 | @param completionHandler completionHandler for error handling 178 | */ 179 | - (void)softwareUpdateRemoveNotify:(PHBridgeSendErrorArrayCompletionHandler)completionHandler; 180 | 181 | /** 182 | Gets the current software update status from the bridge. 183 | @param completionHandler completionHandler for returning the current status and error handling 184 | */ 185 | - (void)getSoftwareUpdateStatus:(PHBridgeSendSoftwareUpdateStatusCompletionHandler)completionHandler; 186 | 187 | /** 188 | This method lets you disable updates of the cache right after a success message is received by this instance of the bridgeSendAPI. 189 | By default the automatic cache update is enabled. 190 | @param enabled YES to enable cache update, NO to disable. 191 | */ 192 | - (void)setCacheUpdateAfterSuccessResponseEnabled:(BOOL)enabled; 193 | 194 | #pragma mark - Scenes 195 | 196 | /** 197 | Gets all scenes from the bridge. 198 | @param completionHandler completionHandler for returning the current status and error handling 199 | */ 200 | - (void)getAllScenesWithCompletionHandler:(PHBridgeSendDictionaryCompletionHandler)completionHandler; 201 | 202 | /** 203 | @see PHBridgeSendAPI#saveSceneWithCurrentLightStates 204 | */ 205 | - (void)saveScene:(PHScene *)scene completionHandler:(PHBridgeSendErrorArrayCompletionHandler)completionHandler __attribute__((deprecated)); 206 | 207 | /** 208 | Save the scene information to the bridge 209 | @param scene PHScene object that should be saved 210 | @param completionHandler completionHandler for returning the current status and error handling 211 | */ 212 | - (void)saveSceneWithCurrentLightStates:(PHScene *)scene completionHandler:(PHBridgeSendErrorArrayCompletionHandler)completionHandler; 213 | 214 | /** 215 | Save a specific lightstate for a light in a scene, without changing the current shown lightstate on the light 216 | @param lightState the lightstate for the light in this scene 217 | @param lightIdentifier the identifier of the light 218 | @param sceneIdentifier the identifier of the scene 219 | */ 220 | - (void)saveLightState:(PHLightState *)lightState 221 | forLightIdentifier:(NSString *)lightIdentifier 222 | inSceneWithIdentifier:(NSString *)sceneIdentifier 223 | completionHandler:(PHBridgeSendErrorArrayCompletionHandler)completionHandler; 224 | 225 | /** 226 | Activate scene 227 | @param sceneIdentifier the identifier of the sceme to activate 228 | @param groupIdentifier the identifier of the group that should apply the scene 229 | @param completionHandler completionHandler for returning the current status and error handling 230 | */ 231 | - (void)activateSceneWithIdentifier:(NSString *)sceneIdentifier onGroup:(NSString *)groupIdentifier completionHandler:(PHBridgeSendErrorArrayCompletionHandler)completionHandler; 232 | 233 | @end -------------------------------------------------------------------------------- /HomeKitBridge/HueSDK_OSX.framework/Versions/A/Headers/PHError.h: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | Copyright (c) 2013 Koninklijke Philips N.V. 3 | All Rights Reserved. 4 | ********************************************************************************/ 5 | 6 | #import 7 | 8 | #define SDK_ERROR_DOMAIN @"com.philips.hue.sdk" 9 | 10 | typedef enum { 11 | // Resource parsers 12 | INVALID_JSON = 1, 13 | INVALID_ARGUMENTS = 2, 14 | 15 | // PHHttpRequester 16 | NO_CONNECTION = 21, 17 | INVALID_PARAMETERS = 22, 18 | INVALID_PARAMETERS_MISSING_URL = 23, 19 | INVALID_PARAMETERS_MISSING_METHOD = 24, 20 | INVALID_PARAMETERS_INVALID_METHOD = 25, 21 | 22 | // Bridge Resource Cache Storage 23 | LIGHT_ID_NOT_FOUND = 41, 24 | SCHEDULE_ID_NOT_FOUND = 42, 25 | GROUP_ID_NOT_FOUND = 43, 26 | INVALID_DATA = 44, 27 | 28 | // Pushlinking 29 | PUSHLINK_NO_CONNECTION = 60, 30 | PUSHLINK_TIME_LIMIT_REACHED = 61, 31 | PUSHLINK_NO_LOCAL_BRIDGE = 62, 32 | 33 | // Unsupported 34 | UNSUPPORTED_IN_THIS_VERSION = 80, 35 | 36 | 37 | // Domain objects 38 | INVALID_OBJECT_PARAMETER = 80, 39 | 40 | CLIP_ERROR = 100 41 | } CLErrorCode; 42 | 43 | /** 44 | General purpose NSError derived object that is used for SDK errors 45 | Enum of error codes identifies error types 46 | */ 47 | @interface PHError : NSError 48 | 49 | @end 50 | -------------------------------------------------------------------------------- /HomeKitBridge/HueSDK_OSX.framework/Versions/A/Headers/PHGroup.h: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | Copyright (c) 2013 Koninklijke Philips N.V. 3 | All Rights Reserved. 4 | ********************************************************************************/ 5 | 6 | #import 7 | #import "PHBridgeResource.h" 8 | 9 | /** 10 | A grouped set of lights 11 | */ 12 | @interface PHGroup : PHBridgeResource 13 | 14 | /** 15 | The identifiers of the lights controlled by this group 16 | */ 17 | @property (nonatomic, strong) NSArray *lightIdentifiers; 18 | /** 19 | returns dictionary of group details 20 | @returns dictionary of group details 21 | */ 22 | - (NSDictionary *) getGroupAsDictionary; 23 | 24 | 25 | @end -------------------------------------------------------------------------------- /HomeKitBridge/HueSDK_OSX.framework/Versions/A/Headers/PHHueSDK.h: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | Copyright (c) 2013 Koninklijke Philips N.V. 3 | All Rights Reserved. 4 | ********************************************************************************/ 5 | 6 | #import 7 | 8 | @class PHHeartbeat; 9 | @class PHError; 10 | @class PHBridgeConfiguration; 11 | @class PHAuthentication; 12 | @class PHNotificationManager; 13 | 14 | /** 15 | This is the main class for the app to use the SDK. From this class heartbeats can be started and stopped 16 | and the bridge searching process can be initiated. 17 | */ 18 | @interface PHHueSDK : NSObject 19 | 20 | /** 21 | The heartbeat class to use for the heartbeats 22 | */ 23 | @property (nonatomic, strong) PHHeartbeat *phHeartbeat; 24 | 25 | /** 26 | The authentication class to use for authentication 27 | */ 28 | @property (nonatomic, strong) PHAuthentication *phAuthentication; 29 | 30 | /** 31 | The notification manager used for sending notifications 32 | */ 33 | @property (nonatomic, strong) PHNotificationManager *notificationManager; 34 | 35 | /** 36 | Indicated whether the first local heartbeat processing has completed after starting the local heartbeat. 37 | This will be reset after every stop and start of the heartbeat. 38 | */ 39 | @property (nonatomic, assign) BOOL firstLocalHeartbeatCompletedAfterStart; 40 | 41 | /** 42 | Starts the SDK 43 | @returns error when SDK failed to start, nil when started without error 44 | */ 45 | - (void)startUpSDK; 46 | 47 | /** 48 | Stops the SDK 49 | */ 50 | - (void)stopSDK; 51 | 52 | /** 53 | Enables local connections to the bridge 54 | @param interval The interval at which to poll the bridge for a local connection. 55 | */ 56 | - (void)enableLocalConnectionUsingInterval:(NSInteger)interval; 57 | 58 | /** 59 | Disables local connections to the bridge 60 | */ 61 | - (void)disableLocalConnection; 62 | 63 | /** 64 | Returns whether this instance of the SDK tries to connect to a bridge locally. 65 | @returns YES when local connections are enabled, NO otherwise. 66 | */ 67 | - (BOOL)connectsLocal; 68 | 69 | /** 70 | Does the pushlink authentication 71 | */ 72 | - (void)startPushlinkAuthentication; 73 | 74 | /** 75 | Use this method to set the bridge to use for the SDK 76 | @param ipaddress The ipaddress of the bridge 77 | @param macaddress The macaddress of the bridge 78 | @param username The username of the bridge 79 | */ 80 | - (void)setBridgeToUseWithIpAddress:(NSString *)ipaddress macAddress:(NSString *)macaddress andUsername:(NSString *)username __attribute((deprecated("Use 'setBridgeToUseWithIpAddress:macAddress' method as replacement")));; 81 | 82 | /** 83 | Use this method to set the bridge to use for the SDK 84 | @param ipaddress The ipaddress of the bridge 85 | @param macaddress The macaddress of the bridge 86 | */ 87 | - (void)setBridgeToUseWithIpAddress:(NSString *)ipaddress macAddress:(NSString *)macaddress; 88 | 89 | /** 90 | Returns whether the SDK has an active connection to the bridge using local network. 91 | @returns YES when connected to the bridge, no otherwise 92 | */ 93 | - (BOOL)localConnected; 94 | 95 | /** 96 | Disables the cache update for the local heartbeat. 97 | @param disableCacheUpdate When YES, the cache is not updated, otherwise it is. 98 | */ 99 | - (void)disableCacheUpdateLocalHeartbeat:(BOOL)disableCacheUpdate; 100 | 101 | /** 102 | Enables the logging 103 | @param enableLogging When YES, the logging is enabled, otherwise disabled. 104 | */ 105 | - (void)enableLogging:(BOOL)enableLogging; 106 | 107 | @end 108 | -------------------------------------------------------------------------------- /HomeKitBridge/HueSDK_OSX.framework/Versions/A/Headers/PHLight.h: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | Copyright (c) 2013 Koninklijke Philips N.V. 3 | All Rights Reserved. 4 | ********************************************************************************/ 5 | 6 | #import 7 | #import "PHBridgeResource.h" 8 | 9 | @class PHLightState; 10 | 11 | /** 12 | A light and its settings 13 | */ 14 | @interface PHLight : PHBridgeResource 15 | 16 | /** 17 | Supported types of lights 18 | */ 19 | typedef enum { 20 | UNKNOWN_LIGHT, 21 | CT_COLOR_LIGHT, 22 | CT_LIGHT, 23 | COLOR_LIGHT, 24 | DIM_LIGHT, 25 | ON_OFF_LIGHT 26 | } PHLightType; 27 | 28 | @property (nonatomic, assign) BOOL reachable; 29 | @property (nonatomic, assign) PHLightType type; 30 | @property (nonatomic, strong) PHLightState *lightState; 31 | @property (nonatomic, strong) NSString *versionNumber; 32 | @property (nonatomic, strong) NSString *modelNumber; 33 | 34 | /** 35 | Sets the type of the light by the natural string from the bridge. 36 | */ 37 | - (void)setTypeByString:(NSString *)typeString; 38 | 39 | /** 40 | Returns whether the light supports color (hue/saturation) values 41 | @returns YES when color is supported, NO otherwise 42 | */ 43 | - (BOOL)supportsColor; 44 | 45 | /** 46 | Returns whether the light supports color temperature (CT) values 47 | @returns YES when CT is supported, NO otherwise 48 | */ 49 | - (BOOL)supportsCT; 50 | 51 | /** 52 | Returns whether the light supports brightness values 53 | @returns YES when brightness is supported, NO otherwise 54 | */ 55 | - (BOOL)supportsBrightness; 56 | 57 | /** 58 | Returns a dictionary containing the details of this light. 59 | @returns the dictionary of light details 60 | */ 61 | - (NSDictionary *) getLightAsDictionary; 62 | 63 | 64 | @end -------------------------------------------------------------------------------- /HomeKitBridge/HueSDK_OSX.framework/Versions/A/Headers/PHLightState.h: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | Copyright (c) 2013 Koninklijke Philips N.V. 3 | All Rights Reserved. 4 | ********************************************************************************/ 5 | 6 | #import 7 | 8 | typedef enum { 9 | COLORMODE_UNKNOWN, // It is unknown what the current colormode is 10 | COLORMODE_NONE, // No colormode (for lights which do not support color) 11 | COLORMODE_CT, // Color is set by ct 12 | COLORMODE_HUE_SATURATION, // Color is set by hue + saturation 13 | COLORMODE_XY // Color is set by xy 14 | } PHLightColormode; 15 | 16 | typedef enum { 17 | ALERT_UNKNOWN, // It is unkown what the current alert value is 18 | ALERT_NONE, // No alert active 19 | ALERT_SELECT, // Select alert (1 breath cycle) is active 20 | ALERT_LSELECT // Select alert (30 seconds of breath cycles) is active 21 | } PHLightAlertMode; 22 | 23 | typedef enum { 24 | EFFECT_UNKNOWN, // It is unknown what the current effect value is 25 | EFFECT_NONE, // No effect active 26 | EFFECT_COLORLOOP // Colorloop effect (loop through colors whith current saturation and brightness) 27 | } PHLightEffectMode; 28 | 29 | /** 30 | The state settings of a light, that can be applied to a light, group of lights, 31 | or for a scheduled change 32 | */ 33 | @interface PHLightState : NSObject 34 | 35 | /** 36 | Returns an NSDictionary containing the property values of this PHLightState 37 | @returns the Light State dictionary 38 | */ 39 | -(NSDictionary *)getLightStateAsDictionary; 40 | 41 | /** 42 | The on off status to set the light to. 43 | YES means on, NO means off. 44 | */ 45 | @property (nonatomic, strong) NSNumber *on; 46 | 47 | /** 48 | The brightness to set the light to. 49 | Range: 0 (lowest brightness, but not off) to 254 (highest brightness). 50 | */ 51 | @property (nonatomic, strong) NSNumber *brightness; 52 | 53 | /** 54 | The hue to set the light to, representing a color. 55 | Range: 0 - 65535 (which represents 0-360 degrees) 56 | Explanation: http://en.wikipedia.org/wiki/Hue 57 | */ 58 | @property (nonatomic, strong) NSNumber *hue; 59 | 60 | /** 61 | The saturation to set the light to. 62 | Range: 0 (least saturated, white) - 254 (most saturated, vivid). 63 | */ 64 | @property (nonatomic, strong) NSNumber *saturation; 65 | 66 | /** 67 | The colortemperature to set the light to in Mirek 68 | Range of 2012 hue bulb: 153 (coldest white) - 500 (warmest white) 69 | Explanation: http://en.wikipedia.org/wiki/Mired 70 | */ 71 | @property (nonatomic, strong) NSNumber *ct; 72 | 73 | /** 74 | x value of a color represented by the CIE 1931 color space 75 | Range: 0.0 - 1.0 76 | Explanation: http://en.wikipedia.org/wiki/CIE_1931_color_space 77 | */ 78 | @property (nonatomic, strong) NSNumber *x; 79 | 80 | /** 81 | y value of a color represented by the CIE 1931 color space 82 | Range: 0.0 - 1.0 83 | Explanation: http://en.wikipedia.org/wiki/CIE_1931_color_space 84 | */ 85 | @property (nonatomic, strong) NSNumber *y; 86 | 87 | /** 88 | The alert to set the light to. 89 | Options: "none" (no alert), "select" (1 breath cycle), "lselect" (breathes for 30 seconds or until value none is set) 90 | */ 91 | @property (nonatomic, assign) PHLightAlertMode alert; 92 | 93 | /** 94 | The effect to set the light to 95 | Options: "none" (no effect), "colorloop" (starts a colorloop with the current saturation and brightness until value none is set) 96 | */ 97 | @property (nonatomic, assign) PHLightEffectMode effect; 98 | 99 | /** 100 | Colormode of this light. 101 | Readonly value. 102 | Values: 103 | - "HS": color is set by hue + saturation 104 | - "CT": color is set by ct value 105 | - "XY": color is set by xy values 106 | */ 107 | @property (nonatomic, assign) PHLightColormode colormode; 108 | 109 | /** 110 | The transition to take to go to this state in 100ms 111 | So 1 means 100ms, 10 means 1 second. 112 | Range: 0 (instant) - 65535 (longest fade) 113 | */ 114 | @property (nonatomic, strong) NSNumber *transitionTime; 115 | 116 | /** 117 | Property indicating if the bridge can reach this light 118 | Readonly value. 119 | */ 120 | @property (nonatomic, strong) NSNumber *reachable; 121 | 122 | /** 123 | Sets the on off status of this light 124 | @param on Boolean value indicating the on off status of the light 125 | */ 126 | - (void)setOnBool:(BOOL)on; 127 | 128 | /** 129 | Validate the light state by checking if the values of the properties are in range 130 | @param Array with PHError objects if one or more errors occured. nil if no errors occured 131 | */ 132 | - (NSArray *)validateLightState; 133 | 134 | @end 135 | -------------------------------------------------------------------------------- /HomeKitBridge/HueSDK_OSX.framework/Versions/A/Headers/PHNotificationManager.h: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | Copyright (c) 2013 Koninklijke Philips N.V. 3 | All Rights Reserved. 4 | ********************************************************************************/ 5 | 6 | #import 7 | 8 | #pragma mark - Connection notifications 9 | 10 | /** 11 | Notification which is send when a local connection to the bridge is made 12 | */ 13 | #define LOCAL_CONNECTION_NOTIFICATION @"LOCAL_CONNECTION_NOTIFICATION" 14 | 15 | /** 16 | Notification which is send when local connection to bridge is lost 17 | */ 18 | #define NO_LOCAL_CONNECTION_NOTIFICATION @"NO_LOCAL_CONNECTION_NOTIFICATION" 19 | 20 | /** 21 | Notification which when no local bridge is known 22 | */ 23 | #define NO_LOCAL_BRIDGE_KNOWN_NOTIFICATION @"NO_LOCAL_BRIDGE_KNOWN_NOTIFICATION" 24 | 25 | /** 26 | Notification which when no local authentication is possible 27 | */ 28 | #define NO_LOCAL_AUTHENTICATION_NOTIFICATION @"NO_LOCAL_AUTHENTICATION_NOTIFICATION" 29 | 30 | /** 31 | Notification which is send when the data returned by the bridge could not be parsed during a heartbeat 32 | */ 33 | #define HEARTBEAT_PARSE_ERROR_NOTIFICATION @"HEARTBEAT_PARSE_ERROR_NOTIFICATION" 34 | 35 | #pragma mark - Pushlink notifications 36 | 37 | /** 38 | Notification which is send when local connection to bridge is lost 39 | */ 40 | #define PUSHLINK_NO_LOCAL_CONNECTION_NOTIFICATION @"PUSHLINK_NO_LOCAL_CONNECTION_NOTIFICATION" 41 | 42 | /** 43 | Notification which when no local bridge is known 44 | */ 45 | #define PUSHLINK_NO_LOCAL_BRIDGE_KNOWN_NOTIFICATION @"PUSHLINK_NO_LOCAL_BRIDGE_KNOWN_NOTIFICATION" 46 | 47 | /** 48 | Notification which is send when the local authentication is failed 49 | */ 50 | #define PUSHLINK_LOCAL_AUTHENTICATION_FAILED_NOTIFICATION @"PUSHLINK_LOCAL_AUTHENTICATION_FAILED_NOTIFICATION" 51 | 52 | /** 53 | Notification which is send when the button is not pressed yet during authentication 54 | */ 55 | #define PUSHLINK_BUTTON_NOT_PRESSED_NOTIFICATION @"PUSHLINK_BUTTON_NOT_PRESSED_NOTIFICATION" 56 | 57 | /** 58 | Notification which is send when the local authentication is successful 59 | */ 60 | #define PUSHLINK_LOCAL_AUTHENTICATION_SUCCESS_NOTIFICATION @"PUSHLINK_LOCAL_AUTHENTICATION_SUCCESS_NOTIFICATION" 61 | 62 | #pragma mark - Cache update notifications 63 | 64 | /** 65 | Notification which is send when the lights in the cache have changed 66 | */ 67 | #define LIGHTS_CACHE_UPDATED_NOTIFICATION @"LIGHTS_CACHE_UPDATED_NOTIFICATION" 68 | 69 | /** 70 | Notification which is send when the groups in the cache have changed 71 | */ 72 | #define GROUPS_CACHE_UPDATED_NOTIFICATION @"GROUPS_CACHE_UPDATED_NOTIFICATION" 73 | 74 | /** 75 | Notification which is send when the schedules in the cache have changed 76 | */ 77 | #define SCHEDULES_CACHE_UPDATED_NOTIFICATION @"SCHEDULES_CACHE_UPDATED_NOTIFICATION" 78 | 79 | /** 80 | Notification which is send when the scenes in the cache have changed 81 | */ 82 | #define SCENES_CACHE_UPDATED_NOTIFICATION @"SCENES_CACHE_UPDATED_NOTIFICATION" 83 | 84 | /** 85 | Notification which is send when the bridge configuration in the cache is changed 86 | */ 87 | #define BRIDGE_CONFIGURATION_CACHE_UPDATED_NOTIFICATION @"BRIDGE_CONFIGURATION_CACHE_UPDATED_NOTIFICATION" 88 | 89 | /** 90 | Notification manager used by the SDK to send notifications to the application using the SDK. 91 | */ 92 | @interface PHNotificationManager : NSObject 93 | 94 | /** 95 | Returns the default SDK notification manager 96 | @return the notification manager 97 | */ 98 | + (PHNotificationManager *)defaultManager; 99 | 100 | /** 101 | Registers an object for notification 102 | @param object the object 103 | @param selector the selector to invoke on the object upon notification 104 | @param notification the notification 105 | @return YES when registering was successful, NO otherwise 106 | */ 107 | - (BOOL)registerObject:(id)object withSelector:(SEL)selector forNotification:(NSString *)notification; 108 | 109 | /** 110 | Deregisters an object for a certain notification 111 | @param object the object 112 | @param notification the notification 113 | @return YES when deregistering was successful, NO otherwise 114 | */ 115 | - (BOOL)deregisterObject:(id)object forNotification:(NSString *)notification; 116 | 117 | /** 118 | Deregisters an object for all notifications 119 | @param object the Object 120 | */ 121 | - (void)deregisterObjectForAllNotifications:(id)object; 122 | 123 | /** 124 | Sends notification to all objects registered for the notification. 125 | @param notification the notification 126 | @return YES when notification is send, NO otherwise 127 | */ 128 | - (BOOL)sendNotification:(NSString *)notification; 129 | 130 | /** 131 | Sends notification to all objects registered for the notification. 132 | @param notification the notification 133 | @param userInfo dictionary to send with the notification with additional information 134 | @return YES when notification is send, NO otherwise 135 | */ 136 | - (BOOL)sendNotification:(NSString *)notification withUserInfo:(NSDictionary *)userInfo; 137 | 138 | @end 139 | -------------------------------------------------------------------------------- /HomeKitBridge/HueSDK_OSX.framework/Versions/A/Headers/PHOverallFactory.h: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | Copyright (c) 2013 Koninklijke Philips N.V. 3 | All Rights Reserved. 4 | ********************************************************************************/ 5 | 6 | #import 7 | 8 | #import "PHBridgeSendAPI.h" 9 | 10 | /** 11 | This is the overall factory to use for app developers. 12 | */ 13 | @interface PHOverallFactory : NSObject 14 | 15 | /** 16 | This will return an initialized and fully set up bridge send API instance. 17 | This is used to send commands to the bridge using the local network. 18 | @return the PHBridgeSendAPI instance 19 | */ 20 | - (id)bridgeSendAPI; 21 | 22 | @end 23 | -------------------------------------------------------------------------------- /HomeKitBridge/HueSDK_OSX.framework/Versions/A/Headers/PHScene.h: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | Copyright (c) 2013 Koninklijke Philips N.V. 3 | All Rights Reserved. 4 | ********************************************************************************/ 5 | 6 | #import 7 | #import "PHBridgeResource.h" 8 | 9 | typedef enum { 10 | SCENE_STATE_UNKNOWN, // It is unkown what the current scene state is 11 | SCENE_STATE_INACTIVE, // Scene inactive 12 | SCENE_STATE_ACTIVE, // Scene active 13 | } PHSceneActiveState; 14 | 15 | /** 16 | A grouped set of lights 17 | */ 18 | @interface PHScene : PHBridgeResource 19 | 20 | /** 21 | The identifiers of the lights controlled by this scene 22 | */ 23 | @property (nonatomic, strong) NSArray *lightIdentifiers; 24 | 25 | /** 26 | The transition to take to go to this state in 100ms 27 | So 1 means 100ms, 10 means 1 second. 28 | Range: 0 (instant) - 65535 (longest fade) 29 | */ 30 | @property (nonatomic, strong) NSNumber *transitionTime; 31 | 32 | /** 33 | Indicates whether this scene is fully created and ready to be used / recalled 34 | */ 35 | @property (nonatomic, assign) PHSceneActiveState active; 36 | 37 | /** 38 | returns dictionary of scene details 39 | @returns dictionary of scene details 40 | */ 41 | - (NSDictionary *) getSceneAsDictionary; 42 | 43 | 44 | @end -------------------------------------------------------------------------------- /HomeKitBridge/HueSDK_OSX.framework/Versions/A/Headers/PHSchedule.h: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | Copyright (c) 2013 Koninklijke Philips N.V. 3 | All Rights Reserved. 4 | ********************************************************************************/ 5 | 6 | #import 7 | #import "PHBridgeResource.h" 8 | 9 | @class PHLightState; 10 | 11 | /* 12 | The bitmask options for the recurring date 13 | */ 14 | typedef enum { 15 | RecurringNone = 0, 16 | RecurringMonday = 1 << 6, 17 | RecurringTuesday = 1 << 5, 18 | RecurringWednesday = 1 << 4, 19 | RecurringThursday = 1 << 3, 20 | RecurringFriday = 1 << 2, 21 | RecurringSaturday = 1 << 1, 22 | RecurringSunday = 1 << 0, 23 | RecurringWeekdays = 124, 24 | RecurringWeekend = 3 25 | } RecurringDay; 26 | 27 | /** 28 | A schedule that specifies a point in time, the state change to be applied, 29 | and the light or group of lights to apply the change to. 30 | */ 31 | @interface PHSchedule : PHBridgeResource 32 | 33 | /** 34 | The description of a schedule 35 | */ 36 | @property (nonatomic, strong) NSString *scheduleDescription; 37 | 38 | /** 39 | The date a schedule is set to fire 40 | */ 41 | @property (nonatomic, strong) NSDate *date; 42 | 43 | /** 44 | The randomize time to use for the schedule. 45 | Maximum value is 86400 (24 hours) 46 | When set to 0 (default) no randomize factor will be used. 47 | */ 48 | @property (nonatomic, assign) NSTimeInterval randomTime; 49 | 50 | /** 51 | A bitmask of the days this should recur, default is RecurringNone. 52 | @see RecurringDay 53 | */ 54 | @property (nonatomic, assign) RecurringDay recurringDays; 55 | 56 | /** 57 | The timer to use for the schedule. 58 | (date value should be nil and the recurringDays value should be 0 if you use a schedule timer) 59 | Maximum value is 86400 (24 hours) 60 | When set to 0 (default) no timer will be used. 61 | */ 62 | @property (nonatomic, assign) NSTimeInterval timer; 63 | 64 | /** 65 | The recurring timer interval which represents how many times the timer will be executed 66 | (date value should be nil and the recurringDays value should be 0 if you use a schedule timer) 67 | Minimum value is 0 68 | Maximum value is 99 69 | When set to 0 (default) no timer interval will be used. 70 | */ 71 | @property (nonatomic, strong) NSNumber *recurringTimerInterval; 72 | 73 | /** 74 | The date the schedule was created 75 | */ 76 | @property (nonatomic, strong) NSDate *created; 77 | 78 | /** 79 | The identifier of the light this schedule should have effect on, this 80 | is only set if this schedule is meant to change a light and not a scene or group. 81 | */ 82 | @property (nonatomic, strong) NSString *lightIdentifier; 83 | 84 | /** 85 | The identifier of the group this schedule should have effect on, this 86 | is only set if this schedule is meant to change a group and not a scene or light. 87 | */ 88 | @property (nonatomic, strong) NSString *groupIdentifier; 89 | 90 | /** 91 | The identifier of the scene this schedule should have effect on, this 92 | is only set if this schedule is meant to change a scene and not a group or light. 93 | */ 94 | @property (nonatomic, strong) NSString *sceneIdentifier; 95 | 96 | /** 97 | The state the light or group should be set to. 98 | */ 99 | @property (nonatomic, strong) PHLightState *state; 100 | 101 | /** 102 | returns dictionary of scheule details 103 | @returns dictionary of schedule details 104 | */ 105 | - (NSDictionary *)getScheduleAsDictionary; 106 | 107 | 108 | @end -------------------------------------------------------------------------------- /HomeKitBridge/HueSDK_OSX.framework/Versions/A/Headers/PHSoftwareUpdateStatus.h: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | Copyright (c) 2013 Koninklijke Philips N.V. 3 | All Rights Reserved. 4 | ********************************************************************************/ 5 | 6 | #import 7 | 8 | typedef enum { 9 | NO_UPDATE, 10 | UPDATE_DOWNLOADING, 11 | UPDATE_READY_FOR_INSTALL, 12 | UPDATE_INSTALLED 13 | } UpdateState; 14 | 15 | @interface PHSoftwareUpdateStatus : NSObject 16 | 17 | @property (nonatomic, assign) UpdateState updateState; 18 | @property (nonatomic, strong) NSString *releaseNotesUrl; 19 | @property (nonatomic, strong) NSString *updateText; 20 | 21 | @end 22 | -------------------------------------------------------------------------------- /HomeKitBridge/HueSDK_OSX.framework/Versions/A/Headers/PHUtilities.h: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | Copyright (c) 2013 Koninklijke Philips N.V. 3 | All Rights Reserved. 4 | ********************************************************************************/ 5 | 6 | #import 7 | 8 | /** 9 | This class contains some utilities for applications using the HueSDK. 10 | */ 11 | @interface PHUtilities : NSObject 12 | 13 | /** 14 | Creates a username for the whitelist. This method will return the same username for every application 15 | on the same device. The advantage of this is that the user will only have to pushlink each device once instead 16 | of for every application using hue. 17 | @returns the identifier to use for pushlinking 18 | */ 19 | + (NSString *)whitelistIdentifier; 20 | 21 | /** 22 | Get's the computername for the whitelist. This method will return the same computername for every application 23 | on the same device. 24 | @returns the name to use for pushlinking 25 | */ 26 | + (NSString *)whitelistName; 27 | 28 | /** 29 | Generates the color for the given XY values. 30 | Note: When the exact values cannot be represented, it will return the closest match. 31 | @param xy the xy point of the color 32 | @param model of the lamp, example: "LCT001" for hue bulb. Used to calculate the color gamut. If this value is empty the default gamut values are used. 33 | @returns The color 34 | */ 35 | #if TARGET_OS_IPHONE || TARGET_IPHONE_SIMULATOR 36 | + (UIColor *)colorFromXY:(CGPoint)xy forModel:(NSString*)model; 37 | #else 38 | + (NSColor *)colorFromXY:(CGPoint)xy forModel:(NSString*)model; 39 | #endif 40 | 41 | /** 42 | Generates a point with x an y value that represents the given color 43 | @param color the color to convert 44 | @param model the lamp model 45 | @return The xy color 46 | */ 47 | #if TARGET_OS_IPHONE || TARGET_IPHONE_SIMULATOR 48 | + (CGPoint)calculateXY:(UIColor *)color forModel:(NSString*)model; 49 | #else 50 | + (CGPoint)calculateXY:(NSColor *)color forModel:(NSString*)model; 51 | #endif 52 | 53 | @end 54 | -------------------------------------------------------------------------------- /HomeKitBridge/HueSDK_OSX.framework/Versions/A/HueSDK_OSX: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KhaosT/HomeKitBridge/d29f8c4c79269a233a03ce46ce8bdcca5e800730/HomeKitBridge/HueSDK_OSX.framework/Versions/A/HueSDK_OSX -------------------------------------------------------------------------------- /HomeKitBridge/HueSDK_OSX.framework/Versions/A/Resources/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | BuildMachineOSBuild 6 | 13A603 7 | CFBundleDevelopmentRegion 8 | English 9 | CFBundleExecutable 10 | HueSDK_OSX 11 | CFBundleIdentifier 12 | com.philips.hue.HueSDK-OSX 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | HueSDK_OSX 17 | CFBundlePackageType 18 | FMWK 19 | CFBundleShortVersionString 20 | 1.0 21 | CFBundleSignature 22 | ???? 23 | CFBundleVersion 24 | 1 25 | DTCompiler 26 | com.apple.compilers.llvm.clang.1_0 27 | DTPlatformBuild 28 | 5A3005 29 | DTPlatformVersion 30 | GM 31 | DTSDKBuild 32 | 13A595 33 | DTSDKName 34 | macosx10.9 35 | DTXcode 36 | 0502 37 | DTXcodeBuild 38 | 5A3005 39 | NSHumanReadableCopyright 40 | Copyright © 2013 Philips. All rights reserved. 41 | 42 | 43 | -------------------------------------------------------------------------------- /HomeKitBridge/HueSDK_OSX.framework/Versions/A/Resources/en.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KhaosT/HomeKitBridge/d29f8c4c79269a233a03ce46ce8bdcca5e800730/HomeKitBridge/HueSDK_OSX.framework/Versions/A/Resources/en.lproj/InfoPlist.strings -------------------------------------------------------------------------------- /HomeKitBridge/HueSDK_OSX.framework/Versions/Current: -------------------------------------------------------------------------------- 1 | A -------------------------------------------------------------------------------- /HomeKitBridge/Images.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "mac", 5 | "size" : "16x16", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "mac", 10 | "size" : "16x16", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "mac", 15 | "size" : "32x32", 16 | "scale" : "1x" 17 | }, 18 | { 19 | "idiom" : "mac", 20 | "size" : "32x32", 21 | "scale" : "2x" 22 | }, 23 | { 24 | "size" : "128x128", 25 | "idiom" : "mac", 26 | "filename" : "icon-128.png", 27 | "scale" : "1x" 28 | }, 29 | { 30 | "size" : "128x128", 31 | "idiom" : "mac", 32 | "filename" : "icon-256-1.png", 33 | "scale" : "2x" 34 | }, 35 | { 36 | "size" : "256x256", 37 | "idiom" : "mac", 38 | "filename" : "icon-256.png", 39 | "scale" : "1x" 40 | }, 41 | { 42 | "size" : "256x256", 43 | "idiom" : "mac", 44 | "filename" : "icon.png", 45 | "scale" : "2x" 46 | }, 47 | { 48 | "size" : "512x512", 49 | "idiom" : "mac", 50 | "filename" : "icon-1.png", 51 | "scale" : "1x" 52 | }, 53 | { 54 | "size" : "512x512", 55 | "idiom" : "mac", 56 | "filename" : "icon@2x.png", 57 | "scale" : "2x" 58 | } 59 | ], 60 | "info" : { 61 | "version" : 1, 62 | "author" : "xcode" 63 | } 64 | } -------------------------------------------------------------------------------- /HomeKitBridge/Images.xcassets/AppIcon.appiconset/icon-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KhaosT/HomeKitBridge/d29f8c4c79269a233a03ce46ce8bdcca5e800730/HomeKitBridge/Images.xcassets/AppIcon.appiconset/icon-1.png -------------------------------------------------------------------------------- /HomeKitBridge/Images.xcassets/AppIcon.appiconset/icon-128.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KhaosT/HomeKitBridge/d29f8c4c79269a233a03ce46ce8bdcca5e800730/HomeKitBridge/Images.xcassets/AppIcon.appiconset/icon-128.png -------------------------------------------------------------------------------- /HomeKitBridge/Images.xcassets/AppIcon.appiconset/icon-256-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KhaosT/HomeKitBridge/d29f8c4c79269a233a03ce46ce8bdcca5e800730/HomeKitBridge/Images.xcassets/AppIcon.appiconset/icon-256-1.png -------------------------------------------------------------------------------- /HomeKitBridge/Images.xcassets/AppIcon.appiconset/icon-256.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KhaosT/HomeKitBridge/d29f8c4c79269a233a03ce46ce8bdcca5e800730/HomeKitBridge/Images.xcassets/AppIcon.appiconset/icon-256.png -------------------------------------------------------------------------------- /HomeKitBridge/Images.xcassets/AppIcon.appiconset/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KhaosT/HomeKitBridge/d29f8c4c79269a233a03ce46ce8bdcca5e800730/HomeKitBridge/Images.xcassets/AppIcon.appiconset/icon.png -------------------------------------------------------------------------------- /HomeKitBridge/Images.xcassets/AppIcon.appiconset/icon@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KhaosT/HomeKitBridge/d29f8c4c79269a233a03ce46ce8bdcca5e800730/HomeKitBridge/Images.xcassets/AppIcon.appiconset/icon@2x.png -------------------------------------------------------------------------------- /HomeKitBridge/Images.xcassets/closeButton.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal" 5 | }, 6 | { 7 | "idiom" : "universal", 8 | "scale" : "1x", 9 | "filename" : "closeButton.png" 10 | }, 11 | { 12 | "idiom" : "universal", 13 | "scale" : "2x", 14 | "filename" : "closeButton@2x.png" 15 | }, 16 | { 17 | "idiom" : "universal", 18 | "scale" : "3x" 19 | } 20 | ], 21 | "info" : { 22 | "version" : 1, 23 | "author" : "xcode" 24 | } 25 | } -------------------------------------------------------------------------------- /HomeKitBridge/Images.xcassets/closeButton.imageset/closeButton.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KhaosT/HomeKitBridge/d29f8c4c79269a233a03ce46ce8bdcca5e800730/HomeKitBridge/Images.xcassets/closeButton.imageset/closeButton.png -------------------------------------------------------------------------------- /HomeKitBridge/Images.xcassets/closeButton.imageset/closeButton@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KhaosT/HomeKitBridge/d29f8c4c79269a233a03ce46ce8bdcca5e800730/HomeKitBridge/Images.xcassets/closeButton.imageset/closeButton@2x.png -------------------------------------------------------------------------------- /HomeKitBridge/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIconFile 10 | 11 | CFBundleIdentifier 12 | org.oltica.${PRODUCT_NAME:rfc1034identifier} 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | ${PRODUCT_NAME} 17 | CFBundlePackageType 18 | APPL 19 | CFBundleShortVersionString 20 | 1.0 21 | CFBundleSignature 22 | ???? 23 | CFBundleVersion 24 | 1 25 | LSMinimumSystemVersion 26 | ${MACOSX_DEPLOYMENT_TARGET} 27 | NSHumanReadableCopyright 28 | Copyright © 2014 Oltica. All rights reserved. 29 | NSMainNibFile 30 | MainMenu 31 | NSPrincipalClass 32 | NSApplication 33 | 34 | 35 | -------------------------------------------------------------------------------- /HomeKitBridge/Lumberjack/DDASLLogger.h: -------------------------------------------------------------------------------- 1 | #import 2 | #import 3 | 4 | #import "DDLog.h" 5 | 6 | /** 7 | * Welcome to Cocoa Lumberjack! 8 | * 9 | * The project page has a wealth of documentation if you have any questions. 10 | * https://github.com/robbiehanson/CocoaLumberjack 11 | * 12 | * If you're new to the project you may wish to read the "Getting Started" wiki. 13 | * https://github.com/robbiehanson/CocoaLumberjack/wiki/GettingStarted 14 | * 15 | * 16 | * This class provides a logger for the Apple System Log facility. 17 | * 18 | * As described in the "Getting Started" page, 19 | * the traditional NSLog() function directs it's output to two places: 20 | * 21 | * - Apple System Log 22 | * - StdErr (if stderr is a TTY) so log statements show up in Xcode console 23 | * 24 | * To duplicate NSLog() functionality you can simply add this logger and a tty logger. 25 | * However, if you instead choose to use file logging (for faster performance), 26 | * you may choose to use a file logger and a tty logger. 27 | **/ 28 | 29 | @interface DDASLLogger : DDAbstractLogger 30 | { 31 | aslclient client; 32 | } 33 | 34 | + (DDASLLogger *)sharedInstance; 35 | 36 | // Inherited from DDAbstractLogger 37 | 38 | // - (id )logFormatter; 39 | // - (void)setLogFormatter:(id )formatter; 40 | 41 | @end 42 | -------------------------------------------------------------------------------- /HomeKitBridge/Lumberjack/DDASLLogger.m: -------------------------------------------------------------------------------- 1 | #import "DDASLLogger.h" 2 | 3 | #import 4 | 5 | /** 6 | * Welcome to Cocoa Lumberjack! 7 | * 8 | * The project page has a wealth of documentation if you have any questions. 9 | * https://github.com/robbiehanson/CocoaLumberjack 10 | * 11 | * If you're new to the project you may wish to read the "Getting Started" wiki. 12 | * https://github.com/robbiehanson/CocoaLumberjack/wiki/GettingStarted 13 | **/ 14 | 15 | #if ! __has_feature(objc_arc) 16 | #warning This file must be compiled with ARC. Use -fobjc-arc flag (or convert project to ARC). 17 | #endif 18 | 19 | 20 | @implementation DDASLLogger 21 | 22 | static DDASLLogger *sharedInstance; 23 | 24 | /** 25 | * The runtime sends initialize to each class in a program exactly one time just before the class, 26 | * or any class that inherits from it, is sent its first message from within the program. (Thus the 27 | * method may never be invoked if the class is not used.) The runtime sends the initialize message to 28 | * classes in a thread-safe manner. Superclasses receive this message before their subclasses. 29 | * 30 | * This method may also be called directly (assumably by accident), hence the safety mechanism. 31 | **/ 32 | + (void)initialize 33 | { 34 | static BOOL initialized = NO; 35 | if (!initialized) 36 | { 37 | initialized = YES; 38 | 39 | sharedInstance = [[DDASLLogger alloc] init]; 40 | } 41 | } 42 | 43 | + (DDASLLogger *)sharedInstance 44 | { 45 | return sharedInstance; 46 | } 47 | 48 | - (id)init 49 | { 50 | if (sharedInstance != nil) 51 | { 52 | return nil; 53 | } 54 | 55 | if ((self = [super init])) 56 | { 57 | // A default asl client is provided for the main thread, 58 | // but background threads need to create their own client. 59 | 60 | client = asl_open(NULL, "com.apple.console", 0); 61 | } 62 | return self; 63 | } 64 | 65 | - (void)logMessage:(DDLogMessage *)logMessage 66 | { 67 | NSString *logMsg = logMessage->logMsg; 68 | 69 | if (formatter) 70 | { 71 | logMsg = [formatter formatLogMessage:logMessage]; 72 | } 73 | 74 | if (logMsg) 75 | { 76 | const char *msg = [logMsg UTF8String]; 77 | 78 | int aslLogLevel; 79 | switch (logMessage->logFlag) 80 | { 81 | // Note: By default ASL will filter anything above level 5 (Notice). 82 | // So our mappings shouldn't go above that level. 83 | 84 | case LOG_FLAG_ERROR : aslLogLevel = ASL_LEVEL_CRIT; break; 85 | case LOG_FLAG_WARN : aslLogLevel = ASL_LEVEL_ERR; break; 86 | case LOG_FLAG_INFO : aslLogLevel = ASL_LEVEL_WARNING; break; 87 | default : aslLogLevel = ASL_LEVEL_NOTICE; break; 88 | } 89 | 90 | asl_log(client, NULL, aslLogLevel, "%s", msg); 91 | } 92 | } 93 | 94 | - (NSString *)loggerName 95 | { 96 | return @"cocoa.lumberjack.aslLogger"; 97 | } 98 | 99 | @end 100 | -------------------------------------------------------------------------------- /HomeKitBridge/Lumberjack/DDAbstractDatabaseLogger.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | #import "DDLog.h" 4 | 5 | /** 6 | * Welcome to Cocoa Lumberjack! 7 | * 8 | * The project page has a wealth of documentation if you have any questions. 9 | * https://github.com/robbiehanson/CocoaLumberjack 10 | * 11 | * If you're new to the project you may wish to read the "Getting Started" wiki. 12 | * https://github.com/robbiehanson/CocoaLumberjack/wiki/GettingStarted 13 | * 14 | * 15 | * This class provides an abstract implementation of a database logger. 16 | * 17 | * That is, it provides the base implementation for a database logger to build atop of. 18 | * All that is needed for a concrete database logger is to extend this class 19 | * and override the methods in the implementation file that are prefixed with "db_". 20 | **/ 21 | 22 | @interface DDAbstractDatabaseLogger : DDAbstractLogger { 23 | @protected 24 | NSUInteger saveThreshold; 25 | NSTimeInterval saveInterval; 26 | NSTimeInterval maxAge; 27 | NSTimeInterval deleteInterval; 28 | BOOL deleteOnEverySave; 29 | 30 | BOOL saveTimerSuspended; 31 | NSUInteger unsavedCount; 32 | dispatch_time_t unsavedTime; 33 | dispatch_source_t saveTimer; 34 | dispatch_time_t lastDeleteTime; 35 | dispatch_source_t deleteTimer; 36 | } 37 | 38 | /** 39 | * Specifies how often to save the data to disk. 40 | * Since saving is an expensive operation (disk io) it is not done after every log statement. 41 | * These properties allow you to configure how/when the logger saves to disk. 42 | * 43 | * A save is done when either (whichever happens first): 44 | * 45 | * - The number of unsaved log entries reaches saveThreshold 46 | * - The amount of time since the oldest unsaved log entry was created reaches saveInterval 47 | * 48 | * You can optionally disable the saveThreshold by setting it to zero. 49 | * If you disable the saveThreshold you are entirely dependent on the saveInterval. 50 | * 51 | * You can optionally disable the saveInterval by setting it to zero (or a negative value). 52 | * If you disable the saveInterval you are entirely dependent on the saveThreshold. 53 | * 54 | * It's not wise to disable both saveThreshold and saveInterval. 55 | * 56 | * The default saveThreshold is 500. 57 | * The default saveInterval is 60 seconds. 58 | **/ 59 | @property (assign, readwrite) NSUInteger saveThreshold; 60 | @property (assign, readwrite) NSTimeInterval saveInterval; 61 | 62 | /** 63 | * It is likely you don't want the log entries to persist forever. 64 | * Doing so would allow the database to grow infinitely large over time. 65 | * 66 | * The maxAge property provides a way to specify how old a log statement can get 67 | * before it should get deleted from the database. 68 | * 69 | * The deleteInterval specifies how often to sweep for old log entries. 70 | * Since deleting is an expensive operation (disk io) is is done on a fixed interval. 71 | * 72 | * An alternative to the deleteInterval is the deleteOnEverySave option. 73 | * This specifies that old log entries should be deleted during every save operation. 74 | * 75 | * You can optionally disable the maxAge by setting it to zero (or a negative value). 76 | * If you disable the maxAge then old log statements are not deleted. 77 | * 78 | * You can optionally disable the deleteInterval by setting it to zero (or a negative value). 79 | * 80 | * If you disable both deleteInterval and deleteOnEverySave then old log statements are not deleted. 81 | * 82 | * It's not wise to enable both deleteInterval and deleteOnEverySave. 83 | * 84 | * The default maxAge is 7 days. 85 | * The default deleteInterval is 5 minutes. 86 | * The default deleteOnEverySave is NO. 87 | **/ 88 | @property (assign, readwrite) NSTimeInterval maxAge; 89 | @property (assign, readwrite) NSTimeInterval deleteInterval; 90 | @property (assign, readwrite) BOOL deleteOnEverySave; 91 | 92 | /** 93 | * Forces a save of any pending log entries (flushes log entries to disk). 94 | **/ 95 | - (void)savePendingLogEntries; 96 | 97 | /** 98 | * Removes any log entries that are older than maxAge. 99 | **/ 100 | - (void)deleteOldLogEntries; 101 | 102 | @end 103 | -------------------------------------------------------------------------------- /HomeKitBridge/Lumberjack/DDTTYLogger.h: -------------------------------------------------------------------------------- 1 | #import 2 | #if TARGET_OS_IPHONE 3 | #import 4 | #else 5 | #import 6 | #endif 7 | 8 | #import "DDLog.h" 9 | 10 | /** 11 | * Welcome to Cocoa Lumberjack! 12 | * 13 | * The project page has a wealth of documentation if you have any questions. 14 | * https://github.com/robbiehanson/CocoaLumberjack 15 | * 16 | * If you're new to the project you may wish to read the "Getting Started" wiki. 17 | * https://github.com/robbiehanson/CocoaLumberjack/wiki/GettingStarted 18 | * 19 | * 20 | * This class provides a logger for Terminal output or Xcode console output, 21 | * depending on where you are running your code. 22 | * 23 | * As described in the "Getting Started" page, 24 | * the traditional NSLog() function directs it's output to two places: 25 | * 26 | * - Apple System Log (so it shows up in Console.app) 27 | * - StdErr (if stderr is a TTY, so log statements show up in Xcode console) 28 | * 29 | * To duplicate NSLog() functionality you can simply add this logger and an asl logger. 30 | * However, if you instead choose to use file logging (for faster performance), 31 | * you may choose to use only a file logger and a tty logger. 32 | **/ 33 | 34 | @interface DDTTYLogger : DDAbstractLogger 35 | { 36 | NSCalendar *calendar; 37 | NSUInteger calendarUnitFlags; 38 | 39 | NSString *appName; 40 | char *app; 41 | size_t appLen; 42 | 43 | NSString *processID; 44 | char *pid; 45 | size_t pidLen; 46 | 47 | BOOL colorsEnabled; 48 | NSMutableArray *colorProfilesArray; 49 | NSMutableDictionary *colorProfilesDict; 50 | } 51 | 52 | + (DDTTYLogger *)sharedInstance; 53 | 54 | /* Inherited from the DDLogger protocol: 55 | * 56 | * Formatters may optionally be added to any logger. 57 | * 58 | * If no formatter is set, the logger simply logs the message as it is given in logMessage, 59 | * or it may use its own built in formatting style. 60 | * 61 | * More information about formatters can be found here: 62 | * https://github.com/robbiehanson/CocoaLumberjack/wiki/CustomFormatters 63 | * 64 | * The actual implementation of these methods is inherited from DDAbstractLogger. 65 | 66 | - (id )logFormatter; 67 | - (void)setLogFormatter:(id )formatter; 68 | 69 | */ 70 | 71 | /** 72 | * Want to use different colors for different log levels? 73 | * Enable this property. 74 | * 75 | * If you run the application via the Terminal (not Xcode), 76 | * the logger will map colors to xterm-256color or xterm-color (if available). 77 | * 78 | * Xcode does NOT natively support colors in the Xcode debugging console. 79 | * You'll need to install the XcodeColors plugin to see colors in the Xcode console. 80 | * https://github.com/robbiehanson/XcodeColors 81 | * 82 | * The default value if NO. 83 | **/ 84 | @property (readwrite, assign) BOOL colorsEnabled; 85 | 86 | /** 87 | * The default color set (foregroundColor, backgroundColor) is: 88 | * 89 | * - LOG_FLAG_ERROR = (red, nil) 90 | * - LOG_FLAG_WARN = (orange, nil) 91 | * 92 | * You can customize the colors however you see fit. 93 | * Please note that you are passing a flag, NOT a level. 94 | * 95 | * GOOD : [ttyLogger setForegroundColor:pink backgroundColor:nil forFlag:LOG_FLAG_INFO]; // <- Good :) 96 | * BAD : [ttyLogger setForegroundColor:pink backgroundColor:nil forFlag:LOG_LEVEL_INFO]; // <- BAD! :( 97 | * 98 | * LOG_FLAG_INFO = 0...00100 99 | * LOG_LEVEL_INFO = 0...00111 <- Would match LOG_FLAG_INFO and LOG_FLAG_WARN and LOG_FLAG_ERROR 100 | * 101 | * If you run the application within Xcode, then the XcodeColors plugin is required. 102 | * 103 | * If you run the application from a shell, then DDTTYLogger will automatically map the given color to 104 | * the closest available color. (xterm-256color or xterm-color which have 256 and 16 supported colors respectively.) 105 | * 106 | * This method invokes setForegroundColor:backgroundColor:forFlag:context: and passes the default context (0). 107 | **/ 108 | #if TARGET_OS_IPHONE 109 | - (void)setForegroundColor:(UIColor *)txtColor backgroundColor:(UIColor *)bgColor forFlag:(int)mask; 110 | #else 111 | - (void)setForegroundColor:(NSColor *)txtColor backgroundColor:(NSColor *)bgColor forFlag:(int)mask; 112 | #endif 113 | 114 | /** 115 | * Just like setForegroundColor:backgroundColor:flag, but allows you to specify a particular logging context. 116 | * 117 | * A logging context is often used to identify log messages coming from a 3rd party framework, 118 | * although logging context's can be used for many different functions. 119 | * 120 | * Logging context's are explained in further detail here: 121 | * https://github.com/robbiehanson/CocoaLumberjack/wiki/CustomContext 122 | **/ 123 | #if TARGET_OS_IPHONE 124 | - (void)setForegroundColor:(UIColor *)txtColor backgroundColor:(UIColor *)bgColor forFlag:(int)mask context:(int)ctxt; 125 | #else 126 | - (void)setForegroundColor:(NSColor *)txtColor backgroundColor:(NSColor *)bgColor forFlag:(int)mask context:(int)ctxt; 127 | #endif 128 | 129 | /** 130 | * Similar to the methods above, but allows you to map DDLogMessage->tag to a particular color profile. 131 | * For example, you could do something like this: 132 | * 133 | * static NSString *const PurpleTag = @"PurpleTag"; 134 | * 135 | * #define DDLogPurple(frmt, ...) LOG_OBJC_TAG_MACRO(NO, 0, 0, 0, PurpleTag, frmt, ##__VA_ARGS__) 136 | * 137 | * And then in your applicationDidFinishLaunching, or wherever you configure Lumberjack: 138 | * 139 | * #if TARGET_OS_IPHONE 140 | * UIColor *purple = [UIColor colorWithRed:(64/255.0) green:(0/255.0) blue:(128/255.0) alpha:1.0]; 141 | * #else 142 | * NSColor *purple = [NSColor colorWithCalibratedRed:(64/255.0) green:(0/255.0) blue:(128/255.0) alpha:1.0]; 143 | * 144 | * [[DDTTYLogger sharedInstance] setForegroundColor:purple backgroundColor:nil forTag:PurpleTag]; 145 | * [DDLog addLogger:[DDTTYLogger sharedInstance]]; 146 | * 147 | * This would essentially give you a straight NSLog replacement that prints in purple: 148 | * 149 | * DDLogPurple(@"I'm a purple log message!"); 150 | **/ 151 | #if TARGET_OS_IPHONE 152 | - (void)setForegroundColor:(UIColor *)txtColor backgroundColor:(UIColor *)bgColor forTag:(id )tag; 153 | #else 154 | - (void)setForegroundColor:(NSColor *)txtColor backgroundColor:(NSColor *)bgColor forTag:(id )tag; 155 | #endif 156 | 157 | /** 158 | * Clearing color profiles. 159 | **/ 160 | - (void)clearColorsForFlag:(int)mask; 161 | - (void)clearColorsForFlag:(int)mask context:(int)context; 162 | - (void)clearColorsForTag:(id )tag; 163 | - (void)clearColorsForAllFlags; 164 | - (void)clearColorsForAllTags; 165 | - (void)clearAllColors; 166 | 167 | @end 168 | -------------------------------------------------------------------------------- /HomeKitBridge/Lumberjack/Extensions/ContextFilterLogFormatter.h: -------------------------------------------------------------------------------- 1 | #import 2 | #import "DDLog.h" 3 | 4 | @class ContextFilterLogFormatter; 5 | 6 | /** 7 | * Welcome to Cocoa Lumberjack! 8 | * 9 | * The project page has a wealth of documentation if you have any questions. 10 | * https://github.com/robbiehanson/CocoaLumberjack 11 | * 12 | * If you're new to the project you may wish to read the "Getting Started" page. 13 | * https://github.com/robbiehanson/CocoaLumberjack/wiki/GettingStarted 14 | * 15 | * 16 | * This class provides a log formatter that filters log statements from a logging context not on the whitelist. 17 | * 18 | * A log formatter can be added to any logger to format and/or filter its output. 19 | * You can learn more about log formatters here: 20 | * https://github.com/robbiehanson/CocoaLumberjack/wiki/CustomFormatters 21 | * 22 | * You can learn more about logging context's here: 23 | * https://github.com/robbiehanson/CocoaLumberjack/wiki/CustomContext 24 | * 25 | * But here's a quick overview / refresher: 26 | * 27 | * Every log statement has a logging context. 28 | * These come from the underlying logging macros defined in DDLog.h. 29 | * The default logging context is zero. 30 | * You can define multiple logging context's for use in your application. 31 | * For example, logically separate parts of your app each have a different logging context. 32 | * Also 3rd party frameworks that make use of Lumberjack generally use their own dedicated logging context. 33 | **/ 34 | @interface ContextWhitelistFilterLogFormatter : NSObject 35 | 36 | - (id)init; 37 | 38 | - (void)addToWhitelist:(int)loggingContext; 39 | - (void)removeFromWhitelist:(int)loggingContext; 40 | 41 | - (NSArray *)whitelist; 42 | 43 | - (BOOL)isOnWhitelist:(int)loggingContext; 44 | 45 | @end 46 | 47 | //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 48 | #pragma mark - 49 | //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 50 | 51 | /** 52 | * This class provides a log formatter that filters log statements from a logging context on the blacklist. 53 | **/ 54 | @interface ContextBlacklistFilterLogFormatter : NSObject 55 | 56 | - (id)init; 57 | 58 | - (void)addToBlacklist:(int)loggingContext; 59 | - (void)removeFromBlacklist:(int)loggingContext; 60 | 61 | - (NSArray *)blacklist; 62 | 63 | - (BOOL)isOnBlacklist:(int)loggingContext; 64 | 65 | @end 66 | -------------------------------------------------------------------------------- /HomeKitBridge/Lumberjack/Extensions/ContextFilterLogFormatter.m: -------------------------------------------------------------------------------- 1 | #import "ContextFilterLogFormatter.h" 2 | #import 3 | 4 | /** 5 | * Welcome to Cocoa Lumberjack! 6 | * 7 | * The project page has a wealth of documentation if you have any questions. 8 | * https://github.com/robbiehanson/CocoaLumberjack 9 | * 10 | * If you're new to the project you may wish to read the "Getting Started" wiki. 11 | * https://github.com/robbiehanson/CocoaLumberjack/wiki/GettingStarted 12 | **/ 13 | 14 | #if ! __has_feature(objc_arc) 15 | #warning This file must be compiled with ARC. Use -fobjc-arc flag (or convert project to ARC). 16 | #endif 17 | 18 | @interface LoggingContextSet : NSObject 19 | 20 | - (void)addToSet:(int)loggingContext; 21 | - (void)removeFromSet:(int)loggingContext; 22 | 23 | - (NSArray *)currentSet; 24 | 25 | - (BOOL)isInSet:(int)loggingContext; 26 | 27 | @end 28 | 29 | //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 30 | #pragma mark - 31 | //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 32 | 33 | @implementation ContextWhitelistFilterLogFormatter 34 | { 35 | LoggingContextSet *contextSet; 36 | } 37 | 38 | - (id)init 39 | { 40 | if ((self = [super init])) 41 | { 42 | contextSet = [[LoggingContextSet alloc] init]; 43 | } 44 | return self; 45 | } 46 | 47 | 48 | - (void)addToWhitelist:(int)loggingContext 49 | { 50 | [contextSet addToSet:loggingContext]; 51 | } 52 | 53 | - (void)removeFromWhitelist:(int)loggingContext 54 | { 55 | [contextSet removeFromSet:loggingContext]; 56 | } 57 | 58 | - (NSArray *)whitelist 59 | { 60 | return [contextSet currentSet]; 61 | } 62 | 63 | - (BOOL)isOnWhitelist:(int)loggingContext 64 | { 65 | return [contextSet isInSet:loggingContext]; 66 | } 67 | 68 | - (NSString *)formatLogMessage:(DDLogMessage *)logMessage 69 | { 70 | if ([self isOnWhitelist:logMessage->logContext]) 71 | return logMessage->logMsg; 72 | else 73 | return nil; 74 | } 75 | 76 | @end 77 | 78 | //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 79 | #pragma mark - 80 | //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 81 | 82 | @implementation ContextBlacklistFilterLogFormatter 83 | { 84 | LoggingContextSet *contextSet; 85 | } 86 | 87 | - (id)init 88 | { 89 | if ((self = [super init])) 90 | { 91 | contextSet = [[LoggingContextSet alloc] init]; 92 | } 93 | return self; 94 | } 95 | 96 | 97 | - (void)addToBlacklist:(int)loggingContext 98 | { 99 | [contextSet addToSet:loggingContext]; 100 | } 101 | 102 | - (void)removeFromBlacklist:(int)loggingContext 103 | { 104 | [contextSet removeFromSet:loggingContext]; 105 | } 106 | 107 | - (NSArray *)blacklist 108 | { 109 | return [contextSet currentSet]; 110 | } 111 | 112 | - (BOOL)isOnBlacklist:(int)loggingContext 113 | { 114 | return [contextSet isInSet:loggingContext]; 115 | } 116 | 117 | - (NSString *)formatLogMessage:(DDLogMessage *)logMessage 118 | { 119 | if ([self isOnBlacklist:logMessage->logContext]) 120 | return nil; 121 | else 122 | return logMessage->logMsg; 123 | } 124 | 125 | @end 126 | 127 | //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 128 | #pragma mark - 129 | //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 130 | 131 | @implementation LoggingContextSet 132 | { 133 | OSSpinLock lock; 134 | NSMutableSet *set; 135 | } 136 | 137 | - (id)init 138 | { 139 | if ((self = [super init])) 140 | { 141 | set = [[NSMutableSet alloc] init]; 142 | } 143 | return self; 144 | } 145 | 146 | 147 | - (void)addToSet:(int)loggingContext 148 | { 149 | OSSpinLockLock(&lock); 150 | { 151 | [set addObject:@(loggingContext)]; 152 | } 153 | OSSpinLockUnlock(&lock); 154 | } 155 | 156 | - (void)removeFromSet:(int)loggingContext 157 | { 158 | OSSpinLockLock(&lock); 159 | { 160 | [set removeObject:@(loggingContext)]; 161 | } 162 | OSSpinLockUnlock(&lock); 163 | } 164 | 165 | - (NSArray *)currentSet 166 | { 167 | NSArray *result = nil; 168 | 169 | OSSpinLockLock(&lock); 170 | { 171 | result = [set allObjects]; 172 | } 173 | OSSpinLockUnlock(&lock); 174 | 175 | return result; 176 | } 177 | 178 | - (BOOL)isInSet:(int)loggingContext 179 | { 180 | BOOL result = NO; 181 | 182 | OSSpinLockLock(&lock); 183 | { 184 | result = [set containsObject:@(loggingContext)]; 185 | } 186 | OSSpinLockUnlock(&lock); 187 | 188 | return result; 189 | } 190 | 191 | @end 192 | -------------------------------------------------------------------------------- /HomeKitBridge/Lumberjack/Extensions/DispatchQueueLogFormatter.h: -------------------------------------------------------------------------------- 1 | #import 2 | #import 3 | #import "DDLog.h" 4 | 5 | 6 | /** 7 | * Welcome to Cocoa Lumberjack! 8 | * 9 | * The project page has a wealth of documentation if you have any questions. 10 | * https://github.com/robbiehanson/CocoaLumberjack 11 | * 12 | * If you're new to the project you may wish to read the "Getting Started" page. 13 | * https://github.com/robbiehanson/CocoaLumberjack/wiki/GettingStarted 14 | * 15 | * 16 | * This class provides a log formatter that prints the dispatch_queue label instead of the mach_thread_id. 17 | * 18 | * A log formatter can be added to any logger to format and/or filter its output. 19 | * You can learn more about log formatters here: 20 | * https://github.com/robbiehanson/CocoaLumberjack/wiki/CustomFormatters 21 | * 22 | * A typical NSLog (or DDTTYLogger) prints detailed info as [:]. 23 | * For example: 24 | * 25 | * 2011-10-17 20:21:45.435 AppName[19928:5207] Your log message here 26 | * 27 | * Where: 28 | * - 19928 = process id 29 | * - 5207 = thread id (mach_thread_id printed in hex) 30 | * 31 | * When using grand central dispatch (GCD), this information is less useful. 32 | * This is because a single serial dispatch queue may be run on any thread from an internally managed thread pool. 33 | * For example: 34 | * 35 | * 2011-10-17 20:32:31.111 AppName[19954:4d07] Message from my_serial_dispatch_queue 36 | * 2011-10-17 20:32:31.112 AppName[19954:5207] Message from my_serial_dispatch_queue 37 | * 2011-10-17 20:32:31.113 AppName[19954:2c55] Message from my_serial_dispatch_queue 38 | * 39 | * This formatter allows you to replace the standard [box:info] with the dispatch_queue name. 40 | * For example: 41 | * 42 | * 2011-10-17 20:32:31.111 AppName[img-scaling] Message from my_serial_dispatch_queue 43 | * 2011-10-17 20:32:31.112 AppName[img-scaling] Message from my_serial_dispatch_queue 44 | * 2011-10-17 20:32:31.113 AppName[img-scaling] Message from my_serial_dispatch_queue 45 | * 46 | * If the dispatch_queue doesn't have a set name, then it falls back to the thread name. 47 | * If the current thread doesn't have a set name, then it falls back to the mach_thread_id in hex (like normal). 48 | * 49 | * Note: If manually creating your own background threads (via NSThread/alloc/init or NSThread/detachNeThread), 50 | * you can use [[NSThread currentThread] setName:(NSString *)]. 51 | **/ 52 | @interface DispatchQueueLogFormatter : NSObject { 53 | @protected 54 | 55 | NSString *dateFormatString; 56 | } 57 | 58 | /** 59 | * Standard init method. 60 | * Configure using properties as desired. 61 | **/ 62 | - (id)init; 63 | 64 | /** 65 | * The minQueueLength restricts the minimum size of the [detail box]. 66 | * If the minQueueLength is set to 0, there is no restriction. 67 | * 68 | * For example, say a dispatch_queue has a label of "diskIO": 69 | * 70 | * If the minQueueLength is 0: [diskIO] 71 | * If the minQueueLength is 4: [diskIO] 72 | * If the minQueueLength is 5: [diskIO] 73 | * If the minQueueLength is 6: [diskIO] 74 | * If the minQueueLength is 7: [diskIO ] 75 | * If the minQueueLength is 8: [diskIO ] 76 | * 77 | * The default minQueueLength is 0 (no minimum, so [detail box] won't be padded). 78 | * 79 | * If you want every [detail box] to have the exact same width, 80 | * set both minQueueLength and maxQueueLength to the same value. 81 | **/ 82 | @property (assign) NSUInteger minQueueLength; 83 | 84 | /** 85 | * The maxQueueLength restricts the number of characters that will be inside the [detail box]. 86 | * If the maxQueueLength is 0, there is no restriction. 87 | * 88 | * For example, say a dispatch_queue has a label of "diskIO": 89 | * 90 | * If the maxQueueLength is 0: [diskIO] 91 | * If the maxQueueLength is 4: [disk] 92 | * If the maxQueueLength is 5: [diskI] 93 | * If the maxQueueLength is 6: [diskIO] 94 | * If the maxQueueLength is 7: [diskIO] 95 | * If the maxQueueLength is 8: [diskIO] 96 | * 97 | * The default maxQueueLength is 0 (no maximum, so [detail box] won't be truncated). 98 | * 99 | * If you want every [detail box] to have the exact same width, 100 | * set both minQueueLength and maxQueueLength to the same value. 101 | **/ 102 | @property (assign) NSUInteger maxQueueLength; 103 | 104 | /** 105 | * Sometimes queue labels have long names like "com.apple.main-queue", 106 | * but you'd prefer something shorter like simply "main". 107 | * 108 | * This method allows you to set such preferred replacements. 109 | * The above example is set by default. 110 | * 111 | * To remove/undo a previous replacement, invoke this method with nil for the 'shortLabel' parameter. 112 | **/ 113 | - (NSString *)replacementStringForQueueLabel:(NSString *)longLabel; 114 | - (void)setReplacementString:(NSString *)shortLabel forQueueLabel:(NSString *)longLabel; 115 | 116 | @end 117 | -------------------------------------------------------------------------------- /HomeKitBridge/Lumberjack/Extensions/DispatchQueueLogFormatter.m: -------------------------------------------------------------------------------- 1 | #import "DispatchQueueLogFormatter.h" 2 | #import 3 | 4 | /** 5 | * Welcome to Cocoa Lumberjack! 6 | * 7 | * The project page has a wealth of documentation if you have any questions. 8 | * https://github.com/robbiehanson/CocoaLumberjack 9 | * 10 | * If you're new to the project you may wish to read the "Getting Started" wiki. 11 | * https://github.com/robbiehanson/CocoaLumberjack/wiki/GettingStarted 12 | **/ 13 | 14 | #if ! __has_feature(objc_arc) 15 | #warning This file must be compiled with ARC. Use -fobjc-arc flag (or convert project to ARC). 16 | #endif 17 | 18 | 19 | @implementation DispatchQueueLogFormatter 20 | { 21 | int32_t atomicLoggerCount; 22 | NSDateFormatter *threadUnsafeDateFormatter; // Use [self stringFromDate] 23 | 24 | OSSpinLock lock; 25 | 26 | NSUInteger _minQueueLength; // _prefix == Only access via atomic property 27 | NSUInteger _maxQueueLength; // _prefix == Only access via atomic property 28 | NSMutableDictionary *_replacements; // _prefix == Only access from within spinlock 29 | } 30 | 31 | - (id)init 32 | { 33 | if ((self = [super init])) 34 | { 35 | dateFormatString = @"yyyy-MM-dd HH:mm:ss:SSS"; 36 | 37 | atomicLoggerCount = 0; 38 | threadUnsafeDateFormatter = nil; 39 | 40 | _minQueueLength = 0; 41 | _maxQueueLength = 0; 42 | _replacements = [[NSMutableDictionary alloc] init]; 43 | 44 | // Set default replacements: 45 | 46 | [_replacements setObject:@"main" forKey:@"com.apple.main-thread"]; 47 | } 48 | return self; 49 | } 50 | 51 | 52 | //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 53 | #pragma mark Configuration 54 | //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 55 | 56 | @synthesize minQueueLength = _minQueueLength; 57 | @synthesize maxQueueLength = _maxQueueLength; 58 | 59 | - (NSString *)replacementStringForQueueLabel:(NSString *)longLabel 60 | { 61 | NSString *result = nil; 62 | 63 | OSSpinLockLock(&lock); 64 | { 65 | result = [_replacements objectForKey:longLabel]; 66 | } 67 | OSSpinLockUnlock(&lock); 68 | 69 | return result; 70 | } 71 | 72 | - (void)setReplacementString:(NSString *)shortLabel forQueueLabel:(NSString *)longLabel 73 | { 74 | OSSpinLockLock(&lock); 75 | { 76 | if (shortLabel) 77 | [_replacements setObject:shortLabel forKey:longLabel]; 78 | else 79 | [_replacements removeObjectForKey:longLabel]; 80 | } 81 | OSSpinLockUnlock(&lock); 82 | } 83 | 84 | //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 85 | #pragma mark DDLogFormatter 86 | //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 87 | 88 | - (NSString *)stringFromDate:(NSDate *)date 89 | { 90 | int32_t loggerCount = OSAtomicAdd32(0, &atomicLoggerCount); 91 | 92 | if (loggerCount <= 1) 93 | { 94 | // Single-threaded mode. 95 | 96 | if (threadUnsafeDateFormatter == nil) 97 | { 98 | threadUnsafeDateFormatter = [[NSDateFormatter alloc] init]; 99 | [threadUnsafeDateFormatter setFormatterBehavior:NSDateFormatterBehavior10_4]; 100 | [threadUnsafeDateFormatter setDateFormat:dateFormatString]; 101 | } 102 | 103 | return [threadUnsafeDateFormatter stringFromDate:date]; 104 | } 105 | else 106 | { 107 | // Multi-threaded mode. 108 | // NSDateFormatter is NOT thread-safe. 109 | 110 | NSString *key = @"DispatchQueueLogFormatter_NSDateFormatter"; 111 | 112 | NSMutableDictionary *threadDictionary = [[NSThread currentThread] threadDictionary]; 113 | NSDateFormatter *dateFormatter = [threadDictionary objectForKey:key]; 114 | 115 | if (dateFormatter == nil) 116 | { 117 | dateFormatter = [[NSDateFormatter alloc] init]; 118 | [dateFormatter setFormatterBehavior:NSDateFormatterBehavior10_4]; 119 | [dateFormatter setDateFormat:dateFormatString]; 120 | 121 | [threadDictionary setObject:dateFormatter forKey:key]; 122 | } 123 | 124 | return [dateFormatter stringFromDate:date]; 125 | } 126 | } 127 | 128 | - (NSString *)queueThreadLabelForLogMessage:(DDLogMessage *)logMessage 129 | { 130 | // As per the DDLogFormatter contract, this method is always invoked on the same thread/dispatch_queue 131 | 132 | NSUInteger minQueueLength = self.minQueueLength; 133 | NSUInteger maxQueueLength = self.maxQueueLength; 134 | 135 | // Get the name of the queue, thread, or machID (whichever we are to use). 136 | 137 | NSString *queueThreadLabel = nil; 138 | 139 | BOOL useQueueLabel = YES; 140 | BOOL useThreadName = NO; 141 | 142 | if (logMessage->queueLabel) 143 | { 144 | // If you manually create a thread, it's dispatch_queue will have one of the thread names below. 145 | // Since all such threads have the same name, we'd prefer to use the threadName or the machThreadID. 146 | 147 | char *names[] = { "com.apple.root.low-priority", 148 | "com.apple.root.default-priority", 149 | "com.apple.root.high-priority", 150 | "com.apple.root.low-overcommit-priority", 151 | "com.apple.root.default-overcommit-priority", 152 | "com.apple.root.high-overcommit-priority" }; 153 | 154 | int length = sizeof(names) / sizeof(char *); 155 | 156 | int i; 157 | for (i = 0; i < length; i++) 158 | { 159 | if (strcmp(logMessage->queueLabel, names[i]) == 0) 160 | { 161 | useQueueLabel = NO; 162 | useThreadName = [logMessage->threadName length] > 0; 163 | break; 164 | } 165 | } 166 | } 167 | else 168 | { 169 | useQueueLabel = NO; 170 | useThreadName = [logMessage->threadName length] > 0; 171 | } 172 | 173 | if (useQueueLabel || useThreadName) 174 | { 175 | NSString *fullLabel; 176 | NSString *abrvLabel; 177 | 178 | if (useQueueLabel) 179 | fullLabel = @(logMessage->queueLabel); 180 | else 181 | fullLabel = logMessage->threadName; 182 | 183 | OSSpinLockLock(&lock); 184 | { 185 | abrvLabel = [_replacements objectForKey:fullLabel]; 186 | } 187 | OSSpinLockUnlock(&lock); 188 | 189 | if (abrvLabel) 190 | queueThreadLabel = abrvLabel; 191 | else 192 | queueThreadLabel = fullLabel; 193 | } 194 | else 195 | { 196 | queueThreadLabel = [NSString stringWithFormat:@"%x", logMessage->machThreadID]; 197 | } 198 | 199 | // Now use the thread label in the output 200 | 201 | NSUInteger labelLength = [queueThreadLabel length]; 202 | 203 | // labelLength > maxQueueLength : truncate 204 | // labelLength < minQueueLength : padding 205 | // : exact 206 | 207 | if ((maxQueueLength > 0) && (labelLength > maxQueueLength)) 208 | { 209 | // Truncate 210 | 211 | return [queueThreadLabel substringToIndex:maxQueueLength]; 212 | } 213 | else if (labelLength < minQueueLength) 214 | { 215 | // Padding 216 | 217 | NSUInteger numSpaces = minQueueLength - labelLength; 218 | 219 | char spaces[numSpaces + 1]; 220 | memset(spaces, ' ', numSpaces); 221 | spaces[numSpaces] = '\0'; 222 | 223 | return [NSString stringWithFormat:@"%@%s", queueThreadLabel, spaces]; 224 | } 225 | else 226 | { 227 | // Exact 228 | 229 | return queueThreadLabel; 230 | } 231 | } 232 | 233 | - (NSString *)formatLogMessage:(DDLogMessage *)logMessage 234 | { 235 | NSString *timestamp = [self stringFromDate:(logMessage->timestamp)]; 236 | NSString *queueThreadLabel = [self queueThreadLabelForLogMessage:logMessage]; 237 | 238 | return [NSString stringWithFormat:@"%@ [%@] %@", timestamp, queueThreadLabel, logMessage->logMsg]; 239 | } 240 | 241 | - (void)didAddToLogger:(id )logger 242 | { 243 | OSAtomicIncrement32(&atomicLoggerCount); 244 | } 245 | 246 | - (void)willRemoveFromLogger:(id )logger 247 | { 248 | OSAtomicDecrement32(&atomicLoggerCount); 249 | } 250 | 251 | @end 252 | -------------------------------------------------------------------------------- /HomeKitBridge/NSBezierPath+BezierPathQuartzUtilities.h: -------------------------------------------------------------------------------- 1 | // 2 | // NSBezierPath+BezierPathQuartzUtilities.h 3 | // MiniLoader 4 | // 5 | // Created by Khaos Tian on 5/4/14. 6 | // Copyright (c) 2014 Punch Through. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface NSBezierPath (BezierPathQuartzUtilities) 12 | 13 | - (CGPathRef)quartzPath; 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /HomeKitBridge/NSBezierPath+BezierPathQuartzUtilities.m: -------------------------------------------------------------------------------- 1 | // 2 | // NSBezierPath+BezierPathQuartzUtilities.m 3 | // MiniLoader 4 | // 5 | // Created by Khaos Tian on 5/4/14. 6 | // Copyright (c) 2014 Punch Through. All rights reserved. 7 | // 8 | 9 | #import "NSBezierPath+BezierPathQuartzUtilities.h" 10 | 11 | @implementation NSBezierPath (BezierPathQuartzUtilities) 12 | 13 | - (CGPathRef)quartzPath 14 | { 15 | NSInteger i, numElements; 16 | 17 | // Need to begin a path here. 18 | CGPathRef immutablePath = NULL; 19 | 20 | // Then draw the path elements. 21 | numElements = [self elementCount]; 22 | if (numElements > 0) 23 | { 24 | CGMutablePathRef path = CGPathCreateMutable(); 25 | NSPoint points[3]; 26 | BOOL didClosePath = YES; 27 | 28 | for (i = 0; i < numElements; i++) 29 | { 30 | switch ([self elementAtIndex:i associatedPoints:points]) 31 | { 32 | case NSMoveToBezierPathElement: 33 | CGPathMoveToPoint(path, NULL, points[0].x, points[0].y); 34 | break; 35 | 36 | case NSLineToBezierPathElement: 37 | CGPathAddLineToPoint(path, NULL, points[0].x, points[0].y); 38 | didClosePath = NO; 39 | break; 40 | 41 | case NSCurveToBezierPathElement: 42 | CGPathAddCurveToPoint(path, NULL, points[0].x, points[0].y, 43 | points[1].x, points[1].y, 44 | points[2].x, points[2].y); 45 | didClosePath = NO; 46 | break; 47 | 48 | case NSClosePathBezierPathElement: 49 | CGPathCloseSubpath(path); 50 | didClosePath = YES; 51 | break; 52 | } 53 | } 54 | 55 | // Be sure the path is closed or Quartz may not do valid hit detection. 56 | if (!didClosePath) 57 | CGPathCloseSubpath(path); 58 | 59 | immutablePath = CGPathCreateCopy(path); 60 | CGPathRelease(path); 61 | } 62 | 63 | return immutablePath; 64 | } 65 | 66 | @end 67 | -------------------------------------------------------------------------------- /HomeKitBridge/NSData-Enumeration.h: -------------------------------------------------------------------------------- 1 | // 2 | // Generated by class-dump 3.5 (64 bit). 3 | // 4 | // class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2013 by Steve Nygard. 5 | // 6 | 7 | #import "NSData.h" 8 | 9 | @interface NSData (Enumeration) 10 | - (void)enumerateBytesUsingBlock:(CDUnknownBlockType)arg1; 11 | @end 12 | 13 | -------------------------------------------------------------------------------- /HomeKitBridge/NSData-HAKChaChaPoly.h: -------------------------------------------------------------------------------- 1 | // 2 | // Generated by class-dump 3.5 (64 bit). 3 | // 4 | // class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2013 by Steve Nygard. 5 | // 6 | 7 | #import "NSData.h" 8 | 9 | @interface NSData (HAKChaChaPoly) 10 | + (id)dataWithUint64:(unsigned long long)arg1; 11 | + (id)dataWithUint32:(unsigned int)arg1; 12 | + (id)dataWithUint16:(unsigned short)arg1; 13 | - (unsigned long long)uint64Value; 14 | - (unsigned int)uint32Value; 15 | - (unsigned short)uint16Value; 16 | - (id)initWithUint64:(unsigned long long)arg1; 17 | - (id)initWithUint32:(unsigned int)arg1; 18 | - (id)initWithUint16:(unsigned short)arg1; 19 | @end 20 | 21 | -------------------------------------------------------------------------------- /HomeKitBridge/NSDictionary-HAK.h: -------------------------------------------------------------------------------- 1 | // 2 | // Generated by class-dump 3.5 (64 bit). 3 | // 4 | // class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2013 by Steve Nygard. 5 | // 6 | 7 | #import "NSDictionary.h" 8 | 9 | @interface NSDictionary (HAK) 10 | - (BOOL)containsKey:(id)arg1; 11 | @end 12 | 13 | -------------------------------------------------------------------------------- /HomeKitBridge/NSDictionary-Safe.h: -------------------------------------------------------------------------------- 1 | // 2 | // Generated by class-dump 3.5 (64 bit). 3 | // 4 | // class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2013 by Steve Nygard. 5 | // 6 | 7 | #import "NSDictionary.h" 8 | 9 | @interface NSDictionary (Safe) 10 | - (id)_objectForKey:(id)arg1 class:(Class)arg2; 11 | - (id)stringForKey:(id)arg1; 12 | - (id)numberForKey:(id)arg1; 13 | - (id)dictionaryForKey:(id)arg1; 14 | - (id)arrayForKey:(id)arg1; 15 | @end 16 | 17 | -------------------------------------------------------------------------------- /HomeKitBridge/NSError-HAKError.h: -------------------------------------------------------------------------------- 1 | // 2 | // Generated by class-dump 3.5 (64 bit). 3 | // 4 | // class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2013 by Steve Nygard. 5 | // 6 | 7 | #import "NSError.h" 8 | 9 | @interface NSError (HAKError) 10 | + (id)errorWithCode:(long long)arg1 description:(id)arg2 suggestion:(id)arg3; 11 | + (id)errorWithCode:(long long)arg1 description:(id)arg2; 12 | @end 13 | 14 | -------------------------------------------------------------------------------- /HomeKitBridge/NSFileManager-HAK.h: -------------------------------------------------------------------------------- 1 | // 2 | // Generated by class-dump 3.5 (64 bit). 3 | // 4 | // class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2013 by Steve Nygard. 5 | // 6 | 7 | #import "NSFileManager.h" 8 | 9 | @interface NSFileManager (HAK) 10 | - (id)fileModificationDateForURL:(id)arg1 error:(id *)arg2; 11 | - (id)fileSizeForURL:(id)arg1 options:(unsigned long long)arg2 error:(id *)arg3; 12 | @end 13 | 14 | -------------------------------------------------------------------------------- /HomeKitBridge/NSMapTable-HAK.h: -------------------------------------------------------------------------------- 1 | // 2 | // Generated by class-dump 3.5 (64 bit). 3 | // 4 | // class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2013 by Steve Nygard. 5 | // 6 | 7 | #import "NSMapTable.h" 8 | 9 | @interface NSMapTable (HAK) 10 | - (BOOL)containsObject:(id)arg1; 11 | - (void)enumerateKeysAndObjectsUsingBlock:(CDUnknownBlockType)arg1; 12 | @end 13 | 14 | -------------------------------------------------------------------------------- /HomeKitBridge/NSNumber-HAK.h: -------------------------------------------------------------------------------- 1 | // 2 | // Generated by class-dump 3.5 (64 bit). 3 | // 4 | // class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2013 by Steve Nygard. 5 | // 6 | 7 | #import "NSNumber.h" 8 | 9 | @interface NSNumber (HAK) 10 | - (id)numberByDecrementing; 11 | - (id)numberByIncrementing; 12 | @end 13 | 14 | -------------------------------------------------------------------------------- /HomeKitBridge/NSString-NSData.h: -------------------------------------------------------------------------------- 1 | // 2 | // Generated by class-dump 3.5 (64 bit). 3 | // 4 | // class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2013 by Steve Nygard. 5 | // 6 | 7 | #import "NSString.h" 8 | 9 | @interface NSString (NSData) 10 | - (id)hexStringToData; 11 | @end 12 | 13 | -------------------------------------------------------------------------------- /HomeKitBridge/NSURL-Query.h: -------------------------------------------------------------------------------- 1 | // 2 | // Generated by class-dump 3.5 (64 bit). 3 | // 4 | // class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2013 by Steve Nygard. 5 | // 6 | 7 | #import "NSURL.h" 8 | 9 | @interface NSURL (Query) 10 | - (id)queryDictionary; 11 | @end 12 | 13 | -------------------------------------------------------------------------------- /HomeKitBridge/NSUserDefaults-HAK.h: -------------------------------------------------------------------------------- 1 | // 2 | // Generated by class-dump 3.5 (64 bit). 3 | // 4 | // class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2013 by Steve Nygard. 5 | // 6 | 7 | #import "NSUserDefaults.h" 8 | 9 | @interface NSUserDefaults (HAK) 10 | + (id)defaultFrameworkDomain; 11 | @end 12 | 13 | -------------------------------------------------------------------------------- /HomeKitBridge/OTIContainerView.h: -------------------------------------------------------------------------------- 1 | // 2 | // OTIContainerView.h 3 | // HomeKitBridge 4 | // 5 | // Created by Khaos Tian on 7/18/14. 6 | // Copyright (c) 2014 Oltica. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface OTIContainerView : NSView 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /HomeKitBridge/OTIContainerView.m: -------------------------------------------------------------------------------- 1 | // 2 | // OTIContainerView.m 3 | // HomeKitBridge 4 | // 5 | // Created by Khaos Tian on 7/18/14. 6 | // Copyright (c) 2014 Oltica. All rights reserved. 7 | // 8 | 9 | #import "OTIContainerView.h" 10 | 11 | @implementation OTIContainerView 12 | 13 | - (id)initWithFrame:(NSRect)frame 14 | { 15 | self = [super initWithFrame:frame]; 16 | if (self) { 17 | // Initialization code here. 18 | } 19 | return self; 20 | } 21 | 22 | - (void)drawRect:(NSRect)rect { 23 | 24 | // Clear the drawing rect. 25 | [[NSColor clearColor] set]; 26 | NSRectFill([self frame]); 27 | 28 | NSBezierPath* roundedRectanglePath = [NSBezierPath bezierPathWithRoundedRect: rect xRadius: 4 yRadius: 4]; 29 | [[NSColor whiteColor] setFill]; 30 | [roundedRectanglePath fill]; 31 | } 32 | 33 | @end 34 | -------------------------------------------------------------------------------- /HomeKitBridge/OTIContentController.h: -------------------------------------------------------------------------------- 1 | // 2 | // OTIContentController.h 3 | // HomeKitBridge 4 | // 5 | // Created by Khaos Tian on 7/18/14. 6 | // Copyright (c) 2014 Oltica. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "HAKServiceDelegate.h" 11 | 12 | @interface OTIContentController : NSObject 13 | 14 | @property (nonatomic,weak) NSView *view; 15 | 16 | @end 17 | -------------------------------------------------------------------------------- /HomeKitBridge/OTIContentController.m: -------------------------------------------------------------------------------- 1 | // 2 | // OTIContentController.m 3 | // HomeKitBridge 4 | // 5 | // Created by Khaos Tian on 7/18/14. 6 | // Copyright (c) 2014 Oltica. All rights reserved. 7 | // 8 | 9 | #import "OTIContentController.h" 10 | #import "NSBezierPath+BezierPathQuartzUtilities.h" 11 | #import 12 | 13 | #import "HAKIdentifyCharacteristic.h" 14 | 15 | #import 16 | 17 | @interface OTIContentController () { 18 | 19 | } 20 | 21 | @end 22 | 23 | @implementation OTIContentController 24 | 25 | - (id)init { 26 | self = [super init]; 27 | 28 | if (self) { 29 | [[NSNotificationCenter defaultCenter]addObserver:self selector:@selector(characteristicDidUpdateValueNotification:) name:@"HAKCharacteristicDidUpdateValueNotification" object:nil]; 30 | 31 | [[PHNotificationManager defaultManager] registerObject:self withSelector:@selector(authenticationSuccess) forNotification:PUSHLINK_LOCAL_AUTHENTICATION_SUCCESS_NOTIFICATION]; 32 | [[PHNotificationManager defaultManager] registerObject:self withSelector:@selector(buttonNotPressed:) forNotification:PUSHLINK_BUTTON_NOT_PRESSED_NOTIFICATION]; 33 | } 34 | 35 | return self; 36 | } 37 | 38 | - (void)authenticationSuccess { 39 | [[PHNotificationManager defaultManager] deregisterObjectForAllNotifications:self]; 40 | } 41 | 42 | - (void)buttonNotPressed:(NSNotification *)notification { 43 | NSLog(@"Press the button on the bridge to finish the setup."); 44 | } 45 | 46 | - (void)addIdentifyAnimation 47 | { 48 | CGFloat radius = 300; 49 | 50 | NSBezierPath *ovalPath = [NSBezierPath bezierPathWithOvalInRect:CGRectMake((radius/2)*(-1), (radius/2)*(-1), radius, radius)]; 51 | 52 | CAShapeLayer *backgroundShape = [[CAShapeLayer alloc]init]; 53 | backgroundShape.path = ovalPath.quartzPath; 54 | backgroundShape.position = CGPointMake(self.view.frame.size.width / 2.0,self.view.frame.size.height / 2.0); 55 | 56 | backgroundShape.fillColor = [NSColor clearColor].CGColor; 57 | backgroundShape.strokeColor = [NSColor colorWithHue:0.552 saturation:0.78 brightness:0.99 alpha:1.0].CGColor; 58 | 59 | 60 | CAMediaTimingFunction *defaultCurve = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionDefault]; 61 | 62 | CAAnimationGroup *animationGroup = [CAAnimationGroup animation]; 63 | animationGroup.duration = 1; 64 | animationGroup.repeatCount = 3; 65 | animationGroup.removedOnCompletion = YES; 66 | animationGroup.timingFunction = defaultCurve; 67 | 68 | CABasicAnimation *scaleAnimation = [CABasicAnimation animationWithKeyPath:@"transform.scale.xy"]; 69 | scaleAnimation.fromValue = @0.0; 70 | scaleAnimation.toValue = @1.0; 71 | scaleAnimation.duration = 1; 72 | 73 | CAKeyframeAnimation *opacityAnimation = [CAKeyframeAnimation animationWithKeyPath:@"opacity"]; 74 | opacityAnimation.duration = 1; 75 | opacityAnimation.values = @[@1.0, @0.85, @0.45, @0]; 76 | opacityAnimation.keyTimes = @[@0, @0.6, @0.8, @1]; 77 | opacityAnimation.removedOnCompletion = YES; 78 | 79 | NSArray *animations = @[scaleAnimation, opacityAnimation]; 80 | animationGroup.animations = animations; 81 | animationGroup.delegate = self; 82 | 83 | [self.view.layer addSublayer:backgroundShape]; 84 | [backgroundShape addAnimation:animationGroup forKey:@"ZoomOutScan"]; 85 | } 86 | 87 | - (void)characteristicDidUpdateValueNotification:(NSNotification *)aNote { 88 | HAKCharacteristic *characteristic = aNote.object; 89 | if ([characteristic isKindOfClass:[HAKIdentifyCharacteristic class]]) { 90 | id value = aNote.userInfo[@"HAKCharacteristicValueKey"]; 91 | if ([value isKindOfClass:[NSNumber class]]) { 92 | if ([value isEqualToNumber: @1]) { 93 | dispatch_async(dispatch_get_main_queue(), ^{ 94 | [self addIdentifyAnimation]; 95 | }); 96 | } 97 | } 98 | } 99 | } 100 | 101 | - (void)animationDidStop:(CAAnimation *)anim finished:(BOOL)flag { 102 | self.view.layer.sublayers = nil; 103 | } 104 | 105 | @end 106 | -------------------------------------------------------------------------------- /HomeKitBridge/OTIHAPCore.h: -------------------------------------------------------------------------------- 1 | // 2 | // OTIHAPCore.h 3 | // HomeKitBridge 4 | // 5 | // Created by Khaos Tian on 7/18/14. 6 | // Copyright (c) 2014 Oltica. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "OTIContentController.h" 11 | 12 | @class HAKAccessory; 13 | 14 | @interface OTIHAPCore : NSObject 15 | 16 | - (id)initAsBridge:(BOOL)isBridge; 17 | - (void)startTransport; 18 | - (void)resetTransportPairings; 19 | - (HAKAccessory *)addAccessory:(HAKAccessory *)accessory; 20 | - (HAKAccessory *)createHueAccessoryWithUUID:(NSString *)uuid Name:(NSString *)name; 21 | - (NSString *)password; 22 | 23 | @end 24 | -------------------------------------------------------------------------------- /HomeKitBridge/OTIHAPCore.m: -------------------------------------------------------------------------------- 1 | // 2 | // OTIHAPCore.m 3 | // HomeKitBridge 4 | // 5 | // Created by Khaos Tian on 7/18/14. 6 | // Copyright (c) 2014 Oltica. All rights reserved. 7 | // 8 | 9 | #import "OTIHAPCore.h" 10 | 11 | #import "HAKIPTransport.h" 12 | #import "HAKAccessory.h" 13 | 14 | #import "HAKAccessoryInformationService.h" 15 | #import "HAKService.h" 16 | #import "HAKCharacteristic.h" 17 | #import "HAKUUID.h" 18 | 19 | @interface OTIHAPCore (){ 20 | BOOL _isBridge; 21 | } 22 | 23 | @property (strong,nonatomic) HAKIPTransport *bridgeTransport; 24 | @property (strong,nonatomic) NSMutableDictionary *accessories; 25 | 26 | @end 27 | 28 | @implementation OTIHAPCore 29 | 30 | - (id)init { 31 | self = [super init]; 32 | 33 | if (self) { 34 | _accessories = [NSMutableDictionary dictionary]; 35 | NSFileManager *fileManager = [NSFileManager defaultManager]; 36 | 37 | if ([fileManager fileExistsAtPath:[[self homeDataPath] path]]) 38 | { 39 | _bridgeTransport = [NSKeyedUnarchiver unarchiveObjectWithFile:[[self homeDataPath] path]]; 40 | if (_bridgeTransport) { 41 | NSLog(@"Find Transport"); 42 | for (HAKAccessory *accessory in _bridgeTransport.accessories) { 43 | [_accessories setObject:accessory forKey:accessory.serialNumber]; 44 | } 45 | } 46 | }else{ 47 | [self setupHAP]; 48 | } 49 | } 50 | 51 | return self; 52 | } 53 | 54 | - (NSURL *)homeDataPath { 55 | NSFileManager *fileManager = [NSFileManager defaultManager]; 56 | NSURL *appSupportDir = [[NSFileManager defaultManager] URLForDirectory:NSApplicationSupportDirectory inDomain:NSUserDomainMask appropriateForURL:nil create:YES error:nil]; 57 | appSupportDir = [appSupportDir URLByAppendingPathComponent:@"org.oltica.HomeKitBridge"]; 58 | 59 | if ([fileManager fileExistsAtPath:[appSupportDir path]] == NO) 60 | { 61 | [fileManager createDirectoryAtPath:[appSupportDir path] withIntermediateDirectories:NO attributes:nil error:nil]; 62 | } 63 | 64 | return [appSupportDir URLByAppendingPathComponent:@"HomeDataV2.plist"]; 65 | } 66 | 67 | - (id)initAsBridge:(BOOL)isBridge { 68 | self = [self init]; 69 | 70 | if (isBridge) { 71 | _isBridge = true; 72 | [self setupBridgeAccessory]; 73 | } 74 | 75 | return self; 76 | } 77 | 78 | - (void)startTransport { 79 | [_bridgeTransport start]; 80 | } 81 | 82 | - (void)resetTransportPairings { 83 | [_bridgeTransport removeAllPairings]; 84 | [_bridgeTransport removeAllConnections]; 85 | } 86 | 87 | - (void)setupHAP { 88 | _bridgeTransport = [[HAKIPTransport alloc] init]; 89 | 90 | NSLog(@"Finished. Password:%@", _bridgeTransport.password); 91 | } 92 | 93 | - (void)setupBridgeAccessory { 94 | HAKAccessory *bridgeAccessory = [[HAKAccessory alloc] init]; 95 | bridgeAccessory.name = @"Hue Bridge"; 96 | bridgeAccessory.manufacturer = @"Philips"; 97 | bridgeAccessory.serialNumber = @"F7B47CD5EA72"; 98 | bridgeAccessory.model = @"Hue Bridge"; 99 | 100 | [self addAccessory:bridgeAccessory]; 101 | } 102 | 103 | - (HAKAccessory *)addAccessory:(HAKAccessory *)accessory { 104 | NSLog(@"Add accessory:%@",accessory); 105 | if (!accessory) { 106 | return nil; 107 | } 108 | 109 | if (_accessories[accessory.serialNumber] != nil) { 110 | return _accessories[accessory.serialNumber]; 111 | } 112 | 113 | _accessories[accessory.serialNumber] = accessory; 114 | 115 | [_bridgeTransport addAccessory:accessory]; 116 | 117 | [NSKeyedArchiver archiveRootObject:_bridgeTransport toFile:[[self homeDataPath] path]]; 118 | 119 | return accessory; 120 | } 121 | 122 | - (HAKAccessory *)createHueAccessoryWithUUID:(NSString *)uuid Name:(NSString *)name { 123 | NSLog(@"Init Accessory With UUID:%@, name:%@",uuid,name); 124 | HAKAccessory *hueAccessory = [[HAKAccessory alloc]init]; 125 | hueAccessory.name = name; 126 | hueAccessory.serialNumber = uuid; 127 | hueAccessory.manufacturer = @"Philips"; 128 | hueAccessory.model = @"Hue 01"; 129 | 130 | [hueAccessory addService:[self setupLightService]]; 131 | 132 | return hueAccessory; 133 | } 134 | 135 | - (HAKService *)setupLightService { 136 | HAKService* lightService = [[HAKService alloc] initWithType:[[HAKUUID alloc] initWithUUIDString:@"00000043"] name:@"Light Control"]; 137 | 138 | HAKCharacteristic* powerCharacteristic = [lightService characteristicWithType:[[HAKUUID alloc] initWithUUIDString:@"00000025"]]; 139 | HAKCharacteristic* saturationCharacteristic = [[HAKCharacteristic alloc] initWithType:[[HAKUUID alloc] initWithUUIDString:@"0000002F"]]; 140 | HAKCharacteristic* hueCharacteristic = [[HAKCharacteristic alloc] initWithType:[[HAKUUID alloc] initWithUUIDString:@"00000013"]]; 141 | HAKCharacteristic* brightnessCharacteristic = [[HAKCharacteristic alloc] initWithType:[[HAKUUID alloc] initWithUUIDString:@"00000008"]]; 142 | 143 | powerCharacteristic.value = @0; 144 | saturationCharacteristic.value = @0; 145 | hueCharacteristic.value = @0; 146 | brightnessCharacteristic.value = @0; 147 | 148 | [lightService addCharacteristic:hueCharacteristic]; 149 | [lightService addCharacteristic:brightnessCharacteristic]; 150 | [lightService addCharacteristic:saturationCharacteristic]; 151 | 152 | return lightService; 153 | } 154 | 155 | - (NSString *)password { 156 | return _bridgeTransport.password; 157 | } 158 | 159 | @end 160 | -------------------------------------------------------------------------------- /HomeKitBridge/OTIWindow.h: -------------------------------------------------------------------------------- 1 | // 2 | // OTIWindow.h 3 | // HomeKitBridge 4 | // 5 | // Created by Khaos Tian on 7/18/14. 6 | // Copyright (c) 2014 Oltica. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface OTIWindow : NSWindow 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /HomeKitBridge/OTIWindow.m: -------------------------------------------------------------------------------- 1 | // 2 | // OTIWindow.m 3 | // HomeKitBridge 4 | // 5 | // Created by Khaos Tian on 7/18/14. 6 | // Copyright (c) 2014 Oltica. All rights reserved. 7 | // 8 | 9 | #import "OTIWindow.h" 10 | 11 | @interface OTIWindow (){ 12 | NSPoint initialLocation; 13 | } 14 | 15 | @property (assign) NSPoint initialLocation; 16 | 17 | @end 18 | 19 | @implementation OTIWindow 20 | 21 | @synthesize initialLocation; 22 | 23 | - (id)initWithContentRect:(NSRect)contentRect 24 | styleMask:(NSUInteger)aStyle 25 | backing:(NSBackingStoreType)bufferingType 26 | defer:(BOOL)flag { 27 | 28 | // Using NSBorderlessWindowMask results in a window without a title bar. 29 | self = [super initWithContentRect:contentRect styleMask:NSBorderlessWindowMask backing:NSBackingStoreBuffered defer:NO]; 30 | if (self != nil) { 31 | // Start with no transparency for all drawing into the window 32 | [self setAlphaValue:1.0]; 33 | // Turn off opacity so that the parts of the window that are not drawn into are transparent. 34 | [self setOpaque:NO]; 35 | } 36 | return self; 37 | } 38 | 39 | - (BOOL)canBecomeKeyWindow { 40 | 41 | return YES; 42 | } 43 | 44 | - (void)mouseDown:(NSEvent *)theEvent { 45 | 46 | // Get the mouse location in window coordinates. 47 | self.initialLocation = [theEvent locationInWindow]; 48 | } 49 | 50 | - (void)mouseDragged:(NSEvent *)theEvent { 51 | 52 | NSRect screenVisibleFrame = [[NSScreen mainScreen] visibleFrame]; 53 | NSRect windowFrame = [self frame]; 54 | NSPoint newOrigin = windowFrame.origin; 55 | 56 | // Get the mouse location in window coordinates. 57 | NSPoint currentLocation = [theEvent locationInWindow]; 58 | // Update the origin with the difference between the new mouse location and the old mouse location. 59 | newOrigin.x += (currentLocation.x - initialLocation.x); 60 | newOrigin.y += (currentLocation.y - initialLocation.y); 61 | 62 | // Don't let window get dragged up under the menu bar 63 | if ((newOrigin.y + windowFrame.size.height) > (screenVisibleFrame.origin.y + screenVisibleFrame.size.height)) { 64 | newOrigin.y = screenVisibleFrame.origin.y + (screenVisibleFrame.size.height - windowFrame.size.height); 65 | } 66 | 67 | // Move the window to the new location 68 | [self setFrameOrigin:newOrigin]; 69 | } 70 | 71 | @end 72 | -------------------------------------------------------------------------------- /HomeKitBridge/SimpleHue.h: -------------------------------------------------------------------------------- 1 | // 2 | // SimpleHue.h 3 | // HomeKitBridge 4 | // 5 | // Created by Khaos Tian on 7/18/14. 6 | // Copyright (c) 2014 Oltica. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "OTIHAPCore.h" 11 | 12 | @interface SimpleHue : NSObject 13 | 14 | @property (nonatomic,weak) OTIHAPCore *accessoryCore; 15 | 16 | - (void)startSearch; 17 | 18 | @end 19 | -------------------------------------------------------------------------------- /HomeKitBridge/SimpleHue.m: -------------------------------------------------------------------------------- 1 | // 2 | // SimpleHue.m 3 | // HomeKitBridge 4 | // 5 | // Created by Khaos Tian on 7/18/14. 6 | // Copyright (c) 2014 Oltica. All rights reserved. 7 | // 8 | 9 | #import "SimpleHue.h" 10 | 11 | #import 12 | #import 13 | 14 | #import "HueLight.h" 15 | 16 | @interface SimpleHue () { 17 | PHBridgeSearching *_searchingObject; 18 | PHHueSDK *_hueCentral; 19 | 20 | NSString *_hueIP; 21 | NSString *_hueMAC; 22 | 23 | BOOL _hasSetup; 24 | 25 | NSMutableDictionary *_lights; 26 | } 27 | 28 | @end 29 | 30 | @implementation SimpleHue 31 | 32 | - (id)init { 33 | self = [super init]; 34 | if (self) { 35 | _hasSetup = NO; 36 | _lights = [NSMutableDictionary dictionary]; 37 | _hueCentral = [[PHHueSDK alloc]init]; 38 | [_hueCentral startUpSDK]; 39 | 40 | [[PHNotificationManager defaultManager] registerObject:self withSelector:@selector(localConnection) forNotification:LOCAL_CONNECTION_NOTIFICATION]; 41 | [[PHNotificationManager defaultManager] registerObject:self withSelector:@selector(noLocalConnection) forNotification:NO_LOCAL_CONNECTION_NOTIFICATION]; 42 | [[PHNotificationManager defaultManager] registerObject:self withSelector:@selector(notAuthenticated) forNotification:NO_LOCAL_AUTHENTICATION_NOTIFICATION]; 43 | [[PHNotificationManager defaultManager] registerObject:self withSelector:@selector(authenticationSuccess) forNotification:PUSHLINK_LOCAL_AUTHENTICATION_SUCCESS_NOTIFICATION]; 44 | [[PHNotificationManager defaultManager] registerObject:self withSelector:@selector(authenticationFailed) forNotification:PUSHLINK_LOCAL_AUTHENTICATION_FAILED_NOTIFICATION]; 45 | 46 | [self enableLocalHeartbeat]; 47 | } 48 | return self; 49 | } 50 | 51 | - (void)localConnection { 52 | [self updateLights]; 53 | } 54 | 55 | - (void)noLocalConnection { 56 | NSLog(@"No Local Connection"); 57 | } 58 | 59 | - (void)notAuthenticated { 60 | NSLog(@"Not Authenticated"); 61 | [self doAuthentication]; 62 | } 63 | 64 | - (void)authenticationSuccess { 65 | NSLog(@"Authentication Success!"); 66 | [self setupLights]; 67 | [self performSelector:@selector(enableLocalHeartbeat) withObject:nil afterDelay:1]; 68 | } 69 | 70 | - (void)authenticationFailed { 71 | NSLog(@"Authentication Failed"); 72 | } 73 | 74 | - (void)updateLights { 75 | if (!_hasSetup) { 76 | _hasSetup = YES; 77 | [self setupLights]; 78 | }else{ 79 | for (PHLight *light in [PHBridgeResourcesReader readBridgeResourcesCache].lights.allValues) { 80 | HueLight *huelight = _lights[light.name]; 81 | [huelight updateLightValueWithLight:light]; 82 | } 83 | } 84 | } 85 | 86 | - (void)setupLights { 87 | for (PHLight *light in [PHBridgeResourcesReader readBridgeResourcesCache].lights.allValues) { 88 | HueLight *huelight = [[HueLight alloc]initWithHAPCore:_accessoryCore HueLight:light]; 89 | [_lights setObject:huelight forKey:light.name]; 90 | } 91 | } 92 | 93 | - (void)startSearch { 94 | _searchingObject = [[PHBridgeSearching alloc] initWithUpnpSearch:YES andPortalSearch:YES andIpAdressSearch:YES]; 95 | [_searchingObject startSearchWithCompletionHandler:^(NSDictionary *bridgesFound) { 96 | if (bridgesFound.count > 0) { 97 | NSLog(@"Bridges Found:%@",bridgesFound); 98 | NSString *macAddress = bridgesFound.allKeys.firstObject; 99 | [self setBridgeWithIP:bridgesFound[macAddress] andMAC:macAddress]; 100 | }else{ 101 | NSLog(@"No bridges found"); 102 | } 103 | }]; 104 | } 105 | 106 | - (void)enableLocalHeartbeat { 107 | /*************************************************** 108 | The heartbeat processing collects data from the bridge 109 | so now try to see if we have a bridge already connected 110 | *****************************************************/ 111 | 112 | PHBridgeResourcesCache *cache = [PHBridgeResourcesReader readBridgeResourcesCache]; 113 | if (cache != nil && cache.bridgeConfiguration != nil && cache.bridgeConfiguration.ipaddress != nil) { 114 | 115 | // Enable heartbeat with interval of 3 seconds 116 | [_hueCentral enableLocalConnectionUsingInterval:3]; 117 | } else { 118 | // Automaticly start searching for bridges 119 | [self startSearch]; 120 | } 121 | } 122 | 123 | - (void)doAuthentication { 124 | // Disable heartbeats 125 | [_hueCentral disableLocalConnection]; 126 | [_hueCentral startPushlinkAuthentication]; 127 | } 128 | 129 | - (void)setBridgeWithIP:(NSString *)ipAddress andMAC:(NSString *)macAddress { 130 | if (ipAddress && macAddress) { 131 | _hueIP = [ipAddress copy]; 132 | _hueMAC = [macAddress copy]; 133 | [_hueCentral setBridgeToUseWithIpAddress:_hueIP macAddress:_hueMAC]; 134 | } 135 | } 136 | 137 | @end 138 | -------------------------------------------------------------------------------- /HomeKitBridge/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // HomeKitBridge 4 | // 5 | // Created by Khaos Tian on 7/18/14. 6 | // Copyright (c) 2014 Oltica. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | int main(int argc, const char * argv[]) { 12 | return NSApplicationMain(argc, argv); 13 | } 14 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | HomeKitBridge 2 | ============= 3 | HomeKit Bridge is a project that allows app developers test their HomeKit app with real hardware using Mac as a relay to communicate with accessory that doesn't support HomeKit protocol. 4 | 5 | This project uses Apple's private framework "HAPAccessoryKit" which comes with HomeKit Accessory Simulator. 6 | 7 | **You will need to put HomeKit Accessory Simulator.app under /Applications/ to build this project. (It comes with Hardware IO Tools which you can find from [here](https://developer.apple.com/downloads/index.action))** 8 | 9 | Currently the project only supports Philips Hue Light. 10 | 11 | [Here](http://instagram.com/p/qnIxZGjkiN/) is a video demo. 12 | --------------------------------------------------------------------------------