|
ESP OpenBCI - An EEG Signal Processing Library for OpenBCI Hardware | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.github.mrstampy.esp.multiconnectionsocket.AbstractMultiConnectionSocket<byte[]>
com.github.mrstampy.esp.openbci.MultiConnectOpenBCISocket
public class MultiConnectOpenBCISocket
The Class MultiConnectOpenBCISocket.
| Field Summary |
|---|
| Fields inherited from interface com.github.mrstampy.esp.openbci.OpenBCIConstants |
|---|
CHANNELS_START_IDX, END_PACKET, NUM_CHANNELS_IDX, START_PACKET |
| Constructor Summary | |
|---|---|
MultiConnectOpenBCISocket()
Instantiates a new multi connect open bci socket. |
|
MultiConnectOpenBCISocket(boolean broadcasting)
Instantiates a new multi connect open bci socket. |
|
| Method Summary | |
|---|---|
void |
activateChannel(int channelNumber)
Activate channel. |
void |
activateLeadoffN(int channelNumber)
Activate leadoff n. |
void |
activateLeadoffP(int channelNumber)
Activate leadoff p. |
void |
addListener(OpenBCIEventListener l)
Adds the listener. |
void |
clearListeners()
Clear listeners. |
void |
deactivateChannel(int channelNumber)
Deactivate channel. |
void |
deactivateLeadoffN(int channelNumber)
Deactivate leadoff n. |
void |
deactivateLeadoffP(int channelNumber)
Deactivate leadoff p. |
EspChannel |
getChannel(int channelNumber)
Returns the EspChannel representation specified by the channel
number. |
java.util.List<EspChannel> |
getChannels()
Returns the EspChannel representations processed by the
implementation. |
protected org.apache.mina.core.service.IoHandler |
getHandlerAdapter()
Gets the handler adapter. |
OpenBCICommand |
getStartCommand()
Gets the start command. |
boolean |
isConnected()
Returns true if connected to the AbstractMultiConnectionSocket
socket. |
protected void |
parseMessage(byte[] message)
Invoked via Disruptor's onEvent processing, implement to notify event listeners and any multi connection subscribers. |
void |
removeListener(OpenBCIEventListener l)
Removes the listener. |
void |
sendCommand(OpenBCICommand command)
Send command. |
void |
setStartCommand(OpenBCICommand startCommand)
Sets the start command. |
protected void |
startImpl()
Implement to create a connection to the EEG device. |
protected void |
stopImpl()
Implement to close the connection to the EEG device. |
void |
tune()
When invoked the tuning functionality of the SampleBuffer will be
activated. |
| Methods inherited from class com.github.mrstampy.esp.multiconnectionsocket.AbstractMultiConnectionSocket |
|---|
addConnectionEventListener, bindBroadcaster, canBroadcast, clearConnectionEventListeners, getNumChannels, initBroadCaster, isBound, notifyConnectionEventListeners, publishMessage, removeConnectionEventListener, setNumChannels, start, stop, unbindBroadcaster |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public MultiConnectOpenBCISocket()
throws java.io.IOException
java.io.IOException - Signals that an I/O exception has occurred.
public MultiConnectOpenBCISocket(boolean broadcasting)
throws java.io.IOException
broadcasting - the broadcasting
java.io.IOException - Signals that an I/O exception has occurred.| Method Detail |
|---|
public void sendCommand(OpenBCICommand command)
command - the commandpublic void activateChannel(int channelNumber)
channelNumber - the channel numberpublic void deactivateChannel(int channelNumber)
channelNumber - the channel numberpublic void activateLeadoffN(int channelNumber)
channelNumber - the channel numberpublic void activateLeadoffP(int channelNumber)
channelNumber - the channel numberpublic void deactivateLeadoffN(int channelNumber)
channelNumber - the channel numberpublic void deactivateLeadoffP(int channelNumber)
channelNumber - the channel numberpublic void addListener(OpenBCIEventListener l)
l - the lpublic void removeListener(OpenBCIEventListener l)
l - the lpublic void clearListeners()
public void tune()
SampleBuffer will be
activated. The tuning process takes ~ 10 seconds, during which the number
of samples will be counted and used to resize the buffer to more closely
represent 1 seconds' worth of data.
public boolean isConnected()
MultiConnectionSocketAbstractMultiConnectionSocket
socket.
isConnected in interface MultiConnectionSocket
protected void startImpl()
throws MultiConnectionSocketException
AbstractMultiConnectionSocketAbstractMultiConnectionSocket#publishMessage(String) method.
startImpl in class AbstractMultiConnectionSocket<byte[]>MultiConnectionSocketException - the multi connection socket exceptionAbstractMultiConnectionSocket#publishMessage(String)protected void stopImpl()
AbstractMultiConnectionSocket
stopImpl in class AbstractMultiConnectionSocket<byte[]>protected org.apache.mina.core.service.IoHandler getHandlerAdapter()
AbstractMultiConnectionSocket
getHandlerAdapter in class AbstractMultiConnectionSocket<byte[]>protected void parseMessage(byte[] message)
AbstractMultiConnectionSocket
parseMessage in class AbstractMultiConnectionSocket<byte[]>message - the messagepublic OpenBCICommand getStartCommand()
public void setStartCommand(OpenBCICommand startCommand)
startCommand - the new start commandpublic java.util.List<EspChannel> getChannels()
MultiConnectionSocketEspChannel representations processed by the
implementation.
getChannels in interface MultiConnectionSocketpublic EspChannel getChannel(int channelNumber)
MultiConnectionSocketEspChannel representation specified by the channel
number.
getChannel in interface MultiConnectionSocketchannelNumber - the channel number
|
brought to you by Mr. Stampy | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||