LibMuse 6.0.2
com.choosemuse.libmuse.MuseManagerAndroid Class Reference
Inheritance diagram for com.choosemuse.libmuse.MuseManagerAndroid:
com.choosemuse.libmuse.MuseManager

Classes

class  DiscoveryStats
 

Public Member Functions

BluetoothAdapter getDefaultAdapter ()
 
ArrayList< MusegetMuses ()
 
void setContext (Context context)
 
void setMuseListener (MuseListener listener)
 
void startListening ()
 
void stopListening ()
 
void removeFromListAfter (long time)
 
AdvertisingStats getAdvertisingStats (Muse m)
 
void resetAdvertisingStats ()
 
- Public Member Functions inherited from com.choosemuse.libmuse.MuseManager
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 Member Functions

static synchronized MuseManagerAndroid getInstance ()
 
static UUID museUuid ()
 

Additional Inherited Members

- Static Public Attributes inherited from com.choosemuse.libmuse.MuseManager
static final long DEFAULT_REMOVE_FROM_LIST_AFTER = 30L
 

Detailed Description

Provides access to all Muse devices paired to this device.

This class provides access to the Muse object associated with each Muse Headband the mobile device knows about. The recommended usage is to call getPairedMuses() and find the devices you want.

For applications that are designed only to work with a single headband, there are a few possibilities: you can display a list of names of all paired Muses in your application and have the user select the one they'd like to use; you may also save the MAC address of the last used Muse and use that as a default; or you can try connecting to each Muse in the list until you find one that works.

Member Function Documentation

§ getAdvertisingStats()

AdvertisingStats com.choosemuse.libmuse.MuseManagerAndroid.getAdvertisingStats ( Muse  m)
inline

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.

each headband after the test is over. Know your device - if the device suffers from

§ getDefaultAdapter()

BluetoothAdapter com.choosemuse.libmuse.MuseManagerAndroid.getDefaultAdapter ( )
inline

Returns the default Bluetooth Adapter.

Returns
the default Bluetooth Adapter.

§ getInstance()

static synchronized MuseManagerAndroid com.choosemuse.libmuse.MuseManagerAndroid.getInstance ( )
inlinestatic

Returns the instance of the MuseManager.

Returns
the instance of the MuseManager.

§ getMuses()

ArrayList<Muse> com.choosemuse.libmuse.MuseManagerAndroid.getMuses ( )
inline

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.

§ museUuid()

static UUID com.choosemuse.libmuse.MuseManagerAndroid.museUuid ( )
inlinestatic

Returns the UUID of the Muse Headband.

Returns
the UUID of the Muse Headband.

§ removeFromListAfter()

void com.choosemuse.libmuse.MuseManagerAndroid.removeFromListAfter ( long  time)
inline

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()

void com.choosemuse.libmuse.MuseManagerAndroid.resetAdvertisingStats ( )
inline

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.

§ setContext()

void com.choosemuse.libmuse.MuseManagerAndroid.setContext ( Context  context)
inline

Sets the context object to use with this MuseManager.

Parameters
contextthe context to use.

§ setMuseListener()

void com.choosemuse.libmuse.MuseManagerAndroid.setMuseListener ( MuseListener  listener)
inline

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()

void com.choosemuse.libmuse.MuseManagerAndroid.startListening ( )
inline

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()

void com.choosemuse.libmuse.MuseManagerAndroid.stopListening ( )
inline

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.


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