Update resources for SDK version 3.2.0.

- Document
- Header files
- SDK license
- Emocomposer.
- SDK Windows Changelogs file
Esse commit está contido em:
HoangPham
2015-10-05 12:12:27 +07:00
commit 9d600f12f0
13 arquivos alterados com 2076 adições e 0 exclusões
+71
Ver Arquivo
@@ -0,0 +1,71 @@
Software Development Kit License Agreement
Thank you for purchasing an EMOTIV headset. The headset is bundled with an End User License Agreement and this Software Development Kit License Agreement.
1. Some Definitions for this Agreement
1.1 “EMOTIV” means EMOTIV, Inc., a Delaware corporation, with its principal place of business at 490 Post Street, San Francisco, CA 94102, USA.
1.2 “SDK” means the Software Development Kit that comes bundled with your purchase of an EMOTIV headset, which is either the Basic SDK or the Enhanced SDK.
1.3 “Basic SDK” means the SDK that comes with your purchase of a standard EMOTIV headset. A standard EMOTIV headset gives you access to EMOTIVs Detection Suites: Mental Commands, Performance Metrics & Emotional States, and Facial Expressions. A standard EMOTIV headset does not give you EEG access.
1.4 “Enhanced SDK” means the SDK that comes with your purchase of an EMOTIV headset with EEG access. An EMOTIV headset with EEG access gives you access to EMOTIVs Detection Suites, and also includes EEG firmware providing real-time display of unencrypted raw EEG data stream. EEG apps will only work with EEG enabled devices.
1.5 “SDK License Agreement” means this agreement, which contains the terms under which the SDK is licensed to you and under which you may develop and distribute applications to use with an EMOTIV headset.
1.6 “EULA” means your EMOTIV End User License Agreement, which is incorporated into this SDK License Agreement. Your EULA and any corresponding license fee will depend on the type of licensing arrangement with EMOTIV that you select.
2. SDK License Tiers
2.1 There are six SDK license tiers. Please refer to the EMOTIV Developer Page for information concerning the features, cost, registration process, beta testing guidelines, and application release guidelines applicable to each tier.
3. Accepting this SDK License Agreement
3.1 In order to use the SDK, you must first accept this SDK License Agreement and pay the charge, if any, applicable to your SDK license tier. You do not have to accept this SDK License Agreement in order to use your EMOTIV headset, but you may not use the SDK until you have accepted this SDK License Agreement and made any payment applicable to your SDK license tier.
3.2 By clicking to accept, you agree to the terms of this SDK License Agreement, which creates a legally binding contract between you and EMOTIV in relation to your use of the SDK.
3.3 You may not accept the SDK License Agreement and you may not use the SDK if you are a person barred from receiving the SDK under the laws of the United States or other relevant countries, including the country in which you are resident or in which you use the SDK.
3.4 If you are agreeing to be bound by this SDK License Agreement on behalf of another entity, for example your employer, you represent and warrant that you have full legal authority to bind that entity to this SDK License Agreement. If you do not have that authority, you may not accept the SDK License Agreement or use the SDK on behalf of that entity.
4. Your SDK License from EMOTIV
4.1 Subject to the terms and conditions of this SDK License Agreement, EMOTIV grants you a limited, worldwide, nonexclusive, non-transferrable or assignable license to use the SDK solely to develop applications to be paired with an EMOTIV headset. You may not use the SDK for any other purpose.
4.2 Your SDK license is linked to the EMOTIV hardware device you have purchased.
4.3 The terms of this SDK License Agreement include any registration, beta testing, and release requirements and restrictions applicable to your SDK license tier as set forth on the EMOTIV Developer Page.
4.4 EMOTIV or third parties own all legal right, title, and interest in and to the SDK, including any rights under patent law, copyright law, trade secret law, trademark law, and any other proprietary rights that subsist in the SDK. EMOTIV reserves all rights not expressly granted to you.
4.5 You may not take any actions that may cause or result in the fragmentation of the SDK, including but not limited to distributing, participating in the creation of, or promoting in any way a software development kit derived from the SDK.
4.6 Use, reproduction, and distribution of components of the SDK licensed under an open source software license are governed solely by the terms of that open source software license and not this License Agreement.
4.7 Nothing in this SDK License Agreement gives you the right to use any of EMOTIVs trade names, trademarks, service marks, logos, domain names, or other distinctive brand features.
4.8 You may not remove, obscure, or alter any proprietary rights notices, including copyright and trademark notices, that may be contained within the SDK.
4.9 THE SDK IS SUBJECT TO UNITED STATES EXPORT LAWS AND REGULATIONS. YOU MUST COMPLY WITH ALL DOMESTIC AND INTERNATIONAL EXPORT LAWS AND REGULATIONS THAT APPLY TO THE SDK. THESE LAWS INCLUDE RESTRICTIONS ON DESTINATIONS, END USERS, AND END USE.
5. Your Use of the SDK
5.1 EMOTIV obtains no right, title, or interest from you under this SDK License Agreement in or to any software applications you develop using the SDK, including any intellectual property rights that subsist in those applications.
+3
Ver Arquivo
@@ -0,0 +1,3 @@
SDK Windows Changelogs
Arquivo binário não exibido.
Arquivo binário não exibido.
Arquivo binário não exibido.
Arquivo binário não exibido.
Arquivo binário não exibido.
+273
Ver Arquivo
@@ -0,0 +1,273 @@
/**
* Emotiv SDK
* Copyright (c) 2015 Emotiv Inc.
*
* This file is part of the Emotiv SDK.
*
*/
#ifndef FACIALEXPRESSIONDETECTION_H
#define FACIALEXPRESSIONDETECTION_H
#include "IEmoStateDLL.h"
#ifndef EDK_STATIC_LIB
#ifdef EDK_EXPORTS
#ifdef _WIN32
#define EDK_API __declspec(dllexport)
#else
#define EDK_API
#endif
#else
#ifdef _WIN32
#define EDK_API __declspec(dllimport)
#else
#define EDK_API
#endif
#endif
#else
#define EDK_API extern
#endif
#ifdef __cplusplus
extern "C"
{
#endif
//! Handle to EmoEngine event structure allocated by IEE_EmoEngineEventCreate.
/*!
\sa IEE_EmoEngineEventCreate()
*/
typedef void* EmoEngineEventHandle;
//! FacialExpression Suite threshold type enumerator
typedef enum IEE_FacialExpressionThreshold_enum {
FE_SENSITIVITY //!< Sensitivity of each facial expression
} IEE_FacialExpressionThreshold_t;
//! FacialExpression Suite training control enumerator
typedef enum IEE_FacialExpressionTrainingControl_enum {
FE_NONE = 0, //!< No action
FE_START, //!< Start a new training
FE_ACCEPT, //!< Accept current training
FE_REJECT, //!< Reject current training
FE_ERASE, //!< Erase training data for a facial expression
FE_RESET //!< Reset current training
} IEE_FacialExpressionTrainingControl_t;
//! FacialExpression Suite signature type enumerator
typedef enum IEE_FacialExpressionSignature_enum {
FE_SIG_UNIVERSAL = 0, //!< Use built-in universal signature
FE_SIG_TRAINED //!< Use custom trained signature
} IEE_FacialExpressionSignature_t;
//! FacialExpression event types
typedef enum IEE_FacialExpressionEvent_enum {
IEE_FacialExpressionNoEvent = 0, //!< No new event
IEE_FacialExpressionTrainingStarted, //!< The training has begun after FE_START is sent.
IEE_FacialExpressionTrainingSucceeded, //!< The training is succeeded, waiting for FE_ACCEPT or FE_REJECT.
IEE_FacialExpressionTrainingFailed, //!< The training is failed due to signal issues. Please restart training.
IEE_FacialExpressionTrainingCompleted, //!< The training is completed after FE_ACCEPT is sent.
IEE_FacialExpressionTrainingDataErased, //!< The training data for a particular facial expression has been erased by FE_ERASE.
IEE_FacialExpressionTrainingRejected, //!< The training is rejected after FE_REJECT is sent.
IEE_FacialExpressionTrainingReset //!< The training has been reset after FE_RESET is sent.
} IEE_FacialExpressionEvent_t;
//! Return the FacialExpression-specific event type.
/*!
Returns the FacialExpression-specific event type for an IEE_FacialExpressionEvent event already retrieved using IEE_EngineGetNextEvent().
\param hEvent - a handle returned by IEE_EmoEngineEventCreate()
\return IEE_FacialExpressionEvent_t
*/
EDK_API IEE_FacialExpressionEvent_t
IEE_FacialExpressionEventGetType(EmoEngineEventHandle hEvent);
//! Set threshold for FacialExpression algorithms
/*!
\param userId - user ID
\param algoName - FacialExpression algorithm type
\param thresholdName - FacialExpression threshold type
\param value - threshold value (min: 0, max: 1000)
\return EDK_ERROR_CODE
- EDK_OK if successful
\sa IedkErrorCode.h, IEE_FacialExpressionAlgo_t, IEE_FacialExpressionThreshold_t
*/
EDK_API int
IEE_FacialExpressionSetThreshold(unsigned int userId,
IEE_FacialExpressionAlgo_t algoName,
IEE_FacialExpressionThreshold_t thresholdName,
int value);
//! Get threshold from FacialExpression algorithms
/*!
\param userId - user ID
\param algoName - FacialExpression algorithm type
\param thresholdName - FacialExpression threshold type
\param pValueOut - receives threshold value
\return EDK_ERROR_CODE
- EDK_OK if successful
\sa IedkErrorCode.h, IEE_FacialExpressionAlgo_t, IEE_FacialExpressionThreshold_t
*/
EDK_API int
IEE_FacialExpressionGetThreshold(unsigned int userId,
IEE_FacialExpressionAlgo_t algoName,
IEE_FacialExpressionThreshold_t thresholdName,
int *pValueOut);
//! Set the current facial expression for FacialExpression training
/*!
Blocking call
\param userId - user ID
\param action - which facial expression would like to be trained
\return EDK_ERROR_CODE
- EDK_OK if successful
\sa IedkErrorCode.h, IEE_FacialExpressionAlgo_t
*/
EDK_API int
IEE_FacialExpressionSetTrainingAction(unsigned int userId,
IEE_FacialExpressionAlgo_t action);
//! Set the control flag for FacialExpression training
/*!
Blocking call
\param userId - user ID
\param control - pre-defined control command
\return EDK_ERROR_CODE
- EDK_OK if successful
\sa IedkErrorCode.h, IEE_FacialExpressionTrainingControl_t
*/
EDK_API int
IEE_FacialExpressionSetTrainingControl(unsigned int userId,
IEE_FacialExpressionTrainingControl_t control);
//! Get the facial expression currently selected for FacialExpression training
/*!
Blocking call
\param userId - user ID
\param pActionOut - receives facial expression currently selected for training
\return EDK_ERROR_CODE
- EDK_OK if successful
\sa IedkErrorCode.h, IEE_FacialExpressionAlgo_t
*/
EDK_API int
IEE_FacialExpressionGetTrainingAction(unsigned int userId,
IEE_FacialExpressionAlgo_t* pActionOut);
//! Return the duration of a FacialExpression training session
/*!
\param userId - user ID
\param pTrainingTimeOut - receive the training time in ms
\return EDK_ERROR_CODE
- EDK_OK if successful
\sa IedkErrorCode.h
*/
EDK_API int
IEE_FacialExpressionGetTrainingTime(unsigned int userId,
unsigned int* pTrainingTimeOut);
//! Get a list of expressions that have been trained by the user
/*!
Blocking call
\param userId - user ID
\param pTrainedActionsOut - receives a bit vector composed of IEE_FacialExpressionAlgo_t contants
\return EDK_ERROR_CODE
- EDK_OK if successful
\sa IedkErrorCode.h, IEE_FacialExpressionAlgo_t
*/
EDK_API int
IEE_FacialExpressionGetTrainedSignatureActions(unsigned int userId,
unsigned long* pTrainedActionsOut);
//! Check if the user has trained sufficient actions to activate a trained signature
/*!
*pfAvailableOut will be set to 1 if the user has trained FE_NEUTRAL and at least
one other FacialExpression action. Otherwise, *pfAvailableOut == 0.
Blocking call
\param userId - user ID
\param pfAvailableOut - receives an int that is non-zero if a trained signature can be activated
\return EDK_ERROR_CODE
- EDK_OK if successful
\sa IedkErrorCode.h
*/
EDK_API int
IEE_FacialExpressionGetTrainedSignatureAvailable(unsigned int userId,
int* pfAvailableOut);
//! Configure the FacialExpression suite to use either the built-in, universal signature or a personal, trained signature
/*!
Note: FacialExpression defaults to use its universal signature. This function will fail if IEE_FacialExpressionGetTrainedSignatureAvailable returns false.
Blocking call
\param userId - user ID
\param sigType - signature type to use
\return EDK_ERROR_CODE
- EDK_OK if successful
\sa IedkErrorCode.h, IEE_FacialExpressionSignature_t
*/
EDK_API int
IEE_FacialExpressionSetSignatureType(unsigned int userId,
IEE_FacialExpressionSignature_t sigType);
//! Check whether the FacialExpression suite is currently using either the built-in, universal signature or a trained signature
/*!
Blocking call
\param userId - user ID
\param pSigTypeOut - receives the signature type currently in use
\return EDK_ERROR_CODE
- EDK_OK if successful
\sa IedkErrorCode.h, IEE_FacialExpressionSignature_t
*/
EDK_API int
IEE_FacialExpressionGetSignatureType(unsigned int userId,
IEE_FacialExpressionSignature_t* pSigTypeOut);
};
#endif // FACIALEXPRESSIONDETECTION_H
+603
Ver Arquivo
@@ -0,0 +1,603 @@
/**
* Emotiv Insight SDK
* Copyright (c) 2015 Emotiv Inc.
*
* This file is part of the Emotiv Insight SDK.
*
* Header file to define constants and interfaces to access the EmoState structure.
*
* EmoStates are generated by the Emotiv detection engine (EmoEngine) and represent
* the emotional status of the user at a given time.
*
* EmoStateHandle is an opaque reference to an internal EmoState structure
*
* None of the EmoState interface functions are thread-safe.
*
* This header file is designed to be included under C and C++ environment.
*
*/
#ifndef IEMOSTATE_DLL_H
#define IEMOSTATE_DLL_H
#include <sys/types.h>
#if !defined(EDK_STATIC_LIB) && !defined(EDK_UTILS_ONLY)
#ifdef _WIN32
#ifdef EMOSTATE_DLL_EXPORTS
#define EMOSTATE_DLL_API __declspec(dllexport)
#else
#define EMOSTATE_DLL_API __declspec(dllimport)
#endif
#else
#define EMOSTATE_DLL_API
#endif
#else
#define EMOSTATE_DLL_API extern
#endif
//! Defining EmoStateHandle as a void pointer
typedef void* EmoStateHandle;
#ifdef __cplusplus
extern "C"
{
#endif
//! Emotiv Detection Suite enumerator
typedef enum IEE_EmotivSuite_enum {
IEE_FACIALEXPRESSION = 0, IEE_PERFORMANCEMETRIC, IEE_MENTALCOMMAND
} IEE_EmotivSuite_t;
//DEPLOYMENT::NON_PREMIUM_RELEASE::REMOVE_START
//! FacialExpression facial expression type enumerator
typedef enum IEE_FacialExpressionAlgo_enum {
FE_NEUTRAL = 0x0001,
FE_BLINK = 0x0002,
FE_WINK_LEFT = 0x0004,
FE_WINK_RIGHT = 0x0008,
FE_HORIEYE = 0x0010,
FE_SURPRISE = 0x0020,
FE_FROWN = 0x0040,
FE_SMILE = 0x0080,
FE_CLENCH = 0x0100,
} IEE_FacialExpressionAlgo_t;
//! MentalCommand action type enumerator
typedef enum IEE_MentalCommandAction_enum {
MC_NEUTRAL = 0x0001,
MC_PUSH = 0x0002,
MC_PULL = 0x0004,
MC_LIFT = 0x0008,
MC_DROP = 0x0010,
MC_LEFT = 0x0020,
MC_RIGHT = 0x0040,
MC_ROTATE_LEFT = 0x0080,
MC_ROTATE_RIGHT = 0x0100,
MC_ROTATE_CLOCKWISE = 0x0200,
MC_ROTATE_COUNTER_CLOCKWISE = 0x0400,
MC_ROTATE_FORWARDS = 0x0800,
MC_ROTATE_REVERSE = 0x1000,
MC_DISAPPEAR = 0x2000
} IEE_MentalCommandAction_t;
//DEPLOYMENT::NON_PREMIUM_RELEASE::REMOVE_END
//! Wireless Signal Strength enumerator
typedef enum IEE_SignalStrength_enum {
NO_SIG = 0,
BAD_SIG,
GOOD_SIG
} IEE_SignalStrength_t;
//! Logical input channel identifiers
/*! Note: the number of channels may not necessarily match the number of
electrodes on your headset. Signal quality and input data for some
sensors will be identical: CMS = DRL
*/
typedef enum IEE_InputChannels_enum {
IEE_CHAN_CMS = 0,
IEE_CHAN_DRL,
IEE_CHAN_FP1,
IEE_CHAN_AF3,
IEE_CHAN_F7,
IEE_CHAN_F3,
IEE_CHAN_FC5,
IEE_CHAN_T7,
IEE_CHAN_P7,
IEE_CHAN_Pz,
IEE_CHAN_O1 = IEE_CHAN_Pz,
IEE_CHAN_O2,
IEE_CHAN_P8,
IEE_CHAN_T8,
IEE_CHAN_FC6,
IEE_CHAN_F4,
IEE_CHAN_F8,
IEE_CHAN_AF4,
IEE_CHAN_FP2,
} IEE_InputChannels_t;
//! EEG Electrode Contact Quality enumeration
/*! Used to characterize the EEG signal reception or electrode contact
for a sensor on the headset. Note that this differs from the wireless
signal strength, which refers to the radio communication between the
headset transmitter and USB dongle receiver.
*/
typedef enum IEE_EEG_ContactQuality_enum {
IEEG_CQ_NO_SIGNAL,
IEEG_CQ_VERY_BAD,
IEEG_CQ_POOR,
IEEG_CQ_FAIR,
IEEG_CQ_GOOD
} IEE_EEG_ContactQuality_t;
//! Create EmoState handle.
/*!
NOTE: THIS FUNCTION HAS BEEN DEPRECATED - please use IEE_EmoStateCreate instead.
IS_Init is called automatically after the creation of the EmoState handle.
IS_Free must be called to free up resources during the creation of the EmoState handle.
\return the EmoStateHandle if succeeded
\sa IEE_EmoStateCreate, IS_Free, IS_Init
*/
EMOSTATE_DLL_API EmoStateHandle
IS_Create();
//! Free EmoState handle
/*!
NOTE: THIS FUNCTION HAS BEEN DEPRECATED - please use IEE_EmoStateFree instead.
\param state - EmoStateHandle that was created by IS_Create function call
\sa IEE_EmoStateFree, IS_Create
*/
EMOSTATE_DLL_API void
IS_Free(EmoStateHandle state);
//! Initialize the EmoState into neutral state
/*!
\param state - EmoStateHandle
\sa IS_Create, IS_Free
*/
EMOSTATE_DLL_API void
IS_Init(EmoStateHandle state);
//! Return the time since EmoEngine has been successfully connected to the headset
/*!
If the headset is disconnected from EmoEngine due to low battery or weak
wireless signal, the time will be reset to zero.
\param state - EmoStateHandle
\return float - time in second
*/
EMOSTATE_DLL_API float
IS_GetTimeFromStart(EmoStateHandle state);
//! Return whether the headset has been put on correctly or not
/*!
If the headset cannot not be detected on the head, then signal quality will not report
any results for all the channels
\param state - EmoStatehandle
\return int - (1: On, 0: Off)
*/
EMOSTATE_DLL_API int
IS_GetHeadsetOn(EmoStateHandle state);
//! Query the number of channels of available sensor contact quality data
/*!
\param state - EmoStateHandle
\return number of channels for which contact quality data is available (int)
\sa IS_GetNumContactQualityChannels
*/
EMOSTATE_DLL_API int
IS_GetNumContactQualityChannels(EmoStateHandle state);
//! Query the contact quality of a specific EEG electrode
/*!
\param state - EmoStateHandle
\param electroIdx - The index of the electrode for query
\return IEE_EEG_ContactQuality_t - Enumerated value that characterizes the EEG electrode contact for the specified input channel
\sa IS_GetContactQuality
*/
EMOSTATE_DLL_API IEE_EEG_ContactQuality_t
IS_GetContactQuality(EmoStateHandle state,
IEE_InputChannels_t electroIdx);
//! Query the contact quality of all the electrodes in one single call
/*!
The contact quality will be stored in the array, contactQuality, passed to the function.
The value stored in contactQuality[0] is identical to the result returned by
IS_GetContactQuality(state, 0)
The value stored in contactQuality[1] is identical to the result returned by
IS_GetContactQuality(state, 1). etc.
The ordering of the array is consistent with the ordering of the logical input
channels in IEE_InputChannels_enum.
\param state - EmoStateHandle
\param contactQuality - array of 32-bit float of size numChannels
\param numChannels - size (number of floats) of the input array
\return Number of signal quality values copied to the contactQuality array.
\sa IS_GetContactQualityFromAllChannels
*/
EMOSTATE_DLL_API int
IS_GetContactQualityFromAllChannels(EmoStateHandle state,
IEE_EEG_ContactQuality_t* contactQuality,
size_t numChannels);
//! Query of the current wireless signal strength
/*!
\param state - EmoStateHandle
\return wireless signal strength [No Signal, Bad, Fair, Good, Excellent].
\sa IEE_SignalStrength_t
*/
EMOSTATE_DLL_API IEE_SignalStrength_t
IS_GetWirelessSignalStatus(EmoStateHandle state);
//! Get the level of charge remaining in the headset battery
/*!
\param state - EmoStateHandle
\param chargeLevel - the current level of charge in the headset battery
\param maxChargeLevel - the maximum level of charge in the battery
*/
EMOSTATE_DLL_API void
IS_GetBatteryChargeLevel(EmoStateHandle state,
int* chargeLevel,
int* maxChargeLevel);
//DEPLOYMENT::NON_PREMIUM_RELEASE::REMOVE_START
//! Query whether the user is blinking at the time the EmoState is captured.
/*!
\param state - EmoStateHandle
\return blink status (1: blink, 0: not blink)
*/
EMOSTATE_DLL_API int
IS_FacialExpressionIsBlink(EmoStateHandle state);
//! Query whether the user is winking left at the time the EmoState is captured.
/*!
\param state - EmoStateHandle
\return left wink status (1: wink, 0: not wink)
\sa IS_FacialExpressionIsRightWink
*/
EMOSTATE_DLL_API int
IS_FacialExpressionIsLeftWink(EmoStateHandle state);
//! Query whether the user is winking right at the time the EmoState is captured.
/*!
\param state - EmoStateHandle
\return right wink status (1: wink, 0: not wink)
\sa IS_FacialExpressionIsLeftWink
*/
EMOSTATE_DLL_API int
IS_FacialExpressionIsRightWink(EmoStateHandle state);
//! Query whether the eyes of the user are opened at the time the EmoState is captured.
/*!
\param state - EmoStateHandle
\return eye open status (1: eyes open, 0: eyes closed)
*/
EMOSTATE_DLL_API int
IS_FacialExpressionIsEyesOpen(EmoStateHandle state);
//! Query whether the user is looking up at the time the EmoState is captured.
/*!
\param state - EmoStateHandle
\return eyes position (1: looking up, 0: not looking up)
\sa IS_FacialExpressionIsLookingDown
*/
EMOSTATE_DLL_API int
IS_FacialExpressionIsLookingUp(EmoStateHandle state);
//! Query whether the user is looking down at the time the EmoState is captured.
/*!
\param state - EmoStateHandle
\return eyes position (1: looking down, 0: not looking down)
\sa IS_FacialExpressionIsLookingUp
*/
EMOSTATE_DLL_API int
IS_FacialExpressionIsLookingDown(EmoStateHandle state);
//! Query the eyelids state of the user
/*!
The left and right eyelid state are stored in the parameter leftEye and rightEye
respectively. They are floating point values ranging from 0.0 to 1.0.
0.0 indicates that the eyelid is fully opened while 1.0 indicates that the
eyelid is fully closed.
\param state - EmoStatehandle
\param leftEye - the left eyelid state (0.0 to 1.0)
\param rightEye - the right eyelid state (0.0 to 1.0)
*/
EMOSTATE_DLL_API void
IS_FacialExpressionGetEyelidState(EmoStateHandle state,
float* leftEye,
float* rightEye);
//! Query the eyes position of the user
/*!
The horizontal and vertical position of the eyes are stored in the parameter x and y
respectively. They are floating point values ranging from -1.0 to 1.0.
For horizontal position, -1.0 indicates that the user is looking left while
1.0 indicates that the user is looking right.
For vertical position, -1.0 indicates that the user is looking down while
1.0 indicatest that the user is looking up.
This function assumes that both eyes have the same horizontal or vertical positions.
(i.e. no cross eyes)
\param state - EmoStateHandle
\param x - the horizontal position of the eyes
\param y - the veritcal position of the eyes
*/
EMOSTATE_DLL_API void
IS_FacialExpressionGetEyeLocation(EmoStateHandle state,
float* x,
float* y);
//! Returns the eyebrow extent of the user (Obsolete function)
/*!
\param state - EmoStateHandle
\return eyebrow extent value (0.0 to 1.0)
\sa IS_FacialExpressionGetUpperFaceAction, IS_FacialExpressionGetUpperFaceActionPower
*/
EMOSTATE_DLL_API float
IS_FacialExpressionGetEyebrowExtent(EmoStateHandle state);
//! Returns the smile extent of the user (Obsolete function)
/*!
\param state - EmoStatehandle
\return smile extent value (0.0 to 1.0)
\sa IS_FacialExpressionGetLowerFaceAction, IS_FacialExpressionGetLowerFaceActionPower
*/
EMOSTATE_DLL_API float
IS_FacialExpressionGetSmileExtent(EmoStateHandle state);
//! Returns the clench extent of the user (Obsolete function)
/*!
\param state - EmoStatehandle
\return clench extent value (0.0 to 1.0)
\sa IS_FacialExpressionGetLowerFaceAction, IS_FacialExpressionGetLowerFaceActionPower
*/
EMOSTATE_DLL_API float
IS_FacialExpressionGetClenchExtent(EmoStateHandle state);
//! Returns the detected upper face FacialExpression action of the user
/*!
\param state - EmoStatehandle
\return pre-defined FacialExpression action types
\sa IS_FacialExpressionGetUpperFaceActionPower
*/
EMOSTATE_DLL_API IEE_FacialExpressionAlgo_t
IS_FacialExpressionGetUpperFaceAction(EmoStateHandle state);
//! Returns the detected upper face FacialExpression action power of the user
/*!
\param state - EmoStatehandle
\return power value (0.0 to 1.0)
\sa IS_FacialExpressionGetUpperFaceAction
*/
EMOSTATE_DLL_API float
IS_FacialExpressionGetUpperFaceActionPower(EmoStateHandle state);
//! Returns the detected lower face FacialExpression action of the user
/*!
\param state - EmoStatehandle
\return pre-defined FacialExpression action types
\sa IS_FacialExpressionGetLowerFaceActionPower
*/
EMOSTATE_DLL_API IEE_FacialExpressionAlgo_t
IS_FacialExpressionGetLowerFaceAction(EmoStateHandle state);
//! Returns the detected lower face FacialExpression action power of the user
/*!
\param state - EmoStatehandle
\return power value (0.0 to 1.0)
\sa IS_FacialExpressionGetLowerFaceAction
*/
EMOSTATE_DLL_API float
IS_FacialExpressionGetLowerFaceActionPower(EmoStateHandle state);
//! Query whether the signal is too noisy for FacialExpression detection to be active
/*!
\param state - EmoStateHandle
\param type - FacialExpression detection type
\return detection state (0: Not Active, 1: Active)
\sa IEE_FacialExpressionAlgo_t
*/
EMOSTATE_DLL_API int
IS_FacialExpressionIsActive(EmoStateHandle state,
IEE_FacialExpressionAlgo_t type);
//! Returns the detected MentalCommand action of the user
/*!
\param state - EmoStateHandle
\return MentalCommand action type
\sa IEE_MentalCommandAction_t, IS_MentalCommandGetCurrentActionPower
*/
EMOSTATE_DLL_API IEE_MentalCommandAction_t
IS_MentalCommandGetCurrentAction(EmoStateHandle state);
//! Returns the detected MentalCommand action power of the user
/*!
\param state - EmoStateHandle
\return MentalCommand action power (0.0 to 1.0)
\sa IS_MentalCommandGetCurrentAction
*/
EMOSTATE_DLL_API float
IS_MentalCommandGetCurrentActionPower(EmoStateHandle state);
//! Query whether the signal is too noisy for MentalCommand detection to be active
/*!
\param state - EmoStateHandle
\return detection state (0: Not Active, 1: Active)
*/
EMOSTATE_DLL_API int
IS_MentalCommandIsActive(EmoStateHandle state);
//! Check whether two states are with identical FacialExpression state, i.e. are both state representing the same facial expression
/*!
\param a - EmoStateHandle
\param b - EmoStateHandle
\return 1: Equal, 0: Different
\sa IS_FacialExpressionEqual, IS_MentalCommandEqual, IS_EmoEngineEqual, IS_Equal
*/
EMOSTATE_DLL_API int
IS_FacialExpressionEqual(EmoStateHandle a,
EmoStateHandle b);
//! Check whether two states are with identical MentalCommand state
/*!
\param a - EmoStateHandle
\param b - EmoStateHandle
\return 1: Equal, 0: Different
\sa IS_PerformanceMetricEqual, IS_FacialExpressionEqual, IS_EmoEngineEqual, IS_Equal
*/
EMOSTATE_DLL_API int
IS_MentalCommandEqual(EmoStateHandle a,
EmoStateHandle b);
//DEPLOYMENT::NON_PREMIUM_RELEASE::REMOVE_END
//! Clone EmoStateHandle
/*!
\param a - Destination of EmoStateHandle
\param b - Source of EmoStateHandle
\sa IS_Create
*/
EMOSTATE_DLL_API void
IS_Copy(EmoStateHandle a,
EmoStateHandle b);
//! Check whether two states are with identical EmoEngine state.
/*!
This function is comparing the time since EmoEngine start,
the wireless signal strength and the signal quality of different channels
\param a - EmoStateHandle
\param b - EmoStateHandle
\return 1: Equal, 0: Different
\sa IS_PerformanceMetricEqual, IS_FacialExpressionEqual, IS_MentalCommandEqual, IS_Equal
*/
EMOSTATE_DLL_API int
IS_EmoEngineEqual(EmoStateHandle a,
EmoStateHandle b);
//! Check whether two EmoStateHandles are identical
/*!
\param a - EmoStateHandle
\param b - EmoStateHandle
\return 1: Equal, 0: Different
\sa IS_PerformanceMetricEqual, IS_FacialExpressionEqual, IS_EmoEngineEqual
*/
EMOSTATE_DLL_API int
IS_Equal(EmoStateHandle a,
EmoStateHandle b);
#ifdef __cplusplus
};
#endif
#endif // EMOSTATE_DLL_H
+649
Ver Arquivo
@@ -0,0 +1,649 @@
/**
* Emotiv Insight SDK
* Copyright (c) 2015 Emotiv Inc.
*
* This file is part of the Emotiv Insight SDK.
*
* The main interface that allows interactions between external programs and the Emotiv detection engine.
*
* None of these API functions are thread-safe.
*
* This header file is designed to be included under C and C++ environment.
*
*/
#ifndef IEDK_H
#define IEDK_H
#include "IedkErrorCode.h"
#include "IEmoStateDLL.h"
#include "FacialExpressionDetection.h"
#include "MentalCommandDetection.h"
//DEPLOYMENT::NON_PREMIUM_RELEASE::REMOVE_START
#include "IEegData.h"
//DEPLOYMENT::NON_PREMIUM_RELEASE::REMOVE_END
#ifndef EDK_STATIC_LIB
#ifdef EDK_EXPORTS
#ifdef _WIN32
#define EDK_API __declspec(dllexport)
#else
#define EDK_API
#endif
#else
#ifdef _WIN32
#define EDK_API __declspec(dllimport)
#else
#define EDK_API
#endif
#endif
#else
#include "IEmotivProfile.h"
#include "IEmoStatePerformanceMetric.h"
#define EDK_API extern
#endif
#ifdef __cplusplus
extern "C"
{
#endif
//! Handle to EmoState structure allocated by IEE_EmoStateCreate.
/*!
\sa IEE_EmoStateCreate()
*/
typedef void* EmoStateHandle;
//! Handle to EmoEngine event structure allocated by IEE_EmoEngineEventCreate.
/*!
\sa IEE_EmoEngineEventCreate()
*/
typedef void* EmoEngineEventHandle;
//! Handle to data placeholder allocated by IEE_MotionDataCreate.
/*!
\sa IEE_MotionDataCreate()
*/
typedef void* DataHandle;
//! EmoEngine event types
typedef enum IEE_Event_enum {
IEE_UnknownEvent = 0x0000, //!< An unknown event.
IEE_EmulatorError = 0x0001, //!< Error event from emulator. Connection to EmoComposer could be lost.
IEE_ReservedEvent = 0x0002, //!< Reserved event.
IEE_UserAdded = 0x0010, //!< A headset is connected.
IEE_UserRemoved = 0x0020, //!< A headset has been disconnected.
IEE_EmoStateUpdated = 0x0040, //!< Detection results have been updated from EmoEngine.
IEE_ProfileEvent = 0x0080, //!< A profile has been returned from EmoEngine.
IEE_MentalCommandEvent = 0x0100, //!< A IEE_MentalCommandEvent_t has been returned from EmoEngine.
IEE_FacialExpressionEvent = 0x0200, //!< A IEE_FacialExpressionEvent_t has been returned from EmoEngine.
IEE_InternalStateChanged = 0x0400, //!< Reserved for internal use.
IEE_AllEvent = IEE_UserAdded | IEE_UserRemoved | IEE_EmoStateUpdated |
IEE_ProfileEvent | IEE_MentalCommandEvent |
IEE_FacialExpressionEvent | IEE_InternalStateChanged
//!< Bit-mask for all events except error types
} IEE_Event_t;
//! Input sensor description
typedef struct IInputSensorDescriptor_struct {
IEE_InputChannels_t channelId; //!< Logical channel id
int fExists; //!< Non-zero if this sensor exists on this headset model
const char* pszLabel; //!< Text label identifying this sensor
double xLoc; //!< X coordinate from center of head towards nose
double yLoc; //!< Y coordinate from center of head towards ears
double zLoc; //!< Z coordinate from center of head toward top of skull
} IInputSensorDescriptor_t;
//! Detection type enumerator
typedef enum IEE_Detection_enum {
DT_BlinkAndWink = 0x0001,
DT_FacialExpression = 0x0002,
DT_EyeMovement = 0x0004,
DT_Excitement = 0x0008,
DT_Engagement = 0x0010,
DT_Relaxation = 0x0020,
DT_Interest = 0x0040,
DT_Stress = 0x0080,
DT_Focus = 0x0100,
DT_MentalCommand = 0x0200,
DT_AllDetections = (DT_BlinkAndWink | DT_FacialExpression | DT_EyeMovement |
DT_Excitement | DT_Engagement | DT_Relaxation |
DT_Interest | DT_Stress | DT_Focus |
DT_MentalCommand)
} IEE_Detection_t;
//! Motion data channel description
typedef enum IEE_MotionDataChannel_enum {
IMD_COUNTER = 0, //!< Sample counter
IMD_GYROX, //!< Gyroscope X-axis
IMD_GYROY, //!< Gyroscope Y-axis
IMD_GYROZ, //!< Gyroscope Z-axis
IMD_ACCX, //!< Accelerometer X-axis
IMD_ACCY, //!< Accelerometer Y-axis
IMD_ACCZ, //!< Accelerometer Z-axis
IMD_MAGX, //!< Magnetometer X-axis
IMD_MAGY, //!< Magnetometer Y-axis
IMD_MAGZ, //!< Magnetometer Z-axis
IMD_TIMESTAMP //!< Timestamp of the motion data stream
} IEE_MotionDataChannel_t;
//! Initialize EmoEngine instance which reads data from the headset.
/*!
This function should be called at the beginning of programs that make use of EmoEngine, most probably in initialization routine or constructor.
\return EDK_ERROR_CODE
- EDK_OK if a connection is established
\sa IedkErrorCode.h
*/
EDK_API int
IEE_EngineConnect(const char* strDevID = "Emotiv Systems-5");
//! Initialize the connection to a remote instance of EmoEngine.
/*!
Blocking call
\param szHost - A null-terminated string identifying the hostname or IP address of the remote EmoEngine server
\param port - The port number of the remote EmoEngine server
- If connecting to the Emotiv Control Panel, use port 3008
- If connecting to the EmoComposer, use port 1726
\return EDK_ERROR_CODE
- EDK_OK if a connection is established
\sa IedkErrorCode.h
*/
EDK_API int
IEE_EngineRemoteConnect(const char* szHost,
unsigned short port);
//! Terminate the connection to EmoEngine.
/*!
This function should be called at the end of programs which make use of EmoEngine, most probably in clean up routine or destructor.
\return EDK_ERROR_CODE
- EDK_OK if disconnection is achieved
\sa IedkErrorCode.h
*/
EDK_API int
IEE_EngineDisconnect();
//! Enable diagnostics mode.
/*!
Controls the output of logging information from EmoEngine (disabled by default).
This should only be enabled if instructed to do so by Emotiv support for the purposes of collecting diagnostic information.
\param szFilename - The path of the logfile
\param fEnable - Write diagnostic information to logfile if enabled
\param nReserved - Reserved for future use.
\return EDK_ERROR_CODE
- EDK_OK if the command succeeded
*/
EDK_API int
IEE_EnableDiagnostics(const char* szFilename,
int fEnable,
int nReserved);
//! Return a handle to memory that can hold an EmoEngine event.
/*!
This handle can be reused by the caller to retrieve subsequent events.
\return EmoEngineEventHandle
*/
EDK_API EmoEngineEventHandle
IEE_EmoEngineEventCreate();
//! Return a handle to memory that can hold a profile byte stream.
/*!
This handle can be reused by the caller to retrieve subsequent profile bytes.
\return EmoEngineEventHandle
*/
EDK_API EmoEngineEventHandle
IEE_ProfileEventCreate();
//! Free memory referenced by an event handle.
/*!
\param hEvent - a handle returned by IEE_EmoEngineEventCreate() or IEE_ProfileEventCreate()
*/
EDK_API void
IEE_EmoEngineEventFree(EmoEngineEventHandle hEvent);
//! Return a handle to memory that can store an EmoState.
/*!
This handle can be reused by the caller to retrieve subsequent EmoStates.
\return EmoStateHandle
*/
EDK_API EmoStateHandle
IEE_EmoStateCreate();
//! Free memory referenced by an EmoState handle.
/*!
\param hState - a handle returned by IEE_EmoStateCreate()
*/
EDK_API void
IEE_EmoStateFree(EmoStateHandle hState);
//! Return the event type for an event already retrieved using IEE_EngineGetNextEvent().
/*!
\param hEvent - a handle returned by IEE_EmoEngineEventCreate()
\return IEE_Event_t
*/
EDK_API IEE_Event_t
IEE_EmoEngineEventGetType(EmoEngineEventHandle hEvent);
//! Retrieve the user ID for IEE_UserAdded and IEE_UserRemoved events.
/*!
\param hEvent - a handle returned by IEE_EmoEngineEventCreate()
\param pUserIdOut - receives the user ID associated with the current event
\return EDK_ERROR_CODE
- EDK_OK if successful
\sa IedkErrorCode.h
*/
EDK_API int
IEE_EmoEngineEventGetUserId(EmoEngineEventHandle hEvent,
unsigned int *pUserIdOut);
//! Copy an EmoState returned with a IEE_EmoStateUpdate event to memory referenced by an EmoStateHandle.
/*!
\param hEvent - a handle returned by IEE_EmoEngineEventCreate() and populated with IEE_EmoEngineGetNextEvent()
\param hEmoState - a handle returned by IEE_EmoStateCreate()
\return EDK_ERROR_CODE
- EDK_OK if successful
\sa IedkErrorCode.h
*/
EDK_API int
IEE_EmoEngineEventGetEmoState(EmoEngineEventHandle hEvent,
EmoStateHandle hEmoState);
//! Retrieve the next EmoEngine event
/*!
Non-blocking call
\param hEvent - a handle returned by IEE_EmoEngineEventCreate()
\return EDK_ERROR_CODE
- EDK_OK if an new event has been retrieved
- EDK_NO_EVENT if no new events have been generated by EmoEngine
\sa IedkErrorCode.h
*/
EDK_API int
IEE_EngineGetNextEvent(EmoEngineEventHandle hEvent);
//! Clear a specific EmoEngine event type or all events currently inside the event queue.
/*!
Event flags can be combined together as one argument except for IEE_UnknownEvent and IEE_EmulatorError.
\param eventTypes - EmoEngine event type (IEE_Event_t), multiple events can be combined such as (IEE_UserAdded | IEE_UserRemoved)
\return EDK_ERROR_CODE
- EDK_OK if the events have been cleared from the queue
- EDK_INVALID_PARAMETER if input event types are invalid
\sa IEE_Event_t, IedkErrorCode.h
*/
EDK_API int
IEE_EngineClearEventQueue(int eventTypes);
//! Retrieve number of active users (headset) connected to the EmoEngine.
/*!
\param pNumUserOut - receives number of users
\return EDK_ERROR_CODE
- EDK_OK if successful.
\sa IedkErrorCode.h
*/
EDK_API int
IEE_EngineGetNumUser(unsigned int* pNumUserOut);
//! Set the player number display.
/*!
Sets the player number displayed on the physical input device (currently the USB Dongle) that corresponds to the specified user.
\param userId - EmoEngine user ID
\param playerNum - application assigned player number displayed on input device hardware (must be in the range 1-4)
\return EDK_ERROR_CODE
- EDK_OK if successful
\sa IedkErrorCode.h
*/
EDK_API int
IEE_SetHardwarePlayerDisplay(unsigned int userId,
unsigned int playerNum);
//! Return a struct containing details about a specific channel
/*!
\param channelId - channel identifier (see IEmoStateDll.h)
\param pDescriptorOut - provides detailed sensor location and other info
\return EDK_ERROR_CODE
- EDK_OK if successful
\sa IEmoStateDll.h, IedkErrorCode.h
*/
EDK_API int
IEE_HeadsetGetSensorDetails(IEE_InputChannels_t channelId,
IInputSensorDescriptor_t* pDescriptorOut);
//! Return the current hardware version of the headset and dongle (if available).
/*!
- 0x50XX / 0x90XX - Insight Consumer
- 0x08XX / 0x09XX - Insight Premium
- 0x30XX / 0x70XX - EPOC+ Consumer
- 0x06XX / 0x07XX - EPOC+ Premium
- 0x1000 / 0x1E00 - EPOC Consumer
- 0x0565 - EPOC Premium
\param userId - user ID for query
\param pHwVersionOut - hardware version for the headset/dongle pair.
- Upper 2 bytes: headset version
- Lower 2 bytes: dongle version.
\return EDK_ERROR_CODE
- EDK_OK if successful
\sa IEmoStateDll.h, IedkErrorCode.h
*/
EDK_API int
IEE_HardwareGetVersion(unsigned int userId,
unsigned long* pHwVersionOut);
//! Return the current version of the Emotiv SDK
/*!
\param pszVersionOut - SDK software version in X.X.X format.
\param nVersionChars - Length of char buffer pointed to by pszVersion argument.
\param pBuildNumOut - Build number. Unique for each release.
\return EDK_ERROR_CODE
- EDK_OK if successful
\sa IedkErrorCode.h
*/
EDK_API int
IEE_SoftwareGetVersion(char* pszVersionOut,
unsigned int nVersionChars,
unsigned long* pBuildNumOut);
//! Return the delta of the movement of the gyro since the previous call for a particular user
/*!
\param userId - user ID for query
\param pXOut - horizontal displacement
\param pYOut - vertical displacment
\return EDK_ERROR_CODE
- EDK_OK if successful
\sa IEmoStateDll.h, IedkErrorCode.h
*/
EDK_API int
IEE_HeadsetGetGyroDelta(unsigned int userId,
int* pXOut,
int* pYOut);
//! Re-zero the gyro for a particular user
/*!
\param userId - user ID for query
\return EDK_ERROR_CODE
- EDK_OK if successful
\sa IEmoStateDll.h, IedkErrorCode.h
*/
EDK_API int
IEE_HeadsetGyroRezero(unsigned int userId);
//! Return a handle to memory that can hold motion data.
// This handle can be reused by the caller to retrieve subsequent data.
/*!
\return DataHandle
*/
EDK_API DataHandle
IEE_MotionDataCreate();
//! Free memory referenced by a data handle.
/*!
\param hData - a handle returned by IEE_MotionDataCreate()
*/
EDK_API void
IEE_MotionDataFree(DataHandle hData);
//! Update the content of the data handle to point to new data since the last call
/*!
\param userId - user ID
\param hData - a handle returned by IEE_MotionDataCreate()
\return EDK_ERROR_CODE
- EDK_OK if successful
*/
EDK_API int
IEE_MotionDataUpdateHandle(unsigned int userId,
DataHandle hData);
//! Extract data of a particular channel from the data handle
/*!
\param hData - a handle returned by IEE_MotionDataCreate()
\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_MotionDataGet(DataHandle hData,
IEE_MotionDataChannel_t channel,
double buffer[],
unsigned int bufferSizeInSample);
//! Extract data of a list of channels from the data handle
/*!
\param hData - a handle returned by IEE_MotionDataCreate()
\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_MotionDataGetMultiChannels(DataHandle hData,
IEE_MotionDataChannel_t channels[],
unsigned int nChannels,
double* buffer[],
unsigned int bufferSizeInSample);
//! Return number of sample of motion data stored in the data handle
/*!
\param hData - a handle returned by IEE_MotionDataCreate()
\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_MotionDataGetNumberOfSample(DataHandle hData,
unsigned int* nSampleOut);
//! Set the size of the motion data buffer.
/*!
The size of the buffer affects how frequent IEE_MotionDataUpdateHandle() needs to be called to prevent data loss.
\param bufferSizeInSec - buffer size in second
\return EDK_ERROR_CODE
- EDK_OK if successful
*/
EDK_API int
IEE_MotionDataSetBufferSizeInSec(float bufferSizeInSec);
//! Return the size of the motion data buffer
/*!
\param pBufferSizeInSecOut - receives the size of the data buffer
\return EDK_ERROR_CODE
- EDK_OK if successful
*/
EDK_API int
IEE_MotionDataGetBufferSizeInSec(float* pBufferSizeInSecOut);
//! Get sampling rate of the motion data stream
/*!
\param userId - user ID
\param samplingRateOut - receives the sampling rate
\return EDK_ERROR_CODE
- EDK_OK if successful
*/
EDK_API int
IEE_MotionDataGetSamplingRate(unsigned int userId,
unsigned int* samplingRateOut);
//DEPLOYMENT::NON_PREMIUM_RELEASE::REMOVE_START
//! Enable/disable particular detections
/*!
By default, all detections are enabled.
This method should be called before calling IEE_EngineConnect().
If it is already connected, IEE_EngineDisconnect() should be called first before calling IEE_EngineConnect() again.
\param value - bitwise value of detections to be enabled
\sa IEE_CheckDetectionsEnabled(), IEE_Detection_t
*/
EDK_API void
IEE_EnableDetections(unsigned long value);
//! Check if particular detections are enabled
/*!
\param result - store enabled detection bits in result
\sa IEE_EnableDetections(), IEE_Detection_t
*/
EDK_API void
IEE_CheckDetectionsEnabled(unsigned long* result);
//DEPLOYMENT::NON_PREMIUM_RELEASE::REMOVE_END
//!
//! The following API calls are only applicable for certain platforms to establish BTLE connection with the headset.
//!
#if defined(__APPLE__)
//! Initialize access to BTLE devices
/*!
\remark Available on Mac/iOS only.
Should be called before IEE_EngineConnect.
\return true if initialised successfully
*/
EDK_API bool
IEE_EmoInitDevice();
#endif
#if defined(__APPLE__) || defined(__ANDROID__)
//! Connect to a particular headset
/*!
\remark Available on Mac/iOS/Android only.
\param indexDevice - the index of device in list (start with 0)
\return true if connected successfully
*/
EDK_API int
IEE_EmoConnectDevice(int indexDevice);
//! Check the signal strength of current connected device
/*!
\remark Available on Mac/iOS/Android only.
If there are multiple headsets around, you should choose to connect to the one with strongest signal.
\param value - -30 to 0 (weak to strong)
*/
EDK_API void
IEE_GetSignalStrengthBLEInsight(int& value);
//! Get number of Insight headset in the list
/*!
\remark Available on Mac/iOS/Android only.
\return number of Insight headsets
*/
EDK_API int
IEE_GetNumberDeviceInsight();
//! Return name of headset in listed devices
/*!
\remark Available on Mac/iOS/Android only.
\param index - index in list device
\return const char* - name of the headset
*/
EDK_API const char*
IEE_GetNameDeviceInsightAtIndex(int index);
#endif
#ifdef __cplusplus
}
#endif
#endif // IEDK_H
+88
Ver Arquivo
@@ -0,0 +1,88 @@
/**
* Emotiv Insight SDK
* Copyright (c) 2015 Emotiv Inc.
*
* This file is part of the Emotiv Insight SDK.
*
* All the error codes that are returned by IEE_ functions are listed here.
*/
#ifndef IEDK_ERROR_CODE_H
#define IEDK_ERROR_CODE_H
//! Default success value.
#define EDK_OK 0x0000
//! An internal error occurred.
#define EDK_UNKNOWN_ERROR 0x0001
//! Invalid Developer ID.
#define EDK_INVALID_DEV_ID_ERROR 0x0002
//! The buffer supplied to IEE_SetUserProfile() is not a valid, serialized EmoEngine profile.
#define EDK_INVALID_PROFILE_ARCHIVE 0x0101
//! Returned from IEE_EmoEngineEventGetUserId() if the event supplied contains a base profile,
//! and is not associated with specific user.
#define EDK_NO_USER_FOR_BASEPROFILE 0x0102
//! The EmoEngine is unable to acquire data for processing.
//! \sa IEE_EngineConnect
#define EDK_CANNOT_ACQUIRE_DATA 0x0200
//! The buffer supplied to the function is not large enough.
#define EDK_BUFFER_TOO_SMALL 0x0300
//! A parameter supplied to the function is out of range.
#define EDK_OUT_OF_RANGE 0x0301
//! One of the parameters supplied to the function is invalid
#define EDK_INVALID_PARAMETER 0x0302
//! The parameter is currently locked by the detection and cannot be modified at this time.
#define EDK_PARAMETER_LOCKED 0x0303
//! The supplied MentalCommand training action flag is invalid.
#define EDK_MC_INVALID_TRAINING_ACTION 0x0304
//! The supplied MentalCommand training control flag is invalid.
#define EDK_MC_INVALID_TRAINING_CONTROL 0x0305
//! The MentalCommand action bits vector is invalid.
#define EDK_MC_INVALID_ACTIVE_ACTION 0x0306
//! The MentalCommand action bits vector contains more action types than it is allowed.
#define EDK_MC_EXCESS_MAX_ACTIONS 0x0307
//! A trained signature is not currently available for use,
//! addition actions (including neutral) may be required.
#define EDK_FE_NO_SIG_AVAILABLE 0x0308
//! A filesystem error occurred.
#define EDK_FILESYSTEM_ERROR 0x0309
//! The user ID supplied to the function is invalid.
#define EDK_INVALID_USER_ID 0x0400
//! The EDK needs to be initialized via IEE_EngineConnect() or IEE_EngineRemoteConnect().
#define EDK_EMOENGINE_UNINITIALIZED 0x0500
//! The connection with a remote instance of the EmoEngine made via EE_EngineRemoteConnect() has been lost.
#define EDK_EMOENGINE_DISCONNECTED 0x0501
//! The API was unable to establish a connection with a remote instance of the EmoEngine.
#define EDK_EMOENGINE_PROXY_ERROR 0x0502
//! There are no new EmoEngine events at this time.
#define EDK_NO_EVENT 0x0600
//! The gyro is not calibrated. Please ask the user to stay still for at least 0.5 seconds.
#define EDK_GYRO_NOT_CALIBRATED 0x0700
//! Operation failure due to optimization.
#define EDK_OPTIMIZATION_IS_ON 0x0800
//! Reserved return value.
#define EDK_RESERVED1 0x0900
#endif
+389
Ver Arquivo
@@ -0,0 +1,389 @@
/**
* Emotiv SDK
* Copyright (c) 2015 Emotiv Inc.
*
* This file is part of the Emotiv SDK.
*
*/
#ifndef MENTALCOMMANDDETECTION_H
#define MENTALCOMMANDDETECTION_H
#include "IEmoStateDLL.h"
#ifndef EDK_STATIC_LIB
#ifdef EDK_EXPORTS
#ifdef _WIN32
#define EDK_API __declspec(dllexport)
#else
#define EDK_API
#endif
#else
#ifdef _WIN32
#define EDK_API __declspec(dllimport)
#else
#define EDK_API
#endif
#endif
#else
#define EDK_API extern
#endif
#ifdef __cplusplus
extern "C"
{
#endif
//! Handle to EmoEngine event structure allocated by IEE_EmoEngineEventCreate.
/*!
\sa IEE_EmoEngineEventCreate()
*/
typedef void* EmoEngineEventHandle;
//! MentalCommand Suite training control enumerator
typedef enum IEE_MentalCommandTrainingControl_enum {
MC_NONE = 0, //!< No action
MC_START, //!< Start a new training
MC_ACCEPT, //!< Accept current training
MC_REJECT, //!< Reject current training
MC_ERASE, //!< Erase training data for an action
MC_RESET //!< Reset current training
} IEE_MentalCommandTrainingControl_t;
//! MentalCommand event types
typedef enum IEE_MentalCommandEvent_enum {
IEE_MentalCommandNoEvent = 0, //!< No new event
IEE_MentalCommandTrainingStarted, //!< The training has begun after MC_START is sent.
IEE_MentalCommandTrainingSucceeded, //!< The training is succeeded, waiting for MC_ACCEPT or MC_REJECT.
IEE_MentalCommandTrainingFailed, //!< The training is failed due to signal issues. Please restart training.
IEE_MentalCommandTrainingCompleted, //!< The training is completed after MC_ACCEPT is sent.
IEE_MentalCommandTrainingDataErased, //!< The training data for a particular action has been erased by MC_ERASE.
IEE_MentalCommandTrainingRejected, //!< The training is rejected after MC_REJECT is sent.
IEE_MentalCommandTrainingReset, //!< The training has been reset after MC_RESET is sent.
IEE_MentalCommandAutoSamplingNeutralCompleted, //!< The neutral training is completed.
IEE_MentalCommandSignatureUpdated //!< The mental command signature has been updated for new actions.
} IEE_MentalCommandEvent_t;
//! Return the MentalCommand-specific event type.
/*!
Returns the MentalCommand-specific event type for an IEE_MentalCommandEvent event already retrieved using IEE_EngineGetNextEvent().
\param hEvent - a handle returned by IEE_EmoEngineEventCreate()
\return IEE_MentalCommandEvent_t
*/
EDK_API IEE_MentalCommandEvent_t
IEE_MentalCommandEventGetType(EmoEngineEventHandle hEvent);
//! Set the current MentalCommand active action types
/*!
\param userId - user ID
\param activeActions - a bit vector composed of IEE_MentalCommandAction_t contants
\return EDK_ERROR_CODE
- EDK_OK if successful
\sa IedkErrorCode.h, IEE_MentalCommandAction_t
*/
EDK_API int
IEE_MentalCommandSetActiveActions(unsigned int userId,
unsigned long activeActions);
//! Get the current MentalCommand active action types
/*!
\param userId - user ID
\param pActiveActionsOut - receive a bit vector composed of IEE_MentalCommandAction_t contants
\return EDK_ERROR_CODE
- EDK_OK if successful
\sa IedkErrorCode.h, IEE_MentalCommandAction_t
*/
EDK_API int
IEE_MentalCommandGetActiveActions(unsigned int userId,
unsigned long* pActiveActionsOut);
//! Return the duration of a MentalCommand training session
/*!
\param userId - user ID
\param pTrainingTimeOut - receive the training time in ms
\return EDK_ERROR_CODE
- EDK_OK if successful
\sa IedkErrorCode.h
*/
EDK_API int
IEE_MentalCommandGetTrainingTime(unsigned int userId,
unsigned int* pTrainingTimeOut);
//! Set the training control flag for MentalCommand training
/*!
\param userId - user ID
\param control - pre-defined MentalCommand training control
\return EDK_ERROR_CODE
- EDK_OK if successful
\sa IedkErrorCode.h, IEE_MentalCommandTrainingControl_t
*/
EDK_API int
IEE_MentalCommandSetTrainingControl(unsigned int userId,
IEE_MentalCommandTrainingControl_t control);
//! Set the type of MentalCommand action to be trained
/*!
\param userId - user ID
\param action - which action would like to be trained
\return EDK_ERROR_CODE
- EDK_OK if successful
\sa IedkErrorCode.h, IEE_MentalCommandAction_t
*/
EDK_API int
IEE_MentalCommandSetTrainingAction(unsigned int userId,
IEE_MentalCommandAction_t action);
//! Get the type of MentalCommand action currently selected for training
/*!
\param userId - user ID
\param pActionOut - action that is currently selected for training
\return EDK_ERROR_CODE
- EDK_OK if successful
\sa IedkErrorCode.h, IEE_MentalCommandAction_t
*/
EDK_API int
IEE_MentalCommandGetTrainingAction(unsigned int userId,
IEE_MentalCommandAction_t* pActionOut);
//! Get a list of the actions that have been trained by the user
/*!
Blocking call
\param userId - user ID
\param pTrainedActionsOut - receives a bit vector composed of IEE_MentalCommandAction_t contants
\return EDK_ERROR_CODE
- EDK_OK if successful
\sa IedkErrorCode.h, IEE_MentalCommandAction_t
*/
EDK_API int
IEE_MentalCommandGetTrainedSignatureActions(unsigned int userId,
unsigned long* pTrainedActionsOut);
//! Get the current overall skill rating of the user in MentalCommand
/*!
Blocking call
\param userId - user ID
\param pOverallSkillRatingOut - receives the overall skill rating [from 0.0 to 1.0]
\return EDK_ERROR_CODE
- EDK_OK if successful
\sa IedkErrorCode.h
*/
EDK_API int
IEE_MentalCommandGetOverallSkillRating(unsigned int userId,
float* pOverallSkillRatingOut);
//! Get the current skill rating for particular MentalCommand actions of the user
/*!
Blocking call
\param userId - user ID
\param action - a particular action of IEE_MentalCommandAction_t contant
\param pActionSkillRatingOut - receives the action skill rating [from 0.0 to 1.0]
\return EDK_ERROR_CODE
- EDK_OK if successful
\sa IedkErrorCode.h, IEE_MentalCommandAction_t
*/
EDK_API int
IEE_MentalCommandGetActionSkillRating(unsigned int userId,
IEE_MentalCommandAction_t action,
float* pActionSkillRatingOut);
//! Set the overall sensitivity for all MentalCommand actions
/*!
\param userId - user ID
\param level - sensitivity level of all actions (lowest: 1, highest: 7)
\return EDK_ERROR_CODE
- EDK_OK if successful
\sa IedkErrorCode.h
*/
EDK_API int
IEE_MentalCommandSetActivationLevel(unsigned int userId,
int level);
//! Set the sensitivity of MentalCommand actions
/*!
\param userId - user ID
\param action1Sensitivity - sensitivity of action 1 (min: 1, max: 10)
\param action2Sensitivity - sensitivity of action 2 (min: 1, max: 10)
\param action3Sensitivity - sensitivity of action 3 (min: 1, max: 10)
\param action4Sensitivity - sensitivity of action 4 (min: 1, max: 10)
\return EDK_ERROR_CODE
- EDK_OK if successful
\sa IedkErrorCode.h
*/
EDK_API int
IEE_MentalCommandSetActionSensitivity(unsigned int userId,
int action1Sensitivity,
int action2Sensitivity,
int action3Sensitivity,
int action4Sensitivity);
//! Get the overall sensitivity for all MentalCommand actions
/*!
\param userId - user ID
\param pLevelOut - sensitivity level of all actions (min: 1, max: 10)
\return EDK_ERROR_CODE
- EDK_OK if successful
\sa IedkErrorCode.h
*/
EDK_API int
IEE_MentalCommandGetActivationLevel(unsigned int userId,
int *pLevelOut);
//! Query the sensitivity of MentalCommand actions
/*!
\param userId - user ID
\param pAction1SensitivityOut - sensitivity of action 1
\param pAction2SensitivityOut - sensitivity of action 2
\param pAction3SensitivityOut - sensitivity of action 3
\param pAction4SensitivityOut - sensitivity of action 4
\return EDK_ERROR_CODE
- EDK_OK if successful
\sa IedkErrorCode.h
*/
EDK_API int
IEE_MentalCommandGetActionSensitivity(unsigned int userId,
int* pAction1SensitivityOut,
int* pAction2SensitivityOut,
int* pAction3SensitivityOut,
int* pAction4SensitivityOut);
//! Start the sampling of Neutral state in MentalCommand
/*!
\param userId - user ID
\return EDK_ERROR_CODE
- EDK_OK if successful
\sa IedkErrorCode.h
*/
EDK_API int
IEE_MentalCommandStartSamplingNeutral(unsigned int userId);
//! Stop the sampling of Neutral state in MentalCommand
/*!
\param userId - user ID
\return EDK_ERROR_CODE
- EDK_OK if successful
\sa IedkErrorCode.h
*/
EDK_API int
IEE_MentalCommandStopSamplingNeutral(unsigned int userId);
//! Enable or disable signature caching in MentalCommand
/*!
Enable signature caching will shorten the time to build the signature after each training,
with the penalty of more memory usage.
\param userId - user ID
\param enabled - flag to set status of caching (1: enable, 0: disable)
\return EDK_ERROR_CODE
- EDK_OK if successful
\sa IedkErrorCode.h
*/
EDK_API int
IEE_MentalCommandSetSignatureCaching(unsigned int userId,
unsigned int enabled);
//! Query the status of signature caching in MentalCommand
/*!
\param userId - user ID
\param pEnabledOut - flag to get status of caching (1: enable, 0: disable)
\return EDK_ERROR_CODE
- EDK_OK if successful
\sa IedkErrorCode.h
*/
EDK_API int
IEE_MentalCommandGetSignatureCaching(unsigned int userId,
unsigned int* pEnabledOut);
//! Set the cache size for the signature caching in MentalCommand
/*!
\param userId - user ID
\param size - number of signatures to be kept in the cache (0: unlimited)
\return EDK_ERROR_CODE
- EDK_OK if successful
\sa IedkErrorCode.h
*/
EDK_API int
IEE_MentalCommandSetSignatureCacheSize(unsigned int userId,
unsigned int size);
//! Get the current cache size for the signature caching in MentalCommand
/*!
\param userId - user ID
\param pSizeOut - number of signatures to be kept in the cache (0: unlimited)
\return EDK_ERROR_CODE
- EDK_OK if successful
\sa IedkErrorCode.h
*/
EDK_API int
IEE_MentalCommandGetSignatureCacheSize(unsigned int userId,
unsigned int* pSizeOut);
};
#endif // MENTALCOMMANDDETECTION_H
Arquivo binário não exibido.