Cortex API
  • Getting Started
  • Connecting to the Cortex API
  • Overview of API flow
  • Authentication
    • getCortexInfo
    • getUserLogin
    • requestAccess
    • hasAccessRight
    • authorize
    • generateNewToken
    • getUserInformation
    • getLicenseInfo
  • Headsets
    • controlDevice
    • queryHeadsets
    • updateHeadset
    • updateHeadsetCustomInfo
    • syncWithHeadsetClock
    • Headset object
  • Sessions
    • createSession
    • updateSession
    • querySessions
    • Session object
  • Data Subscription
    • subscribe
    • unsubscribe
    • Data sample object
  • Records
    • createRecord
    • stopRecord
    • updateRecord
    • deleteRecord
    • exportRecord
    • queryRecords
    • getRecordInfos
    • configOptOut
    • requestToDownloadRecordData
    • Record object
  • Markers
    • injectMarker
    • updateMarker
    • Marker object
  • Subjects
    • createSubject
    • updateSubject
    • deleteSubjects
    • querySubjects
    • getDemographicAttributes
    • Subject object
  • BCI
    • queryProfile
    • getCurrentProfile
    • setupProfile
    • loadGuestProfile
    • getDetectionInfo
    • training
    • Readonly profile
  • Advanced BCI
    • getTrainedSignatureActions
    • getTrainingTime
    • facialExpressionSignatureType
    • facialExpressionThreshold
    • mentalCommandActiveAction
    • mentalCommandBrainMap
    • mentalCommandGetSkillRating
    • mentalCommandTrainingThreshold
    • mentalCommandActionSensitivity
  • Warning Objects
  • Error Codes
  • Troubleshooting Guide
  • Release Notes
  • cortexaccess tool
Powered by GitBook
On this page
  • Parameters
  • Result
  • Examples
  1. Sessions

createSession

PreviousSessionsNextupdateSession

Last updated 5 years ago

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 to connect the headset. You cannot open a session with a headset connected by a USB cable. You can use to check the status and connection type of the headset.

You can use to activate or close a session.

See for details.

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

Parameters

Name

Type

Required

Description

cortexToken

string

yes

status

string

yes

Must be "open" or "active".

headset

string

no

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

Result

The result is a representing the created session.

Examples

Open a session.

{
    "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": []
    }
}

Open a session and activate it.

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

A token returned by .

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

controlDevice
queryHeadsets
updateSession
Sessions
queryHeadsets
updateSession
session object
authorize
queryHeadsets