forked from willpan/WinlabEEG
-
Notifications
You must be signed in to change notification settings - Fork 0
/
emotiv.h
50 lines (41 loc) · 909 Bytes
/
emotiv.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#ifndef EMOTIV_H
#define EMOTIV_H
/* Linux */
#include <linux/types.h>
#include <linux/input.h>
#include <linux/hidraw.h>
/* Unix */
#include <sys/ioctl.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <unistd.h>
/* C */
#include <stdio.h>
#include <string.h>
#include <errno.h>
/* Libudev */
#include <libudev.h>
#include <stdlib.h>
#include <locale.h>
#include <unistd.h>
/* OpenSSL */
#include <openssl/aes.h>
//#define HIDIOCSFEATURE(len) _IOC(_IOC_WRITE|_IOC_READ, 'H', 0x06, len)
//#define HIDIOCGFEATURE(len) _IOC(_IOC_WRITE|_IOC_READ, 'H', 0x07, len)
class emotiv
{
public:
emotiv();
emotiv(unsigned char *);
unsigned char * readBuffer();
void setKey(unsigned char *);
unsigned char buffer[32];
private:
void decrypt(unsigned char *in, unsigned char *out);
unsigned char * key;
AES_KEY decryptKey;
int filedescriptor;
int res;
};
#endif