|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.neurosky.thinkgear.TGDevice
public class TGDevice
Class to connect and receive data from a ThinkGear device.
Constructor Summary | |
---|---|
TGDevice(BluetoothAdapter btAdapter,
Handler handler)
Initializes a new TGDevice that will connect to a ThinkGear hardware device via Bluetooth. |
|
TGDevice(java.io.InputStream s,
java.io.OutputStream o,
Handler handler)
Initializes a new TGDevice that will read from a ThinkGear hardware device via @c s and write to the ThinkGear hardware device via @c o. |
Method Summary | |
---|---|
void |
close()
Closes the connection to the device. |
void |
connect(BluetoothDevice btDevice)
Connects to the specified Bluetooth device with raw EEG disabled. |
void |
connect(BluetoothDevice btDevice,
boolean rawEnabled)
Connects to the specified Bluetooth device with configurable raw output. |
void |
connectStream(boolean rawEnabled)
Connects to InputStream specified by constructor with configurable raw output. |
void |
connectUart(boolean rawEnabled)
Deprecated. |
boolean |
EKGdeleteUser(java.lang.String name)
|
int |
EKGloadParams(java.lang.String name)
|
void |
EKGstartDetection()
|
void |
EKGstartLongTraining(java.lang.String userName)
|
void |
EKGstartTraining(java.lang.String userName)
Deprecated. |
void |
EKGstopDetection()
|
void |
EKGstopTraining()
|
BluetoothDevice |
getConnectedDevice()
Returns the currently connected device |
double |
getHeartAge()
|
int |
getHeartRisk()
|
int |
getState()
Gets the state of the TGDevice |
int |
getVersion()
Returns the version number of the TGDevice driver |
void |
start()
Starts the data stream. |
boolean |
startByteLog(java.lang.String path,
java.lang.String fileName)
|
boolean |
startLog(java.lang.String path,
java.lang.String fileName)
Enables logging of the stream |
void |
stop()
Stops the data stream. |
void |
stopLog()
Disables logging of stream. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int STATE_IDLE
public static final int STATE_CONNECTING
public static final int STATE_CONNECTED
public static final int STATE_DISCONNECTED
public static final int STATE_NOT_FOUND
public static final int STATE_ERR_NO_DEVICE
public static final int STATE_ERR_BT_OFF
public static final int MSG_STATE_CHANGE
public static final int MSG_POOR_SIGNAL
public static final int MSG_HEART_RATE
public static final int MSG_ATTENTION
public static final int MSG_MEDITATION
public static final int MSG_EGO_TRIM
public static final int MSG_ZONE
public static final int MSG_BLINK
public static final int MSG_RELAXATION
public static final int MSG_RESPIRATION
public static final int MSG_POSITIVITY
public static final int MSG_FAMILIARITY
public static final int MSG_DIFFICULTY
public static final int MSG_RAW_DATA
public static final int MSG_EEG_POWER
public static final int MSG_RAW_MULTI
public static final int MSG_THINKCAPBETA_RAW
public static final int MSG_THINKCAP_RAW
public static final int MSG_SLEEP_STAGE
public static final int MSG_MULTI_SIGNAL_STATUS
public static final int MSG_RAW_COUNT
public static final int MSG_LOW_BATTERY
public static final int MSG_EKG_IDENTIFIED
public static final int MSG_EKG_TRAINED
public static final int MSG_EKG_TRAIN_STEP
public static final int MSG_EKG_RRINT
public static final int MSG_HEART_AGE
public static final int MSG_HEART_AGE_5MIN
public static final boolean L
public static final boolean ekgPersonalizationEnabled
public com.neurosky.thinkgear.TGDevice.EkgSenseManager ekgSenseMan
public int inputAge
public int pass_seconds
Constructor Detail |
---|
public TGDevice(BluetoothAdapter btAdapter, Handler handler)
btAdapter
- BluetoothAdapter of the device.handler
- A Handler to accept and process messages from
this TGDevice. Refer to the "Android Development
Guide for ThinkGear" for details.public TGDevice(java.io.InputStream s, java.io.OutputStream o, Handler handler)
s
- An InputStream
reading from a ThinkGear
hardware device.o
- An (@link OutputStream} writing to a ThinkGear
hardware device.handler
- A Handler to accept and process messages from
this TGDevice. Refer to the "Android Development
Guide for ThinkGear" for details.Method Detail |
---|
public int getVersion()
public void connect(BluetoothDevice btDevice)
btDevice
- Desired BluetoothDevicepublic void connect(BluetoothDevice btDevice, boolean rawEnabled)
btDevice
- Desired BluetoothDevicerawEnabled
- Enable or disable raw EEG output.public void connectUart(boolean rawEnabled)
rawEnabled
- Enable or disable raw EEG output.public void connectStream(boolean rawEnabled)
rawEnabled
- Enable or disable raw EEG output.public void close()
public void start()
public void stop()
public BluetoothDevice getConnectedDevice()
public int getState()
public boolean startLog(java.lang.String path, java.lang.String fileName)
path
- Location of desired log file. Pass in empty string for default location [external storage]/Android/data/com.neurosky.thinkgear/fileName
- Filename of desired log file. Pass in empty string for default filename yyyy-MM-dd-hhmmss.txt (current timestamp)
public boolean startByteLog(java.lang.String path, java.lang.String fileName)
public void stopLog()
public double getHeartAge()
public int getHeartRisk()
public int EKGloadParams(java.lang.String name)
public void EKGstartDetection()
public void EKGstopDetection()
public void EKGstartTraining(java.lang.String userName)
public void EKGstartLongTraining(java.lang.String userName)
public void EKGstopTraining()
public boolean EKGdeleteUser(java.lang.String name)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |