- Plugin to interface between a Cordova app and Muse device
- Currently only supports Android (libraries are currently unavailable for other platforms)
- Uses libmuse v1.0.1
- Feedback and PR's welcome!
To install, from the root of your Cordova app:
cordova plugin add https://github.com/mtriff/cordova-muse
Add the following permissions to platforms/android/AndroidManifest.xml
:
<uses-permission android:name="android.permission.BLUETOOTH" />
<uses-permission android:name="android.permission.BLUETOOTH_ADMIN" />
To uninstall, from the root of your Cordova app:
cordova plugin remove com.mtriff.cordova.muse.plugin
All get_____ functions return an array of values, unless specified otherwise. Details on the different values can be found in the Muse SDK documentation. The length of the array will vary based on how long the recording session was.
Each function takes two parameters, successCallback and errorCallback. These should be functions that take one argument (usually an array) that will be called by the plugin once it completes the requested action.
Returns a list of Muse devices attached to the phone by Bluetooth. Listed by MAC addresses.
Connects to the first Muse device it finds attached to the phone by Bluetooth.
Disconnects from the Muse device if one is connected.
Returns the status of the connection between the Muse headband and the users forehead.
Possible values are: Good Connection, Weak Connection, and No Connection
Left Ear - Good Connection
Right Ear - Good Connection
Left Forehead - Good Connection
Right Forehead - Good Connection
Triggers the data lists to be refreshed and data begins to be collected.
Stops recording data. Any events and data received by the app from the Muse device will be ignored.
Returns a JSON object structured as follows containing the data for all of the variables recorded.
{
ACC_LEFT_RIGHT: [1.0, 2.0, 3.0],
ACC_FORWARD_BACKWARD: [1.0, 2.0, 3.0],
ACC_UP_DOWN: [1.0, 2.0, 3.0],
EEG_LEFT_EAR: [1.0, 2.0, 3.0],
EEG_RIGHT_EAR: [1.0, 2.0, 3.0],
EEG_LEFT_FOREHEAD: [1.0, 2.0, 3.0],
EEG_RIGHT_FOREHEAD: [1.0, 2.0, 3.0],
ALPHA_REL_1: [1.0, 2.0, 3.0],
ALPHA_REL_2: [1.0, 2.0, 3.0],
ALPHA_REL_3: [1.0, 2.0, 3.0],
ALPHA_REL_4: [1.0, 2.0, 3.0],
BETA_REL_1: [1.0, 2.0, 3.0],
BETA_REL_2: [1.0, 2.0, 3.0],
BETA_REL_3: [1.0, 2.0, 3.0],
BETA_REL_4: [1.0, 2.0, 3.0],
THETA_REL_1: [1.0, 2.0, 3.0],
THETA_REL_2: [1.0, 2.0, 3.0],
THETA_REL_3: [1.0, 2.0, 3.0],
THETA_REL_4: [1.0, 2.0, 3.0],
GAMMA_REL_1: [1.0, 2.0, 3.0],
GAMMA_REL_2: [1.0, 2.0, 3.0],
GAMMA_REL_3: [1.0, 2.0, 3.0],
GAMMA_REL_4: [1.0, 2.0, 3.0],
BLINK: [123456, 123456, 123456]
}
Retrieves the X-axis accelerometer data from the previous recording.
Retrieves the Y-axis accelerometer data from the previous recording.
Retrieves the Z-axis accelerometer data from the previous recording.
Retrieves the left ear sensor's EEG data from the previous recording.
Retrieves the right ear sensor's EEG data from the previous recording.
Retrieves the left forehead sensor's EEG data from the previous recording.
Retrieves the right forehead sensor's EEG data from the previous recording.
Retrieves the Alpha Relative channel 1 data from the previous recording.
Retrieves the Alpha Relative channel 2 data from the previous recording.
Retrieves the Alpha Relative channel 3 data from the previous recording.
Retrieves the Alpha Relative channel 4 data from the previous recording.
Retrieves the Beta Relative channel 1 data from the previous recording.
Retrieves the Beta Relative channel 2 data from the previous recording.
Retrieves the Beta Relative channel 3 data from the previous recording.
Retrieves the Beta Relative channel 4 data from the previous recording.
Retrieves the Theta Relative channel 1 data from the previous recording.
Retrieves the Theta Relative channel 2 data from the previous recording.
Retrieves the Theta Relative channel 3 data from the previous recording.
Retrieves the Theta Relative channel 4 data from the previous recording.
Retrieves the Gamma Relative channel 1 data from the previous recording.
Retrieves the Gamma Relative channel 2 data from the previous recording.
Retrieves the Gamma Relative channel 3 data from the previous recording.
Retrieves the Gamma Relative channel 4 data from the previous recording.
Retrieves the timestamps (in milliseconds) that it was recorded that the user blinked.