Public Member Functions | |
abstract void | receiveMuseConnectionPacket (MuseConnectionPacket packet, Muse muse) |
Implement this interface to listen for changes to the current connection status (like connect/disconnect).
Important: DO NOT CALL Muse.connect()/ Muse.disconnect() directly from a connection listener handler. Either create a new thread and run it from there or use Muse.runAsynchronously() which creates a new thread implicitly.
|
abstract |
Called from the Muse connection thread whenever there is a change in the current connection status of the Muse
However, you can register/unregister listeners in this callback. All previously registered listeners would still receive callbacks for this current event. On subsequent events, the newly registered listeners will be called. For example, if you had 2 listeners 'A' and 'B' for this event. If, on the callback for listener A, listener A unregisters all listeners and registers a new listener 'C' and then in the callback for listener 'B', you unregister all listeners again and register a new listener 'D'. Then on the subsequent event callback, only listener D's callback will be invoked.
packet | The connection packet |
muse | The Muse that sent the connection packet. |