ESP OpenBCI - An EEG Signal Processing Library for OpenBCI Hardware

com.github.mrstampy.esp.multiconnectionsocket
Interface MultiConnectionSocket

All Known Subinterfaces:
RawEspConnection
All Known Implementing Classes:
AbstractMultiConnectionSocket, AbstractRawEspConnection, MultiConnectOpenBCISocket, OpenBCIConnection

public interface MultiConnectionSocket

The Interface MultiConnectionSocket.


Method Summary
 void addConnectionEventListener(ConnectionEventListener listener)
          Adds the connection event listener.
 void bindBroadcaster()
          Binds the broadcaster to the local host and the broadcaster port in AbstractSocketConnector.
 boolean canBroadcast()
          Returns true if this instance has been configured for broadcasting.
 void clearConnectionEventListeners()
          Clear connection event listeners.
 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.
 int getNumChannels()
          Returns the number of channels.
 boolean isBound()
          Returns true if the broadcaster is bound.
 boolean isConnected()
          Returns true if connected to the AbstractMultiConnectionSocket socket.
 void removeConnectionEventListener(ConnectionEventListener listener)
          Removes the connection event listener.
 void start()
          Connects to the socket.
 void stop()
          Closes the connection to the AbstractMultiConnectionSocket socket.
 void unbindBroadcaster()
          Unbinds the broadcaster.
 

Method Detail

addConnectionEventListener

void addConnectionEventListener(ConnectionEventListener listener)
Adds the connection event listener.

Parameters:
listener - the listener

removeConnectionEventListener

void removeConnectionEventListener(ConnectionEventListener listener)
Removes the connection event listener.

Parameters:
listener - the listener

clearConnectionEventListeners

void clearConnectionEventListeners()
Clear connection event listeners.


start

void start()
           throws MultiConnectionSocketException
Connects to the socket.

Throws:
MultiConnectionSocketException - if already connected or an unexpected error occurs

stop

void stop()
Closes the connection to the AbstractMultiConnectionSocket socket.


isConnected

boolean isConnected()
Returns true if connected to the AbstractMultiConnectionSocket socket.

Returns:
true if connected

bindBroadcaster

void bindBroadcaster()
                     throws java.io.IOException
Binds the broadcaster to the local host and the broadcaster port in AbstractSocketConnector.

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

unbindBroadcaster

void unbindBroadcaster()
Unbinds the broadcaster.

See Also:
AbstractSocketConnector

isBound

boolean isBound()
Returns true if the broadcaster is bound.

Returns:
true, if is bound
See Also:
AbstractSocketConnector

canBroadcast

boolean canBroadcast()
Returns true if this instance has been configured for broadcasting.

Returns:
true, if successful

getNumChannels

int getNumChannels()
Returns the number of channels.

Returns:
the num channels

getChannels

java.util.List<EspChannel> getChannels()
Returns the EspChannel representations processed by the implementation.

Returns:
the channels

getChannel

EspChannel getChannel(int channelNumber)
Returns the EspChannel representation specified by the channel number.

Parameters:
channelNumber - the channel number
Returns:
the channel

brought to you by Mr. Stampy