Iedk.h
Go to the documentation of this file.
1 
15 #ifndef IEDK_H
16 #define IEDK_H
17 
18 #ifdef __cplusplus
19 extern "C" {
20 #endif
21 
22 #if (!EDK_STATIC_LIB)
23 # ifdef EDK_EXPORTS
24 # ifdef _WIN32
25 # define EDK_API __declspec(dllexport)
26 # else
27 # if (defined __GNUC__ && __GNUC__ >= 4) || defined __INTEL_COMPILER || defined __clang__
28 # define EDK_API __attribute__ ((visibility("default")))
29 # else
30 # define EDK_API
31 # endif
32 # endif
33 # else
34 # ifdef _WIN32
35 # define EDK_API __declspec(dllimport)
36 # else
37 # define EDK_API
38 # endif
39 # endif
40 #else
41 # include "IEmotivProfile.h"
42 # include "IEmoStatePerformanceMetric.h"
43 # include "IedkOptimization.h"
44 # define EDK_API extern
45 #endif
46 
47 #include "IedkErrorCode.h"
48 #include "IEmoStateDLL.h"
50 #include "MentalCommandDetection.h"
51 
52 
54 
57  typedef void* EmoStateHandle;
58 
59 
61 
64  typedef void* EmoEngineEventHandle;
65 
66 
68  typedef enum IEE_DataChannels_enum {
96 
97 
99 
102  typedef void* DataHandle;
103 
104 
106  typedef enum IEE_Event_enum {
107  IEE_UnknownEvent = 0x0000,
108  IEE_EmulatorError = 0x0001,
109  IEE_ReservedEvent = 0x0002,
110  IEE_UserAdded = 0x0010,
111  IEE_UserRemoved = 0x0020,
113  IEE_ProfileEvent = 0x0080,
121  } IEE_Event_t;
122 
123 
127  int fExists;
128  const char* pszLabel;
129  double xLoc;
130  double yLoc;
131  double zLoc;
133 
134 
136  typedef enum IEE_Detection_enum {
137  DT_BlinkAndWink = 0x0001,
139  DT_EyeMovement = 0x0004,
140  DT_Excitement = 0x0008,
141  DT_Engagement = 0x0010,
142  DT_Relaxation = 0x0020,
143  DT_Interest = 0x0040,
144  DT_Stress = 0x0080,
145  DT_Focus = 0x0100,
146  DT_MentalCommand = 0x0200,
151 
152  } IEE_Detection_t;
153 
154 
169 
170 
172  typedef enum IEE_WindowingTypes_enum {
175  IEE_HANN = 2,
179 
180 
182 
190  EDK_API int
191  IEE_EngineConnect(const char* strDevID = "Emotiv Systems-5");
192 
193 
195 
208  EDK_API int
209  IEE_EngineRemoteConnect(const char* szHost,
210  unsigned short port);
211 
212 
214 
222  EDK_API int
224 
225 
227 
238  EDK_API int
239  IEE_EnableDiagnostics(const char* szFilename,
240  int fEnable,
241  int nReserved);
242 
243 
245 
250  EDK_API EmoEngineEventHandle
252 
253 
255 
258  EDK_API void
259  IEE_EmoEngineEventFree(EmoEngineEventHandle hEvent);
260 
261 
263 
268  EDK_API EmoStateHandle
270 
271 
273 
276  EDK_API void
277  IEE_EmoStateFree(EmoStateHandle hState);
278 
279 
281 
286  EDK_API IEE_Event_t
287  IEE_EmoEngineEventGetType(EmoEngineEventHandle hEvent);
288 
289 
291 
300  EDK_API int
301  IEE_EmoEngineEventGetUserId(EmoEngineEventHandle hEvent,
302  unsigned int *pUserIdOut);
303 
304 
306 
315  EDK_API int
316  IEE_EmoEngineEventGetEmoState(EmoEngineEventHandle hEvent,
317  EmoStateHandle hEmoState);
318 
319 
321 
332  EDK_API int
333  IEE_EngineGetNextEvent(EmoEngineEventHandle hEvent);
334 
335 
337 
348  EDK_API int
349  IEE_EngineClearEventQueue(int eventTypes);
350 
351 
353 
361  EDK_API int
362  IEE_EngineGetNumUser(unsigned int* pNumUserOut);
363 
364 
366 
376  EDK_API int
377  IEE_SetHardwarePlayerDisplay(unsigned int userId,
378  unsigned int playerNum);
379 
380 
382 
406  EDK_API int
407  IEE_GetHeadsetSettings(unsigned int userId,
408  unsigned int* EPOCmode,
409  unsigned int* eegRate,
410  unsigned int* eegRes,
411  unsigned int* memsRate,
412  unsigned int* memsRes);
413 
414 
416 
437  EDK_API int
438  IEE_SetHeadsetSettings(unsigned int userId,
439  unsigned int EPOCmode,
440  unsigned int eegRate,
441  unsigned int eegRes,
442  unsigned int memsRate,
443  unsigned int memsRes);
444 
445 
447 
456  EDK_API int
458  IInputSensorDescriptor_t* pDescriptorOut);
459 
460 
462 
480  EDK_API int
481  IEE_HardwareGetVersion(unsigned int userId,
482  unsigned long* pHwVersionOut);
483 
485 
495  EDK_API int
496  IEE_SoftwareGetVersion(char* pszVersionOut,
497  unsigned int nVersionChars,
498  unsigned long* pBuildNumOut);
499 
500 
502 
511  EDK_API int
512  IEE_HeadsetGetSerialNumber(unsigned int userId,
513  char** pHwSerialOut);
514 
515 
517 
527  EDK_API int
528  IEE_HeadsetGetGyroDelta(unsigned int userId,
529  int* pXOut,
530  int* pYOut);
531 
532 
534 
542  EDK_API int
543  IEE_HeadsetGyroRezero(unsigned int userId);
544 
545 
547  // This handle can be reused by the caller to retrieve subsequent data.
551  EDK_API DataHandle
553 
554 
556 
559  EDK_API void
560  IEE_MotionDataFree(DataHandle hData);
561 
562 
564 
571  EDK_API int
572  IEE_MotionDataUpdateHandle(unsigned int userId,
573  DataHandle hData);
574 
575 
577 
586  EDK_API int
587  IEE_MotionDataGet(DataHandle hData,
588  IEE_MotionDataChannel_t channel,
589  double buffer[],
590  unsigned int bufferSizeInSample);
591 
592 
594 
604  EDK_API int
605  IEE_MotionDataGetMultiChannels(DataHandle hData,
606  IEE_MotionDataChannel_t channels[],
607  unsigned int nChannels,
608  double* buffer[],
609  unsigned int bufferSizeInSample);
610 
611 
613 
620  EDK_API int
621  IEE_MotionDataGetNumberOfSample(DataHandle hData,
622  unsigned int* nSampleOut);
623 
624 
626 
634  EDK_API int
635  IEE_MotionDataSetBufferSizeInSec(float bufferSizeInSec);
636 
637 
639 
645  EDK_API int
646  IEE_MotionDataGetBufferSizeInSec(float* pBufferSizeInSecOut);
647 
648 
650 
657  EDK_API int
658  IEE_MotionDataGetSamplingRate(unsigned int userId,
659  unsigned int* samplingRateOut);
660 
661 
663 
672  EDK_API void
673  IEE_EnableDetections(unsigned long value);
674 
675 
677 
682  EDK_API void
683  IEE_CheckDetectionsEnabled(unsigned long* result);
684 
685 
687 
704  EDK_API int
705  IEE_GetAverageBandPowers(unsigned int userId, IEE_DataChannel_t channel,
706  double* theta, double* alpha, double* low_beta, double* high_beta, double* gamma);
707 
708 
710 
719  EDK_API int
720  IEE_FFTSetWindowingType(unsigned int userId, IEE_WindowingTypes type);
721 
722 
724 
733  EDK_API int
734  IEE_FFTGetWindowingType(unsigned int userId, IEE_WindowingTypes *type);
735 
736 
740 
741 #if defined(__APPLE__)
742 
744 
751  EDK_API bool
752  IEE_EmoInitDevice();
753 
754 #endif
755 
756 #if defined(__APPLE__) || defined(__ANDROID__)
757 
759 
766  EDK_API int
767  IEE_ConnectInsightDevice(int indexDevice);
768 
769 
771 
779  EDK_API void
780  IEE_GetInsightSignalStrength(int* value, int indexDevice);
781 
782 
784 
789  EDK_API int
790  IEE_GetInsightDeviceCount();
791 
792 
794 
802  EDK_API const char*
803  IEE_GetInsightDeviceName(int index);
804 
805 
807 
814  EDK_API void
815  IEE_GetInsightDeviceState(int* state, int index);
816 
817 
819 
827  EDK_API int
828  IEE_ConnectEpocPlusDevice(int indexDevice, bool isSettingMode=false);
829 
830 
832 
840  EDK_API void
841  IEE_GetEpocPlusSignalStrength(int* value, int indexDevice);
842 
843 
845 
850  EDK_API int
851  IEE_GetEpocPlusDeviceCount();
852 
853 
855 
864  EDK_API const char*
865  IEE_GetEpocPlusDeviceName(int index);
866 
867 
869 
876  EDK_API void
877  IEE_GetEpocPlusDeviceState(int* state, int index);
878 
879 #endif
880 
881 #ifdef __cplusplus
882 }
883 #endif
884 #endif // IEDK_H
A profile has been returned from EmoEngine.
Definition: Iedk.h:113
EDK_API int IEE_MotionDataGet(DataHandle hData, IEE_MotionDataChannel_t channel, double buffer[], unsigned int bufferSizeInSample)
Extract data of a particular channel from the data handle.
int fExists
Non-zero if this sensor exists on this headset model.
Definition: Iedk.h:127
EDK_API int IEE_EngineConnect(const char *strDevID="Emotiv Systems-5")
Initialize EmoEngine instance which reads data from the headset.
EDK_API int IEE_FFTSetWindowingType(unsigned int userId, IEE_WindowingTypes type)
Set the current windowing type for band power calculation.
Hann Window.
Definition: Iedk.h:175
IEE_MotionDataChannel_enum
Motion data channel description.
Definition: Iedk.h:156
Timestamp of the motion data stream.
Definition: Iedk.h:167
Sample counter.
Definition: Iedk.h:157
EDK_API int IEE_GetHeadsetSettings(unsigned int userId, unsigned int *EPOCmode, unsigned int *eegRate, unsigned int *eegRes, unsigned int *memsRate, unsigned int *memsRes)
Get headset settings from EPOC+ headset.
EDK_API int IEE_MotionDataUpdateHandle(unsigned int userId, DataHandle hData)
Update the content of the data handle to point to new data since the last call.
Channel Pz.
Definition: Iedk.h:78
enum IEE_DataChannels_enum IEE_DataChannel_t
EEG and system data channel description.
A headset is connected.
Definition: Iedk.h:110
void * EmoEngineEventHandle
Handle to EmoEngine event structure allocated by IEE_EmoEngineEventCreate.
Definition: Iedk.h:64
Synchronisation signal.
Definition: Iedk.h:94
Uniform/rectangular Window.
Definition: Iedk.h:177
EDK_API int IEE_MotionDataGetSamplingRate(unsigned int userId, unsigned int *samplingRateOut)
Get sampling rate of the motion data stream.
Hamming Window.
Definition: Iedk.h:174
EDK_API int IEE_EngineDisconnect()
Terminate the connection to EmoEngine.
void * DataHandle
Handle to data placeholder allocated by IEE_MotionDataCreate.
Definition: Iedk.h:102
EDK_API int IEE_EngineRemoteConnect(const char *szHost, unsigned short port)
Initialize the connection to a remote instance of EmoEngine.
Channel FC6.
Definition: Iedk.h:83
Gyroscope Z-axis.
Definition: Iedk.h:160
Channel F8.
Definition: Iedk.h:85
const char * pszLabel
Text label identifying this sensor.
Definition: Iedk.h:128
Relaxation detection (deprecated)
Definition: Iedk.h:142
Accelerometer X-axis.
Definition: Iedk.h:161
enum IEE_MotionDataChannel_enum IEE_MotionDataChannel_t
Motion data channel description.
Raw contact quality value.
Definition: Iedk.h:71
EDK_API int IEE_SetHeadsetSettings(unsigned int userId, unsigned int EPOCmode, unsigned int eegRate, unsigned int eegRes, unsigned int memsRate, unsigned int memsRes)
Set headset setting for EPOC+ headset.
EDK_API int IEE_SetHardwarePlayerDisplay(unsigned int userId, unsigned int playerNum)
Set the player number display.
EDK_API int IEE_EmoEngineEventGetEmoState(EmoEngineEventHandle hEvent, EmoStateHandle hEmoState)
Copy an EmoState returned with a IEE_EmoStateUpdate event to memory referenced by an EmoStateHandle...
struct IInputSensorDescriptor_struct IInputSensorDescriptor_t
Input sensor description.
enum IEE_WindowingTypes_enum IEE_WindowingTypes
Windowing types enum for Fast Fourier Transform.
Channel F4.
Definition: Iedk.h:84
Channel T8.
Definition: Iedk.h:82
EDK_API EmoStateHandle IEE_EmoStateCreate()
Return a handle to memory that can store an EmoState.
IEE_InputChannels_t channelId
Logical channel id.
Definition: Iedk.h:126
EDK_API int IEE_HeadsetGyroRezero(unsigned int userId)
Re-zero the gyro for a particular user.
enum IEE_Event_enum IEE_Event_t
EmoEngine event types.
Sample counter.
Definition: Iedk.h:69
EDK_API int IEE_FFTGetWindowingType(unsigned int userId, IEE_WindowingTypes *type)
Get the current windowing type for band power calculation.
EDK_API int IEE_MotionDataGetBufferSizeInSec(float *pBufferSizeInSecOut)
Return the size of the motion data buffer.
Marker value from hardware.
Definition: Iedk.h:93
EDK_API int IEE_MotionDataGetNumberOfSample(DataHandle hData, unsigned int *nSampleOut)
Return number of sample of motion data stored in the data handle.
IEE_WindowingTypes_enum
Windowing types enum for Fast Fourier Transform.
Definition: Iedk.h:172
EDK_API void IEE_EmoStateFree(EmoStateHandle hState)
Free memory referenced by an EmoState handle.
Channel P8.
Definition: Iedk.h:81
Input sensor description.
Definition: Iedk.h:125
Channel AF3.
Definition: Iedk.h:72
EmoState timestamp.
Definition: Iedk.h:90
Channel F3.
Definition: Iedk.h:74
Mental command detection.
Definition: Iedk.h:146
A headset has been disconnected.
Definition: Iedk.h:111
#define EDK_API
Definition: Iedk.h:37
EDK_API int IEE_GetAverageBandPowers(unsigned int userId, IEE_DataChannel_t channel, double *theta, double *alpha, double *low_beta, double *high_beta, double *gamma)
Get averge band power values for a channel.
System timestamp.
Definition: Iedk.h:89
Blackman-Harris Window.
Definition: Iedk.h:176
EDK_API int IEE_EmoEngineEventGetUserId(EmoEngineEventHandle hEvent, unsigned int *pUserIdOut)
Retrieve the user ID for IEE_UserAdded and IEE_UserRemoved events.
A IEE_FacialExpressionEvent_t has been returned from EmoEngine.
Definition: Iedk.h:115
Eye movement detection.
Definition: Iedk.h:139
Engagement detection (deprecated)
Definition: Iedk.h:141
Detection results have been updated from EmoEngine.
Definition: Iedk.h:112
Magnetometer Z-axis.
Definition: Iedk.h:166
enum IEE_InputChannels_enum IEE_InputChannels_t
Logical input channel identifiers.
Gyroscope Y-axis.
Definition: Iedk.h:159
Reserved function id.
Definition: Iedk.h:91
Blink and Wink detection.
Definition: Iedk.h:137
enum IEE_Detection_enum IEE_Detection_t
Detection type enumerator.
double xLoc
X coordinate from center of head towards nose.
Definition: Iedk.h:129
Indicate if data is interpolated.
Definition: Iedk.h:70
EDK_API int IEE_MotionDataSetBufferSizeInSec(float bufferSizeInSec)
Set the size of the motion data buffer.
EDK_API EmoEngineEventHandle IEE_EmoEngineEventCreate()
Return a handle to memory that can hold an EmoEngine event.
Gyroscope X-axis.
Definition: Iedk.h:87
Excitement detection (deprecated)
Definition: Iedk.h:140
Accelerometer Z-axis.
Definition: Iedk.h:163
Bit-mask for all events except error types.
Definition: Iedk.h:117
Channel P7.
Definition: Iedk.h:77
void * EmoStateHandle
Handle to EmoState structure allocated by IEE_EmoStateCreate.
Definition: Iedk.h:57
EDK_API DataHandle IEE_MotionDataCreate()
Return a handle to memory that can hold motion data.
Channel O1.
Definition: Iedk.h:79
IEE_Event_enum
EmoEngine event types.
Definition: Iedk.h:106
Focus detection (deprecated)
Definition: Iedk.h:145
IEE_Detection_enum
Detection type enumerator.
Definition: Iedk.h:136
Stress detection (deprecated)
Definition: Iedk.h:144
Gyroscope X-axis.
Definition: Iedk.h:158
EDK_API int IEE_EngineGetNumUser(unsigned int *pNumUserOut)
Retrieve number of active users (headset) connected to the EmoEngine.
EDK_API void IEE_CheckDetectionsEnabled(unsigned long *result)
Check if particular detections are enabled.
Magnetometer Y-axis.
Definition: Iedk.h:165
Interest detection (deprecated)
Definition: Iedk.h:143
EDK_API int IEE_EngineGetNextEvent(EmoEngineEventHandle hEvent)
Retrieve the next EmoEngine event.
Gyroscope Y-axis.
Definition: Iedk.h:88
EDK_API int IEE_HardwareGetVersion(unsigned int userId, unsigned long *pHwVersionOut)
Return the current hardware version of the headset and dongle (if available).
EDK_API int IEE_EnableDiagnostics(const char *szFilename, int fEnable, int nReserved)
Enable diagnostics mode.
EDK_API int IEE_HeadsetGetGyroDelta(unsigned int userId, int *pXOut, int *pYOut)
Return the delta of the movement of the gyro since the previous call for a particular user...
EDK_API int IEE_SoftwareGetVersion(char *pszVersionOut, unsigned int nVersionChars, unsigned long *pBuildNumOut)
Return the current version of the Emotiv SDK.
double yLoc
Y coordinate from center of head towards ears.
Definition: Iedk.h:130
A IEE_MentalCommandEvent_t has been returned from EmoEngine.
Definition: Iedk.h:114
Channel FC5.
Definition: Iedk.h:75
EDK_API IEE_Event_t IEE_EmoEngineEventGetType(EmoEngineEventHandle hEvent)
Return the event type for an event already retrieved using IEE_EngineGetNextEvent().
Magnetometer X-axis.
Definition: Iedk.h:164
Definition: Iedk.h:147
Channel AF4.
Definition: Iedk.h:86
Channel F7.
Definition: Iedk.h:73
Channel T7.
Definition: Iedk.h:76
Channel O2.
Definition: Iedk.h:80
Accelerometer Y-axis.
Definition: Iedk.h:162
Error event from emulator. Connection to EmoComposer could be lost.
Definition: Iedk.h:108
An unknown event.
Definition: Iedk.h:107
EDK_API int IEE_EngineClearEventQueue(int eventTypes)
Clear a specific EmoEngine event type or all events currently inside the event queue.
EDK_API void IEE_EmoEngineEventFree(EmoEngineEventHandle hEvent)
Free memory referenced by an event handle.
double zLoc
Z coordinate from center of head toward top of skull.
Definition: Iedk.h:131
Reserved for internal use.
Definition: Iedk.h:116
Hanning Window.
Definition: Iedk.h:173
EDK_API int IEE_MotionDataGetMultiChannels(DataHandle hData, IEE_MotionDataChannel_t channels[], unsigned int nChannels, double *buffer[], unsigned int bufferSizeInSample)
Extract data of a list of channels from the data handle.
Reserved event.
Definition: Iedk.h:109
EDK_API int IEE_HeadsetGetSensorDetails(IEE_InputChannels_t channelId, IInputSensorDescriptor_t *pDescriptorOut)
Return a struct containing details about a specific channel.
EDK_API void IEE_MotionDataFree(DataHandle hData)
Free memory referenced by a data handle.
EDK_API void IEE_EnableDetections(unsigned long value)
Enable/disable particular detections.
Other facial expression detection.
Definition: Iedk.h:138
Reserved function value.
Definition: Iedk.h:92
EDK_API int IEE_HeadsetGetSerialNumber(unsigned int userId, char **pHwSerialOut)
Return the current serial number of the headset (if available).
IEE_DataChannels_enum
EEG and system data channel description.
Definition: Iedk.h:68