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.
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.
Create a new profile. It can be an empty profile, or a copy of a loaded profile.
Name | Type | Required | Description |
profile | string | yes | The name of the new profile. It must be unique for the user. Use queryProfile to check if a name is already in use. |
headset | string | yes | If omitted, create an empty profile. If set, create a copy of the profile currently loaded for this headset. |
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. |
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. |
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. |
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. |
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. |
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. |
Request
Response
{
"id": 1,
"jsonrpc": "2.0",
"method": "setupProfile",
"params": {
"cortexToken": "xxx",
"profile": "cortex-v2-example",
"status": "create"
}
}
{
"id": 1,
"jsonrpc": "2.0",
"result": {
"action": "create",
"message": "...",
"name": "cortex-v2-example"
}
}
Request
Response
{
"id": 1,
"jsonrpc": "2.0",
"method": "setupProfile",
"params": {
"cortexToken": "xxx",
"headset": "EPOCPLUS-12341234",
"profile": "cortex-v2-example",
"status": "load"
}
}
{
"id": 1,
"jsonrpc": "2.0",
"result": {
"action": "load",
"message": "The profile is loaded successfully",
"name": "cortex-v2-example"
}
}
Request
Response
{
"id": 1,
"jsonrpc": "2.0",
"method": "setupProfile",
"params": {
"cortexToken": "xxx",
"headset": "EPOCPLUS-12341234",
"profile": "cortex-v2-example",
"status": "save"
}
}
{
"id": 1,
"jsonrpc": "2.0",
"result": {
"action": "save",
"message": "The profile is saved successfully",
"name": "cortex-v2-example"
}
}
Last modified 1d ago