ESP OpenBCI - An EEG Signal Processing Library for OpenBCI Hardware

com.github.mrstampy.esp.openbci
Class OpenBCIConnection

java.lang.Object
  extended by com.github.mrstampy.esp.dsp.lab.AbstractRawEspConnection<MultiConnectOpenBCISocket>
      extended by com.github.mrstampy.esp.openbci.OpenBCIConnection
All Implemented Interfaces:
RawEspConnection, MultiConnectionSocket

public class OpenBCIConnection
extends AbstractRawEspConnection<MultiConnectOpenBCISocket>

The Class OpenBCIConnection.


Constructor Summary
OpenBCIConnection()
          Instantiates a new open bci connection.
OpenBCIConnection(boolean broadcast)
          Instantiates a new open bci connection.
 
Method Summary
 double[][] getCurrent()
          Return the current second's worth of samples.
 double[][] getCurrent(int numSamples)
          Return the specified number of the current second's worth of samples.
 double[][] getCurrentFor(int channelNumber)
          Return the current second's worth of samples for the specified channel.
 double[][] getCurrentFor(int numSamples, int channelNumber)
          Return the specified number of the current second's worth of samples for the specified channel.
 AbstractDSPValues getDSPValues()
          Return the DSP values.
 java.lang.String getName()
          Return a name identifier.
 MultiConnectOpenBCISocket getSocket()
          Gets the socket.
 EspSignalUtilities getUtilities()
          Return the utilities.
 void start()
          Connects to the socket.
 void stop()
          Closes the connection to the AbstractMultiConnectionSocket socket.
 
Methods inherited from class com.github.mrstampy.esp.dsp.lab.AbstractRawEspConnection
addConnectionEventListener, bindBroadcaster, canBroadcast, clearConnectionEventListeners, getChannel, getChannels, getDefaultLab, getNumChannels, getWindowFunction, isBound, isConnected, removeConnectionEventListener, setWindowFunction, unbindBroadcaster
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OpenBCIConnection

public OpenBCIConnection()
                  throws java.io.IOException
Instantiates a new open bci connection.

Throws:
java.io.IOException - Signals that an I/O exception has occurred.

OpenBCIConnection

public OpenBCIConnection(boolean broadcast)
                  throws java.io.IOException
Instantiates a new open bci connection.

Parameters:
broadcast - the broadcast
Throws:
java.io.IOException - Signals that an I/O exception has occurred.
Method Detail

start

public void start()
           throws MultiConnectionSocketException
Description copied from interface: MultiConnectionSocket
Connects to the socket.

Specified by:
start in interface MultiConnectionSocket
Overrides:
start in class AbstractRawEspConnection<MultiConnectOpenBCISocket>
Throws:
MultiConnectionSocketException - if already connected or an unexpected error occurs

stop

public void stop()
Description copied from interface: MultiConnectionSocket
Closes the connection to the AbstractMultiConnectionSocket socket.

Specified by:
stop in interface MultiConnectionSocket
Overrides:
stop in class AbstractRawEspConnection<MultiConnectOpenBCISocket>

getUtilities

public EspSignalUtilities getUtilities()
Description copied from interface: RawEspConnection
Return the utilities.

Returns:
the utilities

getDSPValues

public AbstractDSPValues getDSPValues()
Description copied from interface: RawEspConnection
Return the DSP values.

Returns:
the DSP values

getCurrent

public double[][] getCurrent()
Description copied from interface: RawEspConnection
Return the current second's worth of samples.

Returns:
the current

getCurrent

public double[][] getCurrent(int numSamples)
Description copied from interface: RawEspConnection
Return the specified number of the current second's worth of samples.

Parameters:
numSamples - the num samples
Returns:
the current

getCurrentFor

public double[][] getCurrentFor(int channelNumber)
Description copied from interface: RawEspConnection
Return the current second's worth of samples for the specified channel.

Parameters:
channelNumber - the channel number
Returns:
the current

getCurrentFor

public double[][] getCurrentFor(int numSamples,
                                int channelNumber)
Description copied from interface: RawEspConnection
Return the specified number of the current second's worth of samples for the specified channel.

Parameters:
numSamples - the num samples
channelNumber - the channel number
Returns:
the current

getName

public java.lang.String getName()
Description copied from interface: RawEspConnection
Return a name identifier.

Returns:
the name

getSocket

public MultiConnectOpenBCISocket getSocket()
Description copied from class: AbstractRawEspConnection
Gets the socket.

Specified by:
getSocket in class AbstractRawEspConnection<MultiConnectOpenBCISocket>
Returns:
the socket

brought to you by Mr. Stampy