arrow-left

All pages
gitbookPowered by GitBook
1 of 1

Loading...

Warning Objects

In addition to method responses and data samples, Cortex can send a third type of message, called warnings.

These warnings inform your application about important events, like when the user logs in or out, or when a training profile is loaded or unloaded for a headset.

hashtag
Description

A warning object contain these fields:

The warning object has 2 fields:

hashtag
Warning Codes

The possible codes are:

hashtag
Examples

hashtag
0 - Data stream unsubscribed

hashtag
1 - Session closed

hashtag
2 - User login

hashtag
3 - User logout

hashtag
9 - App access granted

hashtag
10 - App access declined

hashtag
13 - Profile loaded

hashtag
14 - 15 - Profile unloaded

hashtag
17 - EULA accepted

hashtag
18 - Record data has been successfully saved.

hashtag
19 - 20 - Disk space

hashtag
21 - 22 - Opt-out configuration changed

hashtag
23 - Database upgrading when Cortex starts finishes

Successfully upgraded database:

Failed to upgrade database:

hashtag
30 - Data post-processing finishes.

hashtag
32 - Records synchronization status change

hashtag
100 - 101 - 102 - 113 - Failed to connect to a headset

hashtag
103 - Headset disconnected

hashtag
104 - Headset connected

hashtag
110 - Headset update successful

hashtag
111 - Headset update failed

hashtag
112 - Headset configuration cannot work with Bluetooth

The user declined your application in EMOTIV App.

13

A training profile was loaded for a headset using

14

A training profile was unloaded for a headset using .

15

A training profile was automatically unloaded by Cortex. This can happen if the headset was disconnected, or if the application that loaded this profile was disconnected from Cortex.

17

The user accepted the EULA in EMOTIV App.

18

The record data has been successfully saved. Cortex sends this warning when a record is done with some long-run post processing after record is stopped.

19

The available disk space is low. Cortex send this warning when there is less then 1 GB available of the hard drive.

This warning was added in Cortex 2.2.1

20

The available disk space is critically low. Cortex send this warning when there is less then 300 MB available of the hard drive. When this happens Cortex automatically disconnect all the headsets. You cannot until the user free up some space.

This warning was added in Cortex 2.2.1

21

The user has changed the configuration.

This warning was added in Cortex 2.2.1

22

Cortex has changed the configuration. This can happen when the license of the user is updated.

This warning was added in Cortex 2.2.1

23

Sometimes Cortex needs to upgrade database and it takes time before Cortex is ready for API calls. When the upgrading process finishes, Cortex will send this warning to the application. It has 2 fields: - "success" (boolean) indicates the upgrading process is successful or not. Can be true or false. - "behavior" (string) explains the "success" value.

26

The license of the user will expire in a few days.

This warning was added in Cortex 2.3.0

30

Data post-processing finishes. After record stops, Cortex still needs to run a lengthy process to improve timestamps or combine broken sessions. If you want to export the record just after it stops, you should wait until this warning is emitted from Cortex.

32

Records synchronization status change. When the records synchronize status change, this warning is emitted from Cortex. The status can be: "paused", "synced", "uploading", "downloading".

100 and 101

Cortex failed to connect to a headset. If the headset uses a Bluetooth connection, then you should try to disconnect the headset from the Bluetooth manager of the OS.

102

Cortex reached a timeout while trying to connect to a headset. This can happen if the wireless connection is of poor quality.

103

Cortex disconnected a headset because it didn't receive any data from this headset for more than 30 seconds. This can happen if the headset goes out of range of the computer, or if the wireless connection is of poor quality.

104

Cortex successfully connected to a headset.

110

Cortex successfully updated the configuration of a headset. See .

This warning was added in Cortex 2.4

111

Cortex failed to update the configuration of a headset. See .

This warning was added in Cortex 2.4

112

Cortex successfully updated a headset but the new configuration can only work with a USB dongle connection. The configuration is not compatible with a Bluetooth connection. See .

This warning was added in Cortex 2.5

113

Cortex failed to connect to an EPOC+ or EPOC X headset with Bluetooth. The configuration of the headset is not compatible with a Bluetooth connection. See .

This warning was added in Cortex 2.5

142

Cortex finishes headset scanning which is started by with "refresh" command.

Name

Type

Description

jsonrpc

string

Always has the value "2.0".

warning

object

An object with the fields "code" and "message".

Name

Type

Description

code

number

The code of this warning. The possible codes are documented below.

message

any

The type and value of this field depends on the code. For most of the warnings it is just a string, but it can also be an object. See the examples below.

Code

Description

0

All the data streams you subscribed to have been automatically canceled by Cortex. This can happen if the headset was disconnected or updateSession API with status = "close" is called.

1

Your session was automatically closed by Cortex. This can happen if the headset was disconnected.

2

The user has logged in with EMOTIV App.

3

The user has logged out with EMOTIV App.

9

The user approved your application in EMOTIV App.

10

{
    "jsonrpc": "2.0",
    "warning": {
        "code": 0,
        "message": {
            "behavior": "Cortex has stopped all the subscriptions of session 866b8437-2380-4392-9a35-3d5957eaf95d.",
            "sessionId": "866b8437-2380-4392-9a35-3d5957eaf95d"
        }
    }
}
{
    "jsonrpc": "2.0",
    "warning": {
        "code": 1,
        "message": {
            "behavior": "Cortex has closed the session 866b8437-2380-4392-9a35-3d5957eaf95d.",
            "sessionId": "866b8437-2380-4392-9a35-3d5957eaf95d"
        }
    }
}
{
    "jsonrpc": "2.0",
    "warning": {
        "code": 2,
        "message": "User jon.snow has already logged in to Cortex."
    }
}
{
    "jsonrpc": "2.0",
    "warning": {
        "code": 3,
        "message": "User jon.snow has already logged out from Cortex."
    }
}
{
    "jsonrpc": "2.0",
    "warning": {
        "code": 9,
        "message": "The access right to the cortex-examples has been granted"
    }
}
{
    "jsonrpc": "2.0",
    "warning": {
        "code": 10,
        "message": "The access right to the cortex-examples has been rejected"
    }
}
{
    "jsonrpc": "2.0",
    "warning": {
        "code": 13,
        "message": {
            "behavior": "Profile is loaded",
            "headset": "INSIGHT-12341234",
            "profile": "foo"
        }
    }
}
{
    "jsonrpc": "2.0",
    "warning": {
        "code": 14,
        "message": {
            "behavior": "Profile is unloaded",
            "headset": "INSIGHT-12341234",
            "profile": "foo"
        }
    }
}
{
    "jsonrpc": "2.0",
    "warning": {
        "code": 15,
        "message": {
            "behavior": "Cortex has unloaded the profile",
            "headset": "INSIGHT-12341234",
            "profile": "foo"
        }
    }
}
{
    "jsonrpc": "2.0",
    "warning": {
        "code": 17,
        "message": "User jon.snow has accepted the EULA via EMOTIV App"
    }
}
{
    "jsonrpc": "2.0",
    "warning": {
        "code": 18,
        "message": {
            "behavior":"The session data has been successfully saved.",
            "deviceSessionId":"222eb845-bc44-4a01-bf28-07445a7c7e8a",
            "recordId":"76c3468a-d9c0-428d-81b4-bdac5d63860e"
        }
    }
}
{
    "jsonrpc": "2.0",
    "warning": {
        "code": 19,
        "message": {
            "behavior": "The available disk space is low.",
            "rootPath": "/",
            "volumeName": "MAC"
        }
    }
}
{
    "jsonrpc": "2.0",
    "warning": {
        "code": 20,
        "message": {
            "behavior": "The available disk space is critically low. Cortex will disconnect all the headsets.",
            "rootPath": "C",
            "volumeName": "Windows"
        }
    }
}
{
    "jsonrpc": "2.0",
    "warning": {
        "code": 21,
        "message": {
            "currOptOut": true,
            "forceOptOut": false,
            "message": "User has changed the Opt-out configuration.",
            "optOutAvail": true
        }
    }
}
{
    "jsonrpc": "2.0",
    "warning": {
        "code": 22,
        "message": {
            "currOptOut": true,
            "forceOptOut": false,
            "message": "The Opt-out configuration has been automatically changed due to change in license.",
            "optOutAvail": true
        }
    }
}
{
    "jsonrpc": "2.0",
    "warning": {
        "code": 23,
        "message": {
            "success": true,
            "behavior": "Cortex service is ready."
        }
    }
}
{
    "jsonrpc": "2.0",
    "warning": {
        "code": 23,
        "message": {
            "success": false,
            "behavior": "Failed to setup Cortex service."
        }
    }
}
{
    "jsonrpc": "2.0",
    "warning": {
        "code": 30,
        "message": {
            "behavior":"Data post-processing finished",
            "deviceSessionId":"222eb845-bc44-4a01-bf28-07445a7c7e8a",
            "recordId":"76c3468a-d9c0-428d-81b4-bdac5d63860e",
            "timestampCorrectionProcessingStatus":"succeed"
        }
    }
}
{
    "jsonrpc": "2.0",
    "warning": {
        "code": 32,
        "message": {
            "status":"synced"
        }
    }
}
{
    "jsonrpc": "2.0",
    "warning": {
        "code": 100,
        "message": {
            "headsetId": "EPOCPLUS-3B9AXXXX",
            "behavior": "Headset cannot be connected. Please try again."
        }
    }
}
{
    "jsonrpc": "2.0",
    "warning": {
        "code": 101,
        "message": {
            "headsetId": "EPOCPLUS-3B9AXXXX",
            "behavior": "Headset cannot be connected. Please try again."
        }
    }
}
{
    "jsonrpc": "2.0",
    "warning": {
        "code": 102,
        "message": {
            "headsetId": "EPOCPLUS-3B9AXXXX",
            "behavior": "Headset cannot be connected due to connection timeout."
        }
    }
}
{
    "jsonrpc": "2.0",
    "warning": {
        "code": 113,
        "message": {
            "headsetId": "EPOCPLUS-3B9AXXXX",
            "behavior": "Please disable motion data and set EEG rate to 128Hz in headset configuration when using Bluetooth connection, or use USB dongle."
        }
    }
}
{
    "jsonrpc": "2.0",
    "warning": {
        "code": 103,
        "message": {
            "headsetId": "EPOCPLUS-3B9AXXXX",
            "behavior": "Headset has been disconnected due to connection timeout."
        }
    }
}
{
    "jsonrpc": "2.0",
    "warning": {
        "code": 104,
        "message": {
            "headsetId": "EPOCPLUS-3B9AXXXX",
            "behavior": "The headset is connected"
        }
    }
}
{
    "jsonrpc": "2.0",
    "warning": {
        "code": 110,
        "message": {
            "headsetId": "EPOCPLUS-3B9AXXXX",
            "behavior": "Headset configuration is updated."
        }
    }
}
{
    "jsonrpc": "2.0",
    "warning": {
        "code": 111,
        "message": {
            "headsetId": "EPOCPLUS-3B9AXXXX",
            "behavior": "Headset configuration update failed."
        }
    }
}
{
    "jsonrpc": "2.0",
    "warning": {
        "code": 112,
        "message": {
            "headsetId": "EPOCPLUS-3B9AXXXX",
            "behavior": "This headset configuration cannot work with BTLE on this platform."
        }
    }
}
setupProfile
setupProfile
connect a headset
opt-out
opt-out
updateHeadset
updateHeadset
updateHeadset
controlDevice
controlDevice