LibMuse 6.0.3
com.choosemuse.libmuse.MuseManager Class Referenceabstract
Inheritance diagram for com.choosemuse.libmuse.MuseManager:
com.choosemuse.libmuse.MuseManagerAndroid

Public Member Functions

abstract ArrayList< MusegetMuses ()
 
abstract void startListening ()
 
abstract void stopListening ()
 
abstract void setMuseListener (MuseListener listener)
 
abstract AdvertisingStats getAdvertisingStats (Muse m)
 
abstract void resetAdvertisingStats ()
 
abstract void removeFromListAfter (long time)
 

Static Public Attributes

static final long DEFAULT_REMOVE_FROM_LIST_AFTER = 30L
 

Detailed Description

Discovers the available Muse headbands that this device can connect to.

To connect to a headband, first call MuseManager.setMuseListener() to receive callbacks when a headband is discovered. Then call MuseManager.startListening() When MuseManager detects a headband you will receive a MuseListener.museListChanged() callback. You can then call MuseManager.getMuses() followed by the appropriate function on the Muse to connect to the headband.

See also
Muse
MuseListener

Member Function Documentation

§ getAdvertisingStats()

abstract AdvertisingStats com.choosemuse.libmuse.MuseManager.getAdvertisingStats ( Muse  m)
abstract

Returns information about the advertising packets seen by LibMuse. This is intended for internal usage at Interaxon and is currently only implemented on Android for Muse 2016 ( MU_02 ). This function does nothing on iOS or Windows.

§ getMuses()

abstract ArrayList<Muse> com.choosemuse.libmuse.MuseManager.getMuses ( )
abstract

Returns all currently available Muse headbands.

The returned list is sorted lexicographically by Muse name.

Note that until you start listening, this list will be empty.

Returns
The list of available muses.

§ removeFromListAfter()

abstract void com.choosemuse.libmuse.MuseManager.removeFromListAfter ( long  time)
abstract

MuseManager will automatically remove a Muse 2016 ( MU_02 ) headband from the list of Muses if it has not received some type of communication from the headband within this time period.

By default this is MuseManager.DEFAULT_REMOVE_FROM_LIST_AFTER. To have Muse 2016 ( MU_02 ) headbands remain in the list until the next call to MuseManager.startListening() set the time to 0.

Parameters
timeSpecified in seconds, the time to wait before removing a headband from the list. If set to 0, headbands will not be removed automatically.

§ resetAdvertisingStats()

abstract void com.choosemuse.libmuse.MuseManager.resetAdvertisingStats ( )
abstract

Erases all previously stored information about advertising packets. This is intended for internal usage at Interaxon and is currently only implemented Muse 2016 ( MU_02 ). This function does nothing on iOS.

§ setMuseListener()

abstract void com.choosemuse.libmuse.MuseManager.setMuseListener ( MuseListener  listener)
abstract

Set the listener to be notified on changes to the list of Muses.

Parameters
listenerThe listener that will receive the callback when a Muse is discovered.

§ startListening()

abstract void com.choosemuse.libmuse.MuseManager.startListening ( )
abstract

Start listening for any possible Muse devices.

As Muses are discovered, they are added to the list returned by MuseManager.getMuses() Listening is a fairly heavyweight operation, so it should be disabled when it is not needed, e.g. after a device has been found. Specifically, you must call stopListening() before you try to connect to a Muse you have previously discovered.

You must call MuseManagerAndroid.setContext() prior to calling startListening() or stopListening(), and the context should persist at least from before the call to startListening() till after the call to stopListening(). An application context is a good candidate for this.

§ stopListening()

abstract void com.choosemuse.libmuse.MuseManager.stopListening ( )
abstract

Stop listening for Muse devices.

Stops receiving advertising packets or modifying the list of Muses returned by MuseManager.getMuses() If this is called while not scanning, it is a no-op.

You must call MuseManagerAndroid.setContext() prior to calling startListening() or stopListening(), and the context should persist at least from before the call to startListening() till after the call to stopListening(). An application context is a good candidate for this.

Member Data Documentation

§ DEFAULT_REMOVE_FROM_LIST_AFTER

final long com.choosemuse.libmuse.MuseManager.DEFAULT_REMOVE_FROM_LIST_AFTER = 30L
static

The default time in seconds after which a headband will be removed from the list of muses if MuseManager has had no contact with it.

This has a value of 30 seconds.


The documentation for this class was generated from the following file: