Skip to content
This repository was archived by the owner on Nov 7, 2025. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
5 changes: 3 additions & 2 deletions examples/contact/contact.c
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@ int main(int argc, char **argv)
printf("Connected to headset.\n");

if (emokit_read_data(d)<=0) {
printf("Error reading from headset\n");
fprintf(stdout,"Error reading from headset\n");
fflush(stdout);
emokit_close(d);
emokit_delete(d);
return 1;
Expand All @@ -51,7 +52,7 @@ int main(int argc, char **argv)
while (!quit) {
if(emokit_read_data(d) > 0) {
c = emokit_get_next_frame(d);
fprintf(stdout,"\033[H\033[2JPress CTRL+C to exit\n\nContact quality:\nF3 %4d\nFC6 %4d\nP7 %4d\nT8 %4d\nF7 %4d\nF8 %4d\nT7 %4d\nP8 %4d\nAF4 %4d\nF4 %4d\nAF3 %4d\nO2 %4d\nO1 %4d\nFC5 %4d",c.cq.F3, c.cq.FC6, c.cq.P7, c.cq.T8,c.cq.F7, c.cq.F8, c.cq.T7, c.cq.P8, c.cq.AF4, c.cq.F4, c.cq.AF3, c.cq.O2, c.cq.O1, c.cq.FC5);
fprintf(stdout,"\033[H\033[2JPress CTRL+C to exit\n\nContact quality:\nAF3 %4d\tAF4 %4d\n F3 %4d\t F4 %4d\n F7 %4d\t F8 %4d\nFC5 %4d\tFC6 %4d\n T7 %4d\t T8 %4d\n P7 %4d\t P8 %4d\n O1 %4d\t O2 %4d\n",c.cq.AF3, c.cq.AF4, c.cq.F3, c.cq.F4, c.cq.F7, c.cq.F8, c.cq.FC5, c.cq.FC6, c.cq.T7, c.cq.T8, c.cq.P7, c.cq.P8, c.cq.O1, c.cq.O2, c.cq.FC5);
fflush(stdout);
}
}
Expand Down
14 changes: 10 additions & 4 deletions include/emokit/emokit.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,16 @@
#define EMOKIT_DECLSPEC __declspec(dllexport)
#endif

/// Vendor ID for all emotiv devices
const static uint32_t EMOKIT_VID = 0x21a1;
/// Product ID for all emotiv devices
const static uint32_t EMOKIT_PID = 0x0001;

// idVendor 0x1234 Unknown
// idProduct 0xed02 Emotiv EPOC Developer Headset Wireless Dongle

/// Vendor ID
//const static uint32_t EMOKIT_VID = 0x21a1;
const static uint32_t EMOKIT_VID = 0x1234;
/// Product ID
//const static uint32_t EMOKIT_PID = 0x0001;
const static uint32_t EMOKIT_PID = 0xed02;

/// Out endpoint for all emotiv devices
const static uint32_t EMOKIT_OUT_ENDPT = 0x02;
Expand Down
2 changes: 1 addition & 1 deletion linux/epoc.rules
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,5 @@ ATTR{manufacturer}=="Emotiv Systems Pty Ltd", ATTRS{product}=="Receiver Dongle L
#SUBSYSTEM=="hidraw", ATTRS{idVendor}=="21a1", ATTRS{idProduct}=="0001", ATTRS{interface}=="Emotiv RAW DATA", NAME="eeg/encrypted%n", SYMLINK+="eeg/encrypted", MODE="0444", RUN +="decrypt_emotiv.sh consumer"

#Research headset
SUBSYSTEM=="hidraw", ATTRS{interface}=="Emotiv RAW DATA", NAME="eeg/encrypted%n", SYMLINK+="eeg/encrypted", MODE="0444", RUN +="decrypt_emotiv.sh research"
SUBSYSTEM=="hidraw", ATTRS{interface}=="Emotiv RAW DATA", NAME="eeg/encrypted%n", SYMLINK+="eeg/encrypted", MODE="0666"

2 changes: 1 addition & 1 deletion python/emotiv.py
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ def getLinuxSetup(self):
with open(input[0] + "/manufacturer", 'r') as f:
manufacturer = f.readline()
f.close()
if "Emotiv Systems Inc." in manufacturer:
if "Emotiv Systems" in manufacturer:
with open(input[0] + "/serial", 'r') as f:
serial = f.readline().strip()
f.close()
Expand Down
11 changes: 11 additions & 0 deletions src/emokit.c
Original file line number Diff line number Diff line change
Expand Up @@ -140,14 +140,25 @@ int emokit_open(struct emokit_device* s, int device_vid, int device_pid, unsigne
struct hid_device_info* device_cur;
if (!s->_is_inited)
{
printf("Not initted!\n");
return E_EMOKIT_NOT_INITED;
}
devices = hid_enumerate(device_vid, device_pid);

if (!devices) {
printf("No devices! vid: %x pid: %x index: %d\n", device_vid, device_pid, device_index);
}

device_cur = devices;
while(device_cur) {
if(count == device_index) {
printf("Opening %s\n",device_cur->path);
s->_dev = hid_open_path(device_cur->path);
if(!s->_dev) {
printf("Failed.\n");
} else {
printf("Success!");
}
break;
}
++count;
Expand Down