2015-04-01 271 views
0

我使用HUE-Emulator查看更改。模拟器正在运行port 80如何打开和关闭飞利浦HUE灯

目前我只能查看使用浏览器的细节。(API调用)

现在我想关掉,用我的app.But我的代码没有检测到桥梁上的灯开关。我没有使用任何物理设备。我正在模拟器中运行我的应用程序。

代码我使用发现桥梁

- (void)viewDidLoad { 
[super viewDidLoad]; 

self.phHueSDK = [[PHHueSDK alloc] init]; 

[self.phHueSDK enableLogging:YES]; 

// Call startUpSDK which will initialize the SDK 
[self.phHueSDK startUpSDK]; 

self.bridgeSearch = [[PHBridgeSearching alloc] initWithUpnpSearch:YES andPortalSearch:YES]; 

// Start search for bridges 
[self.bridgeSearch startSearchWithCompletionHandler:^(NSDictionary *bridgesFound) { 

    NSLog(@"sadsdsa %@",bridgesFound); //Logs Null 
}]; 

} 

链接到屏幕我的模拟器截图显示一切正常。

Screenshot

配置我越来越:

http://pastebin.com/wzreYSng

+0

请打开'http:// localhost:8000/api/newdeveloper'后更新配置问题 – ZeMoon 2015-04-01 10:53:21

+0

@ZeMoon我更新了我的问题 – Dalvik 2015-04-01 11:50:10

回答

0

如果你读从色调模拟器的文档,你会发现,BridgeSearch只会工作,当桥模拟器是在端口80上运行。

您发布的配置中的相关部分如下:

"config":{ 
     "portalservices":false, 
     "gateway":"192.168.2.1", 
     "mac":"00:00:88:00:bb:ee", 
     "swversion":1005215, 
     "linkbutton":false, 
     "ipaddress":"192.168.2.13:8000", 
     "proxyport":0, 
     "swupdate":{ 
     "text":"", 
     "notify":false, 
     "updatestate":0, 
     "url":"" 
     } 

您可以直接连接到使用的代码桥模拟器:

[self.phHueSDK setBridgeToUseWithIpAddress:@"192.168.2.13:8000" macAddress:@"00:00:88:00:bb:ee"]; 

我建议你下载由PhilipsHue提供的sample iOS application和尝试。

+0

我试过这个......此后,当我搜索桥使用PHBridgeSearching我得到空词典 – Dalvik 2015-04-01 12:09:30

+0

我也使用了示例应用程序..示例应用程序无法找到桥 – Dalvik 2015-04-01 12:10:09

+0

尝试将模拟器应用程序上的端口号更改为80. – ZeMoon 2015-04-01 12:10:39