Skip to content

CNBI advancements on eegdev plugin APIv5. master branch #2

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 23 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
6cb3f6c
Final version extended with plugins BARV BBT and GTECENET
serafperd Mar 10, 2015
ce34a0c
Applied Dejan Latinovic's patch as workaround for the bug in bison th…
serafperd Nov 2, 2015
c90840a
Fixes to gtecnet plugin. FInal fixes based on GTec support feedback p…
Nov 3, 2015
20cd822
Fixed bug on gHIamp channel labels. Changed TP7 to the correct PO7
Nov 3, 2015
e6eb3e4
Fixed biosemi bug: Incorrectly the 64 label map was always used. in f…
Nov 3, 2015
98831de
Ficed bug: Option lowpasspass changed to the correct lowpass
Nov 3, 2015
5b55fff
Made device bluetooth address an option ratehr than hardcoded. Update…
serafperd Nov 3, 2015
5e1c17d
Added semicolon : as possible text in bison parser, so that bluetooth…
serafperd Nov 5, 2015
77c2fc7
Moved set_capabilities of BBT plugin just before the reding thred is …
serafperd Nov 5, 2015
d624ea7
Eliminated another buf in eeglabel32 for the biosemi plugin: channel …
Nov 9, 2015
b68f9a4
Continuing debugging of bbt.c
serafperd Nov 10, 2015
2c5c326
Changed the labels of the BBT plugin so that when saved files are loa…
serafperd Nov 14, 2015
c94c38f
Simply reverted the channel number to 1 instead of 6 (used for the bB…
serafperd Nov 14, 2015
296c8fc
Supported gNautilus in gtecnet plugin with minimal configuration. Fix…
Nov 16, 2015
b075607
Cganged reading rate to 4 Hz (for samplong freqs multiple of 2) which…
Feb 23, 2016
a1800e4
First versino fo arduino plugin. Still debugging
Mar 11, 2016
9bd2689
Added arduino.c
Mar 11, 2016
ff59991
Added backend for reading an analog input from an Arduino board (eegd…
serafperd Mar 13, 2016
82e1008
Changed HIamp channel map to the one used in SUVA. TP9 TP10 replaced …
serafperd Mar 30, 2016
a2e88d8
Fixed gtecnet plugin after update from gTec fixing the gNEEDaccess se…
serafperd May 17, 2016
dee79c4
Added in datafile plugin extra electrode names for correct labels in …
serafperd May 23, 2016
d329264
Fixed scales to 1.0 instead of dResolutions. This seems to have been …
serafperd Jun 3, 2016
b925a72
Reinstated the dResolutions for barv plugin (it seems to be the chann…
Aug 12, 2016
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
63 changes: 62 additions & 1 deletion configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,64 @@ AC_SUBST([TIA_LIBS], "$LIBS")
LIBS=$save_LIBS


# BrainProducts RDA (Recorder/RecView) support
save_LIBS=$LIBS
AC_ARG_WITH([barv], AC_HELP_STRING([--with-barv],
[Support BrainProducts RDA (Recorder/RecView) backend @<:@default=check@:>@]),
[], [with_barv=check])
AS_IF([test "x$with_barv" != xno],
[AC_SEARCH_LIBS([pthread_create], [pthread], [barv_support=yes],
[barv_support=no; if test "x$with_barv" != xcheck; then
AC_MSG_FAILURE([the pthread library is required for BrainProducts RDA (Recorder/RecView) support])
fi])], [barv_support=no])
AM_CONDITIONAL([BARV_SUPPORT], [test "x$barv_support" = xyes])
AC_SUBST([BARV_LIBS], "$LIBS")
LIBS=$save_LIBS

# BBT support
save_LIBS=$LIBS
AC_ARG_WITH([bbt], AC_HELP_STRING([--with-bbt],
[Support for BBT backend @<:@default=no@:>@]),
[], [with_bbt=no])
AS_IF([test "x$with_bbt" != xno],
AC_SEARCH_LIBS([str2ba], [bluetooth], [bbt_support=yes],
[bbt_support=no; if test "x$with_bbt" != xcheck; then
AC_MSG_FAILURE([bluetooth library required for BBT support])
fi]), [bbt_support=no])
AM_CONDITIONAL([BBT_SUPPORT], [test "x$bbt_support" = xyes])
AC_SUBST([BBT_LIBS], "$LIBS")
LIBS=$save_LIBS

# gTecNet support
save_LIBS=$LIBS
AC_ARG_WITH([gtecnet], AC_HELP_STRING([--with-gtecnet],
[Support for gTecNet backend @<:@default=no@:>@]),
[], [with_gtecnet=no])
AS_IF([test "x$with_gtecnet" != xno],
AC_SEARCH_LIBS([gtecnal_StartAcquisition], [gtecnalang], [gtecnet_support=yes],
[gtecnet_support=no; if test "x$with_gtecnet" != xcheck; then
AC_MSG_FAILURE([libgtecnalang library required for gtecnet support])
fi]), [gtecnet_support=no])
AM_CONDITIONAL([GTECNET_SUPPORT], [test "x$gtecnet_support" = xyes])
AC_SUBST([GTECNET_LIBS], "$LIBS")
LIBS=$save_LIBS


# Arduino support
save_LIBS=$LIBS
AC_ARG_WITH([arduino], AC_HELP_STRING([--with-arduino],
[Support for Arduino backend @<:@default=no@:>@]),
[], [with_arduino=no])
AS_IF([test "x$with_arduino" != xno],
AC_SEARCH_LIBS([pthread_create], [pthread], [arduino_support=yes],
[arduino_support=no; if test "x$with_arduino" != xcheck; then
AC_MSG_FAILURE([pthread library required for arduino support])
fi]), [arduino_support=no])
AM_CONDITIONAL([ARDUINO_SUPPORT], [test "x$arduino_support" = xyes])
AC_SUBST([ARDUINO_LIBS], "$LIBS")
LIBS=$save_LIBS


AX_DEFINE_DIR([LIBDIR], [libdir], [Installed library path])
AX_DEFINE_DIR([SYSCONFDIR], [sysconfdir], [System configuration files path])

Expand Down Expand Up @@ -193,5 +251,8 @@ Configuration summary
gTec support : $gtec_support
Neurosky support : $neurosky_support
TobiIA support : $tia_support
BARV support : $barv_support
BBT support : $bbt_support
gTecNet support : $gtecnet_support
Arduino support : $arduino_support
"

19 changes: 18 additions & 1 deletion doc/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ MANPAGES = egd_get_data.3 egd_get_available.3 \

EXTRA_DIST = $(MANPAGES) \
eegdev-biosemi.5 eegdev-datafile.5 \
eegdev-neurosky.5 eegdev-gtec.5 eegdev-tobiia.5
eegdev-neurosky.5 eegdev-gtec.5 eegdev-tobiia.5 \
eegdev-bbt.5 eegdev-barv.5
man_MANS =

if BUILD_CORELIB
Expand All @@ -38,3 +39,19 @@ endif
if TIA_SUPPORT
man_MANS += eegdev-tobiia.5
endif

if BBT_SUPPORT
man_MANS += eegdev-bbt.5
endif

if BARV_SUPPORT
man_MANS += eegdev-barv.5
endif

if GTECNET_SUPPORT
man_MANS += eegdev-gtecnet.5
endif

if ARDUINO_SUPPORT
man_MANS += eegdev-arduino.5
endif
24 changes: 24 additions & 0 deletions doc/eegdev-arduino.5
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
.\"Copyright 2012 (c) EPFL
.TH EEGDEV-ARDUINO 5 2016 "EPFL" "EEGDEV library manual"
.SH NAME
eegdev-arduino - eegdev backend for an Arduino board, single channel A0 analog input
.SH DESCRIPTION
.LP
The \fBarduino\fP plugin implements the eegdev backend for acquistion from a single analog
input of an Arduino Mega board. Data acquisition is USB serial.
.SH CONFIGURATION
.LP
This plugin supports two options. The default value will be used
if none of the configuration files nor the configuration string (see
\fBegd_open\fP(3)) specify the option.
.TP
.B port
Serial port to read from. The default value is /dev/ttyACM0.
.TP
.B refmv
Reference voltage of the Arduino board. This is also the maximum voltage that can be measured. It has to be set also on the Arduino board side.
.TP
.SH "SEE ALSO"
.BR egd_open (3),
.BR eegdev-options (5)

35 changes: 35 additions & 0 deletions doc/eegdev-barv.5
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
.\"Copyright 2014 (c) EPFL
.TH EEGDEV-BARV 5 2014 "EPFL" "EEGDEV library manual"
.SH NAME
eegdev-barv - eegdev backend for BrainAmp RDA server
.SH DESCRIPTION
.LP
The \fBbarv\fP plugin implements the backend for the eegdev library for
BrainAmp Recorder and RecView RDA servers.
.SH CONFIGURATION
.LP
This plugin supports two options. The default values will be used
if none of the configuration files nor the configuration string (see
\fBegd_open\fP(3)) specify the option.
.TP
.B host
IP address of the machine running the Recorder/RecView software and doing
the actual data acquisition. The default value is 10.66.99.11.
.TP
.B port
Port number of the acquisition socket. This option is critical as it will
specify automatically whether eegdev will receive data from the Recorder in
float format (51234), in integer format (51244) or from the RecView (51254).
The default value is 51254.
.SH FILES
.IP "/etc/eegdev/eegdev.conf" 4
.PD
Shared configuration file.
.IP "/etc/eegdev/biosemi.conf" 4
.PD
Configuration file loaded when the plugin is used. The settings specified
here overrides the settings in the shared configuration file.
.SH "SEE ALSO"
.BR egd_open (3),
.BR eegdev-options (5)

24 changes: 24 additions & 0 deletions doc/eegdev-bbt.5
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
.\"Copyright 2012 (c) EPFL
.TH EEGDEV-BBT 5 2012 "EPFL" "EEGDEV library manual"
.SH NAME
eegdev-bbt - eegdev backend for BitBrain Technologies dry electrode cap
.SH DESCRIPTION
.LP
The \fBbbt\fP plugin implements the backend for the eegdev library for
a custom BitBrain Technologies dry electrode cap, custom made for CNBI EPFL
and NISSAN.The cap supports 16 EEG channels (contact CNBI for electrode placement
in the 10-20 system), 6 EMG channels and 1 trigger input channel. Data acquisition
is wireless (bluetooth).
.SH CONFIGURATION
.LP
This plugin supports a single option. The default value will be used
if none of the configuration files nor the configuration string (see
\fBegd_open\fP(3)) specify the option.
.TP
.B address
Device bluetooth address of the BBT cap. The default value is 00:06:66:A0:4D:B7.
.TP
.SH "SEE ALSO"
.BR egd_open (3),
.BR eegdev-options (5)

63 changes: 63 additions & 0 deletions doc/eegdev-gtecnet.5
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
.\"Copyright 2015 (c) EPFL
.TH EEGDEV-GTEC 5 2015 "EPFL" "EEGDEV library manual"
.SH NAME
eegdev-gtecnet - eegdev backend for g.tec g.NEEDaccess server software.
.SH DESCRIPTION
.LP
The \fBgtecnet\fP plugin implements the backend for the eegdev library for
the g.NEEDaccess server which is able to stream data from following g.tec EEG amplifiers: g.USBamp, g.HIamp and g.Nautilus.
\fBAttention:\fP so far only the g.HIamp is implemented.
.SH CONFIGURATION
.LP
This plugin supports several options. The default values will be used
if neither a configuration file nor the configuration string (see
\fBegd_open\fP(3)) specifies the options.
.TP
.B hostIP
Network IP of the g.NEEDaccess server. Default value: "192.168.1.1".
.TP
.B hostport
Communication port on the g.NEEDaccess server. Default value: "50223".
.TP
.B localIP
Network IP of the local computer. Default value: "192.168.1.10".
.TP
.B localport
Communication port on the g.NEEDaccess server. Make sure that the port is open -> check iptables. Default value: "50220".
.TP
.B samplerate
Desired sampling frequency used to acquire the data. Supported sampling rates are:

g.USBamp [32;64;128;256;512;600;1200;2400;4800;9600;19200;38400]
.br
g.HIamp [256;512;600;1200;2400;4800;9600;19200;38400]
.br
g.Nautilus [250;500]

Default value: "512".
.TP
.B bandpass
Filter ID of desired hardware bandpass filter. \fBAttention:\fP Filter ID depends on cutoff frequencies, sampling rate and filter order. Please use the
table provided at /mnt/shared/software/third/gtec/g.NEEDaccess_DataServer/g.NEEDaccess - Device Filter Lists.xlsx. The option "no filtering" is encoded by the ID "-1". Default value: "32" (= 512 Hz -> 0.01 - 100 Hz).
.TP
.B notch
Filter ID of desired hardware bandpass filter. \fBAttention:\fP Filter ID depends on central frequency, sampling rate and filter order. Please use the
table provided at /mnt/shared/software/third/gtec/g.NEEDaccess_DataServer/g.NEEDaccess - Device Filter Lists.xlsx. The option "no filtering" is encoded by the ID "-1". Default value: "4" (= 512 Hz -> 48 - 52 Hz).
.TP
.B usedefmap
Boolean flag determining whether the default (most common) CNBI electrode configurations should be used for each device. "1" (true) enforces default maps (per CNBI conventions) and "0" labels the channels arithmetically (1:N). This option only affects the channel labels as appearing in the eegview scope and elsewhere. Default value: "1" (use default CNBI 10-20 configurations).


.SH FILES
.IP "/etc/eegdev/eegdev.conf" 4
.PD
Shared configuration file.
.IP "/etc/eegdev/gtecnet.conf" 4
.PD
Configuration file loaded when the \fBgtecnet\fP plugin is used. The
settings specified here overrides the settings in the shared configuration
file.
.SH "SEE ALSO"
.BR egd_open (3),
.BR eegdev-options (5)

63 changes: 63 additions & 0 deletions doc/eegdev-gtecnet.5~
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
.\"Copyright 2015 (c) EPFL
.TH EEGDEV-GTEC 5 2015 "EPFL" "EEGDEV library manual"
.SH NAME
eegdev-gtecnet - eegdev backend for g.tec g.NEEDaccess server software.
.SH DESCRIPTION
.LP
The \fBgtecnet\fP plugin implements the backend for the eegdev library for
the g.NEEDaccess server which is able to stream data from following g.tec EEG amplifiers: g.USBamp, g.HIamp and g.Nautilus.
\fBAttention:\fP so far only the g.HIamp is implemented.
.SH CONFIGURATION
.LP
This plugin supports several options. The default values will be used
if neither a configuration file nor the configuration string (see
\fBegd_open\fP(3)) specifies the options.
.TP
.B hostIP
Network IP of the g.NEEDaccess server. Default value: "192.168.1.1".
.TP
.B hostport
Communication port on the g.NEEDaccess server. Default value: "50223".
.TP
.B localIP
Network IP of the local computer. Default value: "192.168.1.10".
.TP
.B localport
Communication port on the g.NEEDaccess server. Make sure that the port is open -> check iptables. Default value: "50220".
.TP
.B samplerate
Desired sampling frequency used to acquire the data. Supported sampling rates are:

g.USBamp [32;64;128;256;512;600;1200;2400;4800;9600;19200;38400]
.br
g.HIamp [256;512;600;1200;2400;4800;9600;19200;38400]
.br
g.Nautilus [250;500]

Default value: "512".
.TP
.B bandpass
Filter ID of desired hardware bandpass filter. \fBAttention:\fP Filter ID depends on cutoff frequencies, sampling rate and filter order. Please use the
table provided at /mnt/shared/software/third/gtec/g.NEEDaccess_DataServer/g.NEEDaccess - Device Filter Lists.xlsx. The option "no filtering" is encoded by the ID "-1". Default value: "32" (= 512 Hz -> 0.01 - 100 Hz).
.TP
.B notch
Filter ID of desired hardware bandpass filter. \fBAttention:\fP Filter ID depends on central frequency, sampling rate and filter order. Please use the
table provided at /mnt/shared/software/third/gtec/g.NEEDaccess_DataServer/g.NEEDaccess - Device Filter Lists.xlsx. The option "no filtering" is encoded by the ID "-1". Default value: "4" (= 512 Hz -> 48 - 52 Hz).
.TP
.B usedefmap
Boolean flag determining whether the default (most common) CNBI electrode configurations should be used for each device. "1" (true) enforces default maps (per CNBI conventions) and "0" labels the channels arithmetically (1:N). This option only affects the channel labels as appearing in the eegview scope and elsewhere. Default value: "1" (use default CNBI 10-20 configurations).


.SH FILES
.IP "/etc/eegdev/eegdev.conf" 4
.PD
Shared configuration file.
.IP "/etc/eegdev/gtecnet.conf" 4
.PD
Configuration file loaded when the \fBgtecnet\fP plugin is used. The
settings specified here overrides the settings in the shared configuration
file.
.SH "SEE ALSO"
.BR egd_open (3),
.BR eegdev-options (5)

79 changes: 79 additions & 0 deletions doc/egd_open.3
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
.\"Copyright 2011 (c) EPFL
.TH EGD_OPEN 3 2010 "EPFL" "EEGDEV library manual"
.SH NAME
egd_open - Open an EEG device
.SH SYNOPSIS
.LP
.B #include <eegdev.h>
.sp
.BI "struct eegdev* egd_open(const char* " devstring ");"
.br
.SH DESCRIPTION
.LP
\fBegd_open\fP() opens a EEG device according to the \fIdevstring\fP
description. If \fIdevstring\fP is NULL, the first device supported by the
library will be opened.
.LP
The \fIdevstring\fP argument specifies the type of EEG device required to be
opened and the parameters parameters which the system should be configured
with (overriding defaults settings). The syntax of the string is defined in
\fBeegdev-open-options\fP(5).
.LP
The syntax may change in future releases and programs should not rely on it
to configure the device. It is provided only to users of the programs to
select the EEG acquisition device and configure it. Programs using the
eegdev library should pass the string provided by the users untouched.
.LP
\fIdevstring\fP is not the only way to provides configuration information
about the device to open. The configuration is read from the configuration
files. The final values of the settings provided to the opening function are
defined (and overriden) in the following order:
.IP " *" 3
default values
.IP " *" 3
shared configuration file
.IP " *" 3
device specific configuration file
.IP " *" 3
\fIdevstring\fP
.LP
This order indicates that a setting value specified in \fIdevstring\fP
will always override any setting value defined by other mean.
.SH "RETURN VALUE"
.LP
The function returns a pointer to the opened EEG device in case of success.
Otherwise NULL is returned \fIerrno\fP is set accordingly.
.SH ERRORS
.LP
\fBegd_open\fP() will fail if:
.TP
.B ENOSYS
the device part of \fIdevstring\fP does not refer to a device supported by
any of the installed eegdev plugin modules.
.TP
.B EINVAL
one of the option specified in \fIdevstring\fP is unknown.
.TP
.B ENODEV
The specified device is not connected.
.TP
.B EBUSY
The specified device is already in use.
.TP
.B ECHILD
The specified device needs an auxiliary child process whose executable
file cannot be found.
.SH ENVIRONMENT
.IP "\fBEEGDEV_PLUGINS_DIR\fP" 4
.PD
This variable controls which folder should be search to find plugin modules.
If unset, they will be searched in the subfolder \fBeegdev\fP of the
installation folder of the libraries.
.IP "\fBEEGDEV_CONF_DIR\fP" 4
.PD
This variable controls which folder should be search to find the
configuration files. If unset, they will be searched in
\fB/usr/local/etc/eegdev\fP.
.SH "SEE ALSO"
.BR egd_close (3),
.BR eegdev-open-options (5)
Loading