EmotivCloudClient.h File Reference

Go to the source code of this file.

Data Structures

struct  profileVerInfo
 Profile version. More...
 

Macros

#define EMOTIVCLOUD_API
 
#define MAX_NUM_OF_BACKUP_PROFILE_VERSION   2
 

Typedefs

typedef enum profileType profileFileType
 Profile types. More...
 
typedef struct profileVerInfo profileVersionInfo
 Profile version. More...
 

Enumerations

enum  profileType { TRAINING, EMOKEY }
 Profile types. More...
 

Functions

EMOTIVCLOUD_API int EC_Connect ()
 Initialize connection to Emotiv Cloud Server. More...
 
EMOTIVCLOUD_API int EC_Disconnect ()
 Terminate connection to Emotiv Cloud server. More...
 
EMOTIVCLOUD_API int EC_ReconnectEngine ()
 Reconnect Emotiv engine. More...
 
EMOTIVCLOUD_API int EC_DisconnectEngine ()
 Disconnect Emotiv engine. More...
 
EMOTIVCLOUD_API int EC_Login (const char *username, const char *password)
 Login Emotiv Cloud with EmotivID. More...
 
EMOTIVCLOUD_API int EC_Logout (int userCloudID)
 Logout Emotiv Cloud. More...
 
EMOTIVCLOUD_API int EC_GetUserDetail (int *userCloudID)
 Get user ID after login. More...
 
EMOTIVCLOUD_API int EC_SaveUserProfile (int userCloudID, int engineUserID, const char *profileName, profileFileType ptype)
 Save user profile to Emotiv Cloud. More...
 
EMOTIVCLOUD_API int EC_UpdateUserProfile (int userCloudID, int engineUserID, int profileId)
 Update user profile to Emotiv Cloud. More...
 
EMOTIVCLOUD_API int EC_DeleteUserProfile (int userCloudID, int profileId)
 Delete user profile from Emotiv Cloud. More...
 
EMOTIVCLOUD_API int EC_GetProfileId (int userCloudID, const char *profileName)
 Get profile ID of a user. More...
 
EMOTIVCLOUD_API int EC_LoadUserProfile (int userCloudID, int engineUserID, int profileId, int version=-1)
 Load profile from Emotiv Cloud. More...
 
EMOTIVCLOUD_API int EC_GetAllProfileName (int userCloudID)
 Update all the profile info from Emotiv Cloud. More...
 
EMOTIVCLOUD_API int EC_ProfileIDAtIndex (int userCloudID, int index)
 Return the profile ID of a profile in cache. More...
 
EMOTIVCLOUD_API const char * EC_ProfileNameAtIndex (int userCloudID, int index)
 Return the profile name of a profile in cache. More...
 
EMOTIVCLOUD_API const char * EC_ProfileLastModifiedAtIndex (int userCloudID, int index)
 Return the last modified timestamp of a profile in cache. More...
 
EMOTIVCLOUD_API profileFileType EC_ProfileTypeAtIndex (int userCloudID, int index)
 Return the type of a profile in cache. More...
 

Detailed Description

Emotiv SDK Copyright (c) 2016 Emotiv Inc.

This file is part of the Emotiv SDK.

The main interface that allows interactions between external programs and Emotiv Cloud.

All API calls are blocking calls. Consider using the Emotiv Cloud APIs in a different thread to avoid blocking the main thread.

This header file is designed to be included under C and C++ environment.

Macro Definition Documentation

#define EMOTIVCLOUD_API
#define MAX_NUM_OF_BACKUP_PROFILE_VERSION   2

Typedef Documentation

Profile types.

Profile version.

Enumeration Type Documentation

Profile types.

Enumerator
TRAINING 
EMOKEY 

Function Documentation

EMOTIVCLOUD_API int EC_Connect ( )

Initialize connection to Emotiv Cloud Server.

Returns
EC_ERROR_CODE
  • EC_OK if connect successfully
See also
EC_Disconnect()
EMOTIVCLOUD_API int EC_DeleteUserProfile ( int  userCloudID,
int  profileId 
)

Delete user profile from Emotiv Cloud.

Parameters
userCloudID- user ID from EC_GetUserDetail()
profileId- profile ID to be deleted, from EC_GetProfileId()
Returns
EC_ERROR_CODE
  • EC_OK if updated successfully
See also
EC_SaveUserProfile(), EC_UpdateUserProfile()
EMOTIVCLOUD_API int EC_Disconnect ( )

Terminate connection to Emotiv Cloud server.

Returns
EC_ERROR_CODE
  • EC_OK if connect successfully
See also
EC_Connect()
EMOTIVCLOUD_API int EC_DisconnectEngine ( )

Disconnect Emotiv engine.

Returns
EC_ERROR_CODE
  • EC_OK if Reconnect successfully
See also
EC_ReconnectEngine()
EMOTIVCLOUD_API int EC_GetAllProfileName ( int  userCloudID)

Update all the profile info from Emotiv Cloud.

This function needs to be called first before calling EC_ProfileIDAtIndex(), EC_ProfileNameAtIndex(), EC_ProfileLastModifiedAtIndex(), EC_ProfileTypeAtIndex()

Parameters
userCloudID- user ID from EC_GetUserDetail()
Returns
int - number of existing profiles (only latest version for each profile are counted)
EMOTIVCLOUD_API int EC_GetProfileId ( int  userCloudID,
const char *  profileName 
)

Get profile ID of a user.

Parameters
userCloudID- user ID from EC_GetUserDetail()
profileName- profile name to look for
Returns
int - return profile ID if found, otherwise -1
EMOTIVCLOUD_API int EC_GetUserDetail ( int *  userCloudID)

Get user ID after login.

Parameters
userCloudID- return user ID for subsequence requests
Returns
EC_ERROR_CODE
  • EC_OK if fetched successfully
See also
EC_Login()
EMOTIVCLOUD_API int EC_LoadUserProfile ( int  userCloudID,
int  engineUserID,
int  profileId,
int  version = -1 
)

Load profile from Emotiv Cloud.

Remarks
Time to take to load a profile from Emotiv Cloud depends on network speed and profile size.
Parameters
userCloudID- user ID from EC_GetUserDetail()
engineUserID- user ID from current EmoEngine (first user will be 0)
profileId- profile ID to be loaded, from EC_GetProfileId()
version- version of profile to download (default: -1 for lastest version)
Returns
EC_ERROR_CODE
  • EC_OK if loaded successfully
EMOTIVCLOUD_API int EC_Login ( const char *  username,
const char *  password 
)

Login Emotiv Cloud with EmotivID.

To register a new EmotivID please visit https://id.emotivcloud.com/ .

Parameters
username- username
password- password
Returns
EC_ERROR_CODE
  • EC_OK if login successfully
See also
EC_Logout()
EMOTIVCLOUD_API int EC_Logout ( int  userCloudID)

Logout Emotiv Cloud.

EMOTIVCLOUD_API int EC_ProfileIDAtIndex ( int  userCloudID,
int  index 
)

Return the profile ID of a profile in cache.

Parameters
userCloudID- user ID from EC_GetUserDetail()
index- index of profile (starts from 0)
Returns
int - profile ID
EMOTIVCLOUD_API const char* EC_ProfileLastModifiedAtIndex ( int  userCloudID,
int  index 
)

Return the last modified timestamp of a profile in cache.

Parameters
userCloudID- user ID from EC_GetUserDetail()
index- index of profile (starts from 0)
Returns
const char* - last modified timestamp
EMOTIVCLOUD_API const char* EC_ProfileNameAtIndex ( int  userCloudID,
int  index 
)

Return the profile name of a profile in cache.

Parameters
userCloudID- user ID from EC_GetUserDetail()
index- index of profile (starts from 0)
Returns
const char* - profile name
EMOTIVCLOUD_API profileFileType EC_ProfileTypeAtIndex ( int  userCloudID,
int  index 
)

Return the type of a profile in cache.

Parameters
userCloudID- user ID from EC_GetUserDetail()
index- index of profile (starts from 0)
Returns
profileFileType - profile type
EMOTIVCLOUD_API int EC_ReconnectEngine ( )

Reconnect Emotiv engine.

Returns
EC_ERROR_CODE
  • EC_OK if Reconnect successfully
See also
EC_DisconnectEngine()
EMOTIVCLOUD_API int EC_SaveUserProfile ( int  userCloudID,
int  engineUserID,
const char *  profileName,
profileFileType  ptype 
)

Save user profile to Emotiv Cloud.

Parameters
userCloudID- user ID from EC_GetUserDetail()
engineUserID- user ID from current EmoEngine (first user will be 0)
profileName- profile name to be saved as
ptype- profile type
Returns
EC_ERROR_CODE
  • EC_OK if saved successfully
See also
EC_UpdateUserProfile(), EC_DeleteUserProfile()
EMOTIVCLOUD_API int EC_UpdateUserProfile ( int  userCloudID,
int  engineUserID,
int  profileId 
)

Update user profile to Emotiv Cloud.

Parameters
userCloudID- user ID from EC_GetUserDetail()
engineUserID- user ID from current EmoEngine (first user will be 0)
profileId- profile ID to be updated, from EC_GetProfileId()
Returns
EC_ERROR_CODE
  • EC_OK if updated successfully
See also
EC_SaveUserProfile(), EC_DeleteUserProfile()