-
Notifications
You must be signed in to change notification settings - Fork 212
Handling multiple bridges #16
Comments
Hi, For apps that require multi-bridge support the responsibility lies with the developer on handling the correct bridge. I have just written a little paragraph in our Java SDK documentation on how it can be done and the main things you will need to consider. http://www.developers.meethue.com/documentation/java-sdk-getting-started#multiBridgeSupport I will close the issue, but if you have any questions then just re-open it and I will answer. Thanks |
@SteveyO The support for multiple bridges is mainly missing when using a P.S.: I cannot reopen the issue |
@giampiero7 Sorry, didn't realize you could not re-open issues. I have re-opened this myself. Yes, this is a good question. The short answer is you don't know which bridge the sdklistener is responding too as this is only registered once. Can you elaborate on what kind of problems you anticipate would happen in onError? They way I see it, is you register your listener as normal, and perform a bridge search. When you get your list of found bridges and the user selects 2 (or more) then I would expect the developer to process each bridge connection (or authentication/pushlink) sequentially so you would always know what callback belongs to each bridge. |
In onError I would want to handle every possible case in which this method is called, the last example you gave is one of those... Moreover, if during discovery I connect to multiple PHAccessPoints (in onAccessPointsFound) in parallel, then when onBridgeConnected is called I don't know what access point is linked to what bridge... Is there no way to know which accessPoint a bridge is linked to? Thanks again! |
Hi again, Am not sure we could have a listener for each bridge, as the listener is used mainly for finding, connecting and authentication 'to a bridge' and it is registered before we have a bridge object. Steve |
Having the link between bridge and access point solved the problem for the other callbacks... I didn't find that long chain of methods to call before :)
By "listener for each bridge" I was thinking of a new class designed just for that... anyway, it's just a different way of thinking... I guess the only missing step for full support of more bridges is a reference to the bridge (or AP) in onError(). Thanks! |
It looks like the SDK has not been designed to handle more than one bridge by the same application.
Am I doing something wrong or this is actually the case?
If that is, are you planning to add support for multiple bridges?
Thanks
The text was updated successfully, but these errors were encountered: