sphero-inc / Sphero-Android-SDK

🚫 DEPRECATED REPO: Sphero™ is the amazing robotic ball ( gosphero.com ), this is the repository for the Android SDK for Sphero™. Visit dev site for more information:
https://developer.gosphero.com
160 stars 86 forks source link

Connection to Multiple Spheros #26

Closed TakayukiHoshi1984 closed 7 years ago

TakayukiHoshi1984 commented 8 years ago

I’m planning to update Sphero SDK in my Android app, but it seems connection to multiple Spheros is not working in the latest version. The following code attempts to connect to multiple Spheros, but, after it discovered one Sphero, it fails to discover others. I’m wondering if connection to multiple Spheres is possible in the latest version - and if yes, could you explain how to achieve that.

Thanks in advance,

        try {
            DualStackDiscoveryAgent.getInstance().setMaxConnectedRobots(10);
            mIsDiscovering = DualStackDiscoveryAgent.getInstance().startDiscovery(context);
        } catch (DiscoveryException e) {
            mIsDiscovering = false;
        }
iamcgn commented 8 years ago

Hi @TakayukiHoshi1984, It looks like there is a bug when using the dual stack discovery agent. If you use the DiscoveryAgentClassic and DiscoveryAgentLE classes directly instead of the dual stack discovery agent it should work correctly. If it's not clear Sphero is Classic and Ollie is LE.

TakayukiHoshi1984 commented 8 years ago

Thank you. It will check it.