setupProfile
This method is to manage the training profiles of the user.
You create, rename or delete a profile. You can load and unload a profile for a headset if the EEG channels of this headset is supported by this training profile. And you can save a profile after the user completed a training, or after you changed the attributes of the profile.
Before you load or unload a profile, you can call getCurrentProfile to know if a profile is currently loaded, and if it was loaded by your application.
Parameters
Name
Type
Required
Description
cortexToken
string
yes
status
string
yes
Must be "create", "load", "unload", "save", "rename" or "delete".
profile
string
yes
The name of the profile.
headset
string
yes or no, depending on "status"
newProfileName
string
no
If the status is "rename", then you must set this parameter, and it is the new name of the profile.
Depending on the status, this method has different effects, and uses different parameters.
Status create
Create a new profile. It can be an empty profile, or a copy of a loaded profile.
Name
Type
Required
Description
profile
string
yes
headset
string
yes
If omitted, create an empty profile.
If set, create a copy of the profile currently loaded for this headset.
Status load
Load an existing profile for a specific headset. If a profile is already loaded, then you must unload it first.
Name
Type
Required
Description
profile
string
yes
The name of the profile to load.
headset
string
yes
The id of the headset to load the profile to.
Status unload
Unload the profile of a specific headset. After the unload, this headset will use a default empty profile. You should set the parameter profile to an empty string. You cannot unload a profile that was loaded by another application.
Name
Type
Required
Description
headset
string
yes
The id of the headset to unload the profile.
profile
string
yes
Cortex will ignore this parameter. Should be an empty string.
Status save
Save the profile used by a headset. You can save it with a new name, so it creates a new profile. Or you can save it with the same name, ie the name you used to load it. You cannot save a profile that was loaded by another application.
Name
Type
Required
Description
headset
string
yes
The profile used by this headset will be saved.
profile
string
yes
The name of the profile.
If no profile with that name exists, then the method creates a new profile.
If it is the name of the profile that was previously loaded to this headset, then the method saves to this profile.
Status rename
Rename an existing profile.
Name
Type
Required
Description
profile
string
yes
The name of the profile you want to rename.
newProfileName
string
yes
The new name of the profile.
Status delete
Delete an existing profile. If this profile is loaded for a headset, then it is automatically unloaded. You cannot delete a profile that is currently loaded by another application.
Name
Type
Required
Description
profile
string
yes
The name of the profile you want to delete.
Result
The result is an object containing these fields:
Name
Type
Description
action
string
The status you used in the request.
name
string
The profile you used in the request.
message
string
A success message.
Examples
Create a new empty profile
Load a profile for a headset
Save a profile
Last updated