BioRadio SDK - Java Android  1.1
com.glneurotech.devices.common.DaqDevice Class Referenceabstract
Inheritance diagram for com.glneurotech.devices.common.DaqDevice:
com.glneurotech.devices.common.IDaqDevice com.glneurotech.devices.bioradio.BioRadioDevice com.glneurotech.devices.common.GenericDevice com.glneurotech.devices.bioradio.devicemocks.MockBioRadioDevice

Public Member Functions

boolean getIsConnected ()
 
final boolean getIsDeviceLocked ()
 
final void setIsDeviceLocked (boolean value)
 
final boolean getIsAcquiring ()
 
final boolean getIsRecording ()
 
final void setIsRecording (boolean value)
 
boolean connect ()
 
abstract void processPacketForStatusData (DeviceDataPacket packet)
 
abstract void processPacketForSignalData (DeviceDataPacket packet)
 
abstract boolean waitForStatusInitialization ()
 
void disconnect ()
 
final void onSignalBufferOverflow (SignalDataEventArgs args)
 
final void onGeneralOperationError (EventArgs args)
 
final void onCommuncationError (CommunicationErrorArgs args)
 
abstract void startAcquisition ()
 
abstract void stopAcquisition ()
 
abstract void initializeSignalGroups (Optional< Integer > signalBufferSize)
 
void unlockDevice () throws InterruptedException, TimeoutException
 
void lockDevice () throws InterruptedException, TimeoutException
 
void setDeviceTime () throws InterruptedException, TimeoutException
 
void setDeviceTime (LocalDateTime time) throws InterruptedException, TimeoutException
 
final String getHardwareVersion ()
 
final void setHardwareVersion (String value)
 
final String getFirmwareVersion ()
 
final void setFirmwareVersion (String value)
 
final String getName ()
 
final void setName (String value)
 
abstract DeviceTypeCode getDeviceType ()
 
final ArrayList< SignalGroupgetSignalGroups ()
 
final HardwareLinkHandler getConnection ()
 
final void setConnection (HardwareLinkHandler value)
 
 DaqDevice (HardwareLinkHandler hardwareLink, String name, Optional< Integer > signalBufferSize) throws IOException
 
final void startRecording (GlntStream outputStream)
 
final void stopRecording ()
 
final void getDeviceId () throws InterruptedException, TimeoutException
 
final DeviceTypeCode getInternalDeviceType () throws InterruptedException, TimeoutException
 
void close () throws IOException
 

Public Attributes

Event< EventHandler< SignalDataEventArgs > > SignalBufferOverflowed = new Event<EventHandler<SignalDataEventArgs>>()
 
Event< EventHandler< CommunicationErrorArgs > > CommunicationError = new Event<EventHandler<CommunicationErrorArgs>>()
 
Event< EventHandler< EventArgs > > GeneralOperationError = new Event<EventHandler<EventArgs>>()
 

Static Public Attributes

static final int _NUM_OF_RETRY = 10
 
static final int _TIMEOUT_MS = 1000
 

Protected Member Functions

void setIsConnected (boolean value)
 
final void setIsAcquiring (boolean value)
 
void getInternalFirmwareVersion () throws InterruptedException, TimeoutException
 

Detailed Description

The base class from which Great Lakes NeuroTechnologies data acquisition devices inherit.

Constructor & Destructor Documentation

◆ DaqDevice()

com.glneurotech.devices.common.DaqDevice.DaqDevice ( HardwareLinkHandler  hardwareLink,
String  name,
Optional< Integer >  signalBufferSize 
) throws IOException

Daq device method.

Parameters
hardwareLinkTake a HardwareLinkHandler as parameter.
nameTake a string for name parameter.
signalBufferSizeTake an optional integer.
Exceptions
IOException

Member Function Documentation

◆ close()

void com.glneurotech.devices.common.DaqDevice.close ( ) throws IOException

Close the connection with the bio radio device.

Exceptions
IOException

◆ connect()

boolean com.glneurotech.devices.common.DaqDevice.connect ( )

Opens a connection to the device so that commands can be issued and data can be acquired.

Implements com.glneurotech.devices.common.IDaqDevice.

◆ disconnect()

void com.glneurotech.devices.common.DaqDevice.disconnect ( )

Disconnects and closes the connection.

Implements com.glneurotech.devices.common.IDaqDevice.

◆ getConnection()

final HardwareLinkHandler com.glneurotech.devices.common.DaqDevice.getConnection ( )

Gets connection.

Returns

◆ getDeviceId()

final void com.glneurotech.devices.common.DaqDevice.getDeviceId ( ) throws InterruptedException, TimeoutException

Gets device Id.

Exceptions
InterruptedException
TimeoutException

◆ getDeviceType()

abstract DeviceTypeCode com.glneurotech.devices.common.DaqDevice.getDeviceType ( )
abstract

Abstract method - get device type.

◆ getFirmwareVersion()

final String com.glneurotech.devices.common.DaqDevice.getFirmwareVersion ( )

The current device firmware version.

Implements com.glneurotech.devices.common.IDaqDevice.

◆ getHardwareVersion()

final String com.glneurotech.devices.common.DaqDevice.getHardwareVersion ( )

The current device hardware version number.

Implements com.glneurotech.devices.common.IDaqDevice.

◆ getInternalDeviceType()

final DeviceTypeCode com.glneurotech.devices.common.DaqDevice.getInternalDeviceType ( ) throws InterruptedException, TimeoutException

Gets internal device type.

Returns
Exceptions
InterruptedException
TimeoutException

◆ getIsAcquiring()

final boolean com.glneurotech.devices.common.DaqDevice.getIsAcquiring ( )

Indicates whether the device is currently streaming signal data to the PC.

Implements com.glneurotech.devices.common.IDaqDevice.

◆ getIsConnected()

boolean com.glneurotech.devices.common.DaqDevice.getIsConnected ( )

Indicates whether the device is currently connected to the PC and able to receive commands.

Implements com.glneurotech.devices.common.IDaqDevice.

◆ getIsDeviceLocked()

final boolean com.glneurotech.devices.common.DaqDevice.getIsDeviceLocked ( )

Indicates whether the device is in locked mode. When a device is locked, the only commands that can be issued are to start and stop acquisition. All other commands are disabled.

◆ getIsRecording()

final boolean com.glneurotech.devices.common.DaqDevice.getIsRecording ( )

Indicates whether the device is currently recording the raw data stream to a file.

◆ getName()

final String com.glneurotech.devices.common.DaqDevice.getName ( )

The name associated with this device.

Implements com.glneurotech.devices.common.IDaqDevice.

◆ getSignalGroups()

final ArrayList<SignalGroup> com.glneurotech.devices.common.DaqDevice.getSignalGroups ( )

A list of all SignalGroups defined for this device.

Implements com.glneurotech.devices.common.IDaqDevice.

◆ lockDevice()

void com.glneurotech.devices.common.DaqDevice.lockDevice ( ) throws InterruptedException, TimeoutException

Locks the Great Lakes NeuroTechnologies device so that no other interactive commands will be accepted.

Returns
Boolean value indicating whether the lock command was successful.

◆ onCommuncationError()

final void com.glneurotech.devices.common.DaqDevice.onCommuncationError ( CommunicationErrorArgs  args)

On communication error

Parameters
args

◆ onGeneralOperationError()

final void com.glneurotech.devices.common.DaqDevice.onGeneralOperationError ( EventArgs  args)

On general operation error.

Parameters
args

◆ setConnection()

final void com.glneurotech.devices.common.DaqDevice.setConnection ( HardwareLinkHandler  value)

Sets connection

Parameters
valueTake a HardwareLinkHandler as parameter.

◆ setDeviceTime() [1/2]

void com.glneurotech.devices.common.DaqDevice.setDeviceTime ( ) throws InterruptedException, TimeoutException

Sends the current time to the device to synchronize with PC system time. The device must be unlocked for this command to have an effect.

◆ setDeviceTime() [2/2]

void com.glneurotech.devices.common.DaqDevice.setDeviceTime ( LocalDateTime  time) throws InterruptedException, TimeoutException

Sets the device time to a specific date/time value

Parameters
timeThe DateTime value to which the device will be set.

◆ setFirmwareVersion()

final void com.glneurotech.devices.common.DaqDevice.setFirmwareVersion ( String  value)

Sets firmware version

Parameters
valueTake a string asa parameter.

◆ setHardwareVersion()

final void com.glneurotech.devices.common.DaqDevice.setHardwareVersion ( String  value)

Sets Hardware version

Parameters
valueTake a string as parameter.

Implements com.glneurotech.devices.common.IDaqDevice.

◆ startAcquisition()

abstract void com.glneurotech.devices.common.DaqDevice.startAcquisition ( )
abstract

Begins streaming real-time data from the connected device.

Implements com.glneurotech.devices.common.IDaqDevice.

◆ startRecording()

final void com.glneurotech.devices.common.DaqDevice.startRecording ( GlntStream  outputStream)

Starts recording raw device data stream to the specified file name.

Parameters
outputStreamThe stream to which the recording should be written

Implements com.glneurotech.devices.common.IDaqDevice.

◆ stopAcquisition()

abstract void com.glneurotech.devices.common.DaqDevice.stopAcquisition ( )
abstract

Stops streaming real-time data from the connected device.

Implements com.glneurotech.devices.common.IDaqDevice.

◆ stopRecording()

final void com.glneurotech.devices.common.DaqDevice.stopRecording ( )

Stops recording raw device data stream and closes the file. If the device is not currently recording, an exception will be thrown.

Implements com.glneurotech.devices.common.IDaqDevice.

◆ unlockDevice()

void com.glneurotech.devices.common.DaqDevice.unlockDevice ( ) throws InterruptedException, TimeoutException

Sends the unlock command to the device.

Returns
Boolean value indicating whether the unlock command was successful.

◆ waitForStatusInitialization()

abstract boolean com.glneurotech.devices.common.DaqDevice.waitForStatusInitialization ( )
abstract

In a derived class, performs any additional initialization required in order for all device status properties to be valid. Returns false if the method times out waiting for a packet to be received.

Member Data Documentation

◆ CommunicationError

Event<EventHandler<CommunicationErrorArgs> > com.glneurotech.devices.common.DaqDevice.CommunicationError = new Event<EventHandler<CommunicationErrorArgs>>()

Raised when a communication error has occurred.

◆ GeneralOperationError

Event<EventHandler<EventArgs> > com.glneurotech.devices.common.DaqDevice.GeneralOperationError = new Event<EventHandler<EventArgs>>()

Raised as a notification of a general operational error. Typically, if this event is raised, device operation can still continue.

This event passes the originally thrown exception that can be used to decide further program execution or to notify the end user that a problem has occurred. An example of such a condition is a disk full error when recording incoming data. In this scenario, recording will stop but the device object will continue to receive packets and otherwise operate normally.

◆ SignalBufferOverflowed

Event<EventHandler<SignalDataEventArgs> > com.glneurotech.devices.common.DaqDevice.SignalBufferOverflowed = new Event<EventHandler<SignalDataEventArgs>>()

Indicates that one or more Signals has overflowed its internal buffer

When data is read from a device, the data is stored in Signal objects, each of which use an internal buffer. If data is not read from the signal in a timely manner, the buffer can reach its capacity and a SignalBufferOverflowed event is raised. To avoid this error, subscribe to a SignalGroup's OnDataArrived event and read data from the signal.


The documentation for this class was generated from the following file: