arrow-left

All pages
gitbookPowered by GitBook
1 of 1

Loading...

createSession

This method is to open a session with an EMOTIV headset.

To open a session with a headset, the status of the headset must be "connected". If the status is "discovered", then you must call controlDevice to connect the headset. You cannot open a session with a headset connected by a USB cable. You can use queryHeadsets to check the status and connection type of the headset.

You can use updateSession to activate or close a session.

See Sessions for details.

circle-info

Make sure the headset has the status "connected" before you call this method. Use to check the status of the headset.

hashtag
Parameters

If the status is "open", then the session won't be activated. You can activate the session later by calling .

hashtag
Result

The result is a representing the created session.

hashtag
Examples

Open a session.

Open a session and activate it.

no

A headset id returned by . If you omit this parameter, then Cortex will use the first connected headset.

Name

Type

Required

Description

cortexToken

string

yes

A token returned by authorize.

status

string

yes

Must be "open" or "active".

headset

queryHeadsets
updateSession
session object

string

{
    "id": 1,
    "jsonrpc": "2.0",
    "method": "createSession",
    "params": {
        "cortexToken": "xxx",
        "headset": "EPOCPLUS-3B9AXXX",
        "status": "open"
    }
}
{
    "id": 1,
    "jsonrpc": "2.0",
    "result": {
        "appId": "com.jon.snow.winterfell-app",
        "headset": {
            "connectedBy": "dongle",
            "customName": "",
            "dongle": "6ff",
            "firmware": "625",
            "id": "EPOCPLUS-3B9AXXXX",
            "motionSensors": [
                "GYROX",
                "GYROY",
                "GYROZ",
                "ACCX",
                "ACCY",
                "ACCZ",
                "MAGX",
                "MAGY",
                "MAGZ"
            ],
            "sensors": [
                "AF3",
                "F7",
                "F3",
                "FC5",
                "T7",
                "P7",
                "O1",
                "O2",
                "P8",
                "T8",
                "FC6",
                "F4",
                "F8",
                "AF4"
            ],
            "settings": {
                "eegRate": 256,
                "eegRes": 16,
                "memsRate": 64,
                "memsRes": 16,
                "mode": "EPOCPLUS"
            },
            "status": "connected"
        },
        "id": "8bfc26de-754b-4c1f-9771-acfd1a7da02c",
        "license": "",
        "owner": "jon.snow",
        "recordIds": [],
        "recording": false,
        "started": "2019-05-29T14:18:45.108+07:00",
        "status": "opened",
        "stopped": "",
        "streams": []
    }
}
{
    "id": 1,
    "jsonrpc": "2.0",
    "method": "createSession",
    "params": {
        "cortexToken": "xxx",
        "headset": "EPOCPLUS-3B9AXXX",
        "status": "active"
    }
}
{
    "id": 1,
    "jsonrpc": "2.0",
    "result": {
    }
}
queryHeadsets