cortex

package
v0.0.0-...-cb93760 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 30, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ErrInvalidData = "invalid length of data"
)

Variables

This section is empty.

Functions

func ConnectHeadset

func ConnectHeadset(ws *websocket.Conn, headsetName, clientId, clientSecret string) (string, string, error)

func Listen

func Listen(ws *websocket.Conn, token, headsetId, name string) error

func Receive

func Receive[T any](ws *websocket.Conn, resp T) error

func Send

func Send(ws *websocket.Conn, request Request) error

Types

type AccessResponse

type AccessResponse struct {
	AccessGranted bool   `json:"accessGranted"`
	Message       string `json:"message"`
}

type AuthParams

type AuthParams struct {
	ClientID     string `json:"clientId"`
	ClientSecret string `json:"clientSecret"`
	License      string `json:"license,omitempty"`
	Debit        int    `json:"debit,omitempty"`
}

type AuthResult

type AuthResult struct {
	CortexToken string      `json:"cortexToken"`
	Warning     interface{} `json:"warning"`
}

type AuthorizeResponse

type AuthorizeResponse struct {
	CortexToken string `json:"cortexToken"`
}

type ConnectHeadsetResponse

type ConnectHeadsetResponse struct {
	Command string `json:"command"`
	Message string `json:"message"`
}

type ControlDeviceParams

type ControlDeviceParams struct {
	Command string `json:"command"`
	Headset string `json:"headset"`
}

type DataSample

type DataSample struct {
	Com  []interface{} `json:"com"`
	SID  string        `json:"sid"`
	Time float32       `json:"time"`
}

type DefaultInfoResponse

type DefaultInfoResponse struct {
	BuildDate              string `json:"buildDate"`
	BuildNumber            string `json:"buildNumber"`
	CloudSyncLogFolderPath string `json:"cloudSyncLogFolderPath"`
	CortexLogFolderPath    string `json:"cortexLogFolderPath"`
	Version                string `json:"version"`
}

type GetProfileParams

type GetProfileParams struct {
	CortexToken string `json:"cortexToken"`
	Headset     string `json:"headset"`
}

type HeadsetResponse

type HeadsetResponse struct {
	ID               string   `json:"id"`
	Status           string   `json:"status"`
	ConnectedBy      string   `json:"connectedBy"`
	Dongle           string   `json:"dongle"`
	Firmware         string   `json:"firmware"`
	MotionSensors    []string `json:"motionSensors"`
	Sensors          []string `json:"sensors"`
	Settings         Settings `json:"settings"`
	HeadbandPosition string   `json:"headbandPosition"`
	CustomName       string   `json:"customName"`
}

type HeadsetsResponse

type HeadsetsResponse []HeadsetResponse

type Request

type Request struct {
	ID      int         `json:"id"`
	JsonRPC string      `json:"jsonrpc"`
	Method  string      `json:"method"`
	Params  interface{} `json:"params"`
}

func GetAccessRequest

func GetAccessRequest(clientId, clientSecret string) Request

func GetAuthorizeRequest

func GetAuthorizeRequest(clientId, clientSecret string) Request

func GetCloseSessionRequest

func GetCloseSessionRequest(token, sessionID string) Request

func GetConnectHeadsetRequest

func GetConnectHeadsetRequest(headsetID string) Request

func GetDefaultInfoRequest

func GetDefaultInfoRequest() Request

func GetHeadsetsRequest

func GetHeadsetsRequest() Request

func GetOpenSessionRequest

func GetOpenSessionRequest(token, headsetID string) Request

func GetSubscribeRequest

func GetSubscribeRequest(token, sessionId string) Request

type Response

type Response[T any] struct {
	ID      int         `json:"id"`
	JsonRPC string      `json:"jsonrpc"`
	Result  T           `json:"result"`
	Error   interface{} `json:"error"`
}

type SessionCreateParams

type SessionCreateParams struct {
	CortexToken string `json:"cortexToken"`
	Status      string `json:"status"`
	Headset     string `json:"headset"`
}

type SessionResponse

type SessionResponse struct {
	ID        string          `json:"id"`
	Status    string          `json:"status"`
	Owner     string          `json:"owner"`
	License   string          `json:"license"`
	AppID     string          `json:"appId"`
	Started   string          `json:"started"`
	Stopped   string          `json:"stopped"`
	Streams   []string        `json:"streams"`
	RecordIDs []string        `json:"recordIds"`
	Recording bool            `json:"recording"`
	Headset   HeadsetResponse `json:"headset"`
}

type SessionUpdateParams

type SessionUpdateParams struct {
	CortexToken string `json:"cortexToken"`
	Session     string `json:"session"`
	Status      string `json:"status"`
}

type Settings

type Settings struct {
	EegRate  int    `json:"eegRate"`
	EegRes   int    `json:"eegRes"`
	MemsRate int    `json:"memsRate"`
	MemsRes  int    `json:"memsRes"`
	Mode     string `json:"mode"`
}

type SetupProfileParams

type SetupProfileParams struct {
	CortexToken string `json:"cortexToken"`
	Headset     string `json:"headset"`
	Profile     string `json:"profile"`
	Status      string `json:"status"`
}

type SubscribeData

type SubscribeData struct {
	Pow       []float64 `json:"pow"`
	SessionID string    `json:"sid"`
	Time      float64   `json:"time"`
}

type SubscribeParams

type SubscribeParams struct {
	CortexToken string   `json:"cortexToken"`
	Session     string   `json:"session"`
	Streams     []string `json:"streams"`
}

type SubscribeResponse

type SubscribeResponse struct {
	Success []SubscribeSuccess `json:"success"`
}

type SubscribeSuccess

type SubscribeSuccess struct {
	StreamName string   `json:"streamName"`
	Cols       []string `json:"cols"`
	SessionID  string   `json:"sid"`
}

type TrainingParams

type TrainingParams struct {
	CortexToken string `json:"cortexToken"`
	Session     string `json:"session"`
	Detection   string `json:"detection"`
	Status      string `json:"status"`
	Action      string `json:"action"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL