-
Notifications
You must be signed in to change notification settings - Fork 1
/
IEegData.h
236 lines (188 loc) · 6 KB
/
IEegData.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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
/**
* Emotiv SDK
* Copyright (c) 2016 Emotiv Inc.
*
* This file is part of the Emotiv SDK.
*
* Header file for EEG data related API.
*
*/
#ifndef IEEGDATA_H
#define IEEGDATA_H
#ifdef __cplusplus
extern "C" {
#endif
#if (!EDK_STATIC_LIB)
# ifdef EDK_EXPORTS
# ifdef _WIN32
# define EDK_API __declspec(dllexport)
# else
# if (defined __GNUC__ && __GNUC__ >= 4) || defined __INTEL_COMPILER || defined __clang__
# define EDK_API __attribute__ ((visibility("default")))
# else
# define EDK_API
# endif
# endif
# else
# ifdef _WIN32
# define EDK_API __declspec(dllimport)
# else
# define EDK_API
# endif
# endif
#else
#define EDK_API extern
#endif
#include "Iedk.h"
//! Handle to data placeholder allocated by IEE_DataCreate.
/*!
\sa IEE_DataCreate()
*/
typedef void * DataHandle;
//! Return a handle to memory that can hold EEG data.
/*!
This handle can be reused by the caller to retrieve subsequent data.
\remark Only available in SDK Premium Edition.
\return DataHandle
*/
EDK_API DataHandle
IEE_DataCreate();
//! Free memory referenced by a data handle.
/*!
\remark Only available in SDK Premium Edition.
\param hData - a handle returned by IEE_DataCreate()
*/
EDK_API void
IEE_DataFree(DataHandle hData);
//! Update the content of the data handle to point to new data since the last call.
/*!
\remark Only available in SDK Premium Edition.
\param userId - user ID
\param hData - a handle returned by IEE_DataCreate()
\return EDK_ERROR_CODE
- EDK_OK if successful
*/
EDK_API int
IEE_DataUpdateHandle(unsigned int userId,
DataHandle hData);
//! Extract data of a particulat channel from the data handle.
/*!
\remark Only available in SDK Premium Edition.
\param hData - a handle returned by IEE_DataCreate()
\param channel - channel that you are interested in
\param buffer - pre-allocated buffer
\param bufferSizeInSample - size of the pre-allocated buffer
\return EDK_ERROR_CODE
- EDK_OK if successful
*/
EDK_API int
IEE_DataGet(DataHandle hData,
IEE_DataChannel_t channel,
double buffer[],
unsigned int bufferSizeInSample);
//! Extract data of a list of channels from the data handle.
/*!
\remark Only available in SDK Premium Edition.
\param hData - a handle returned by IEE_DataCreate()
\param channels - a list of channel that you are interested in
\param nChannels - number of channels in the channel list
\param buffer - pre-allocated 2 dimensional buffer, has to be nChannels x bufferSizeInSample
\param bufferSizeInSample - size of the pre-allocated buffer for each channel
\return EDK_ERROR_CODE
- EDK_OK if successful
*/
EDK_API int
IEE_DataGetMultiChannels(DataHandle hData,
IEE_DataChannel_t channels[],
unsigned int nChannels,
double * buffer[],
unsigned int bufferSizeInSample);
//! Return number of sample of data stored in the data handle.
/*!
\remark Only available in SDK Premium Edition.
\param hData - a handle returned by IEE_DataCreate()
\param nSampleOut - receives the number of sample of data stored in the data handle
\return EDK_ERROR_CODE
- EDK_OK if successful
*/
EDK_API int
IEE_DataGetNumberOfSample(DataHandle hData,
unsigned int * nSampleOut);
//! Set the size of the data buffer.
/*!
The size of the buffer affects how frequent IEE_DataUpdateHandle() needs to be called to prevent data loss.
\remark Only available in SDK Premium Edition.
\param bufferSizeInSec - buffer size in second
\return EDK_ERROR_CODE
- EDK_OK if successful
*/
EDK_API int
IEE_DataSetBufferSizeInSec(float bufferSizeInSec);
//! Return the size of the data buffer.
/*!
\remark Only available in SDK Premium Edition.
\param pBufferSizeInSecOut - receives the size of the data buffer
\return EDK_ERROR_CODE
- EDK_OK if successful
*/
EDK_API int
IEE_DataGetBufferSizeInSec(float * pBufferSizeInSecOut);
//! Control data acquisition inside EmoEngine (disabled by default).
/*!
\remark Only available in SDK Premium Edition.
\param userId - user ID
\param enable - enable if true
\return EDK_ERROR_CODE
- EDK_OK if the command succeeded
*/
EDK_API int
IEE_DataAcquisitionEnable(unsigned int userId,
bool enable);
//! Check if data acquisition is enabled.
/*!
\remark Only available in SDK Premium Edition.
\param userId - user ID
\param pEnableOut - get whether data acquisition is enabled
\return EDK_ERROR_CODE
- EDK_OK if the command succeeded
*/
EDK_API int
IEE_DataAcquisitionIsEnabled(unsigned int userId,
bool * pEnableOut);
//! Insert sychronization signal to the data stream.
/*!
\remark Only available in SDK Premium Edition.
\param userId - user ID
\param signal - value of the sychronization signal
\return EDK_ERROR_CODE
- EDK_OK if the command succeeded
*/
EDK_API int
IEE_DataSetSychronizationSignal(unsigned int userId,
int signal);
//! Insert marker to the data stream.
/*!
\remark Only available in SDK Premium Edition.
\param userId - user ID
\param marker - value of the marker
\return EDK_ERROR_CODE
- EDK_OK if the command succeeded
*/
EDK_API int
IEE_DataSetMarker(unsigned int userId,
int marker);
//! Get sampling rate of the EEG data stream.
/*!
\remark Only available in SDK Premium Edition.
\param userId - user ID
\param samplingRateOut - receives the sampling rate
\return EDK_ERROR_CODE
- EDK_OK if the command succeeded
*/
EDK_API int
IEE_DataGetSamplingRate(unsigned int userId,
unsigned int * samplingRateOut);
#ifdef __cplusplus
}
#endif
#endif // IEEGDATA_H