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.

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

Parameters

Name

Type

Required

Description

cortexToken

string

yes

A token returned by authorize.

status

string

yes

Must be "open" or "active".

headset

string

no

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

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

Result

The result is a session object representing the created session.

Examples

Open a session.

{
    "id": 1,
    "jsonrpc": "2.0",
    "method": "createSession",
    "params": {
        "cortexToken": "xxx",
        "headset": "EPOCPLUS-3B9AXXX",
        "status": "open"
    }
}

Open a session and activate it.

{
    "id": 1,
    "jsonrpc": "2.0",
    "method": "createSession",
    "params": {
        "cortexToken": "xxx",
        "headset": "EPOCPLUS-3B9AXXX",
        "status": "active"
    }
}

Last updated