Example

Loading...
Searching...
No Matches
CSession.h
Go to the documentation of this file.
1// Copyright. 2019 - 2024 PSBD. All rights reserved.
2
3#pragma once
4
5#include "Capsule/CClient.h"
6#include "Capsule/CDefinesPrivate.h"
7#include "Capsule/CDevice.h"
8#include "Capsule/CEEGTimedData.h"
9
10#ifdef __cplusplus
11 extern "C" {
12#endif
13
17 typedef enum clCSessionState {
18 clC_SS_Unknown,
19 clC_SS_Starting,
20 clC_SS_Active,
21 clC_SS_Inactive,
22 clC_SS_Pausing,
23 clC_SS_Paused,
24 clC_SS_Stopping
25} clCSessionState;
26
30 typedef enum clCSessionError {
31 clC_SE_Unknown,
32 clC_SE_FailedToStart,
33 clC_SE_FailedToStop,
34 clC_SE_LostConnection
35} clCSessionError;
36
42 CLC_CLASS_WN(SessionPrivate, clCSession);
43
47 CLC_STRUCT(clCSessionDelegateSessionError);
48 typedef void (*clCSessionHandlerSessionError)(clCSession, clCSessionError);
49 CL_DLL void
50 clCSessionDelegateSessionError_Set(clCSessionDelegateSessionError delegate,
51 clCSessionHandlerSessionError callback) NOEXCEPT;
52
60 CL_DLL clCSession clCClient_CreateSessionWithError(clCClient client, clCDevice device,
61 clCError* error) NOEXCEPT;
62 CL_DLL clCSession clCClient_CreateSessionWithMonopolarChannelsWithError(clCClient client,
63 clCDevice device, clCError* error) NOEXCEPT;
64
65 typedef enum clCUserActivity {
66 clCUserActivity1,
67 clCUserActivity2,
68 clCUserActivity3,
69 clCUserActivity4,
70 clCUserActivity5,
71 clCUserActivityNone
72} clCUserActivity;
78 CL_DLL void clCSession_Destroy(clCSession session) NOEXCEPT;
85 CL_DLL int64_t clCSession_GetSessionID(clCSession session) NOEXCEPT;
92 CL_DLL clCString clCSession_GetSessionUUID(clCSession session) NOEXCEPT;
98 CL_DLL clCSessionState clCSession_GetSessionState(clCSession session) NOEXCEPT;
104 CL_DLL void clCSession_Start(clCSession session) NOEXCEPT;
110 CL_DLL void clCSession_Stop(clCSession session) NOEXCEPT;
116 CL_DLL bool clCSession_IsActive(clCSession session) NOEXCEPT;
117
124 CL_DLL void clCSession_SetExtra(clCSession session, const char* json) NOEXCEPT;
125
132 CL_DLL void clCSession_MarkActivity(clCSession session, clCUserActivity marker) NOEXCEPT;
139 CL_DLL bool clCSession_IsFilterEEG(clCSession session) NOEXCEPT;
146 CL_DLL bool clCSession_IsBipolarMode(clCSession session) NOEXCEPT;
147
151 CLC_STRUCT(clCSessionDelegate);
152 typedef void (*clCSessionHandler)(clCSession);
153 CL_DLL void clCSessionDelegate_Set(clCSessionDelegate delegate,
154 clCSessionHandler callback) NOEXCEPT;
155
161 CL_DLL clCSessionDelegate
162 clCSession_GetOnSessionStartedEvent(clCSession session) NOEXCEPT;
168 CL_DLL clCSessionDelegate
169 clCSession_GetOnSessionStoppedEvent(clCSession session) NOEXCEPT;
170
176 CL_DLL clCSessionDelegateSessionError
177 clCSession_GetOnErrorEvent(clCSession session) NOEXCEPT;
178
182 CLC_STRUCT(clCSessionDelegateSessionEEGData);
183 typedef void (*clCSessionHandlerSessionEEGData)(clCSession, clCEEGTimedData);
184 CL_DLL void
185 clCSessionDelegateSessionEEGData_Set(clCSessionDelegateSessionEEGData delegate,
186 clCSessionHandlerSessionEEGData callback) NOEXCEPT;
187
193 CL_DLL clCSessionDelegateSessionEEGData
194 clCSession_GetOnSessionEEGDataEvent(clCSession device) NOEXCEPT;
195
205[[deprecated("Use clCClient_CreateSessionWithMonopolarChannels to create session in monopolar mode")]] CL_DLL void clCSession_SetConfig(clCSession session, bool bipolarMode, bool filterEEG) NOEXCEPT;
206
207#ifdef __cplusplus
208}
209#endif
CClient.h
CDefinesPrivate.h
CLC_STRUCT
#define CLC_STRUCT(Name)
Definition CDefinesPrivate.h:24
NOEXCEPT
#define NOEXCEPT
Definition CDefinesPrivate.h:52
CL_DLL
#define CL_DLL
Definition CDefinesPrivate.h:21
CLC_CLASS_WN
#define CLC_CLASS_WN(Wrapped, Name)
Definition CDefinesPrivate.h:54
CDevice.h
CEEGTimedData.h
clCError
clCError
Capsule error.
Definition CError.h:8
clCSession_IsActive
CL_DLL bool clCSession_IsActive(clCSession session) NOEXCEPT
Is the session active.
clCSessionHandlerSessionError
void(* clCSessionHandlerSessionError)(clCSession, clCSessionError)
Definition CSession.h:48
clCClient_CreateSessionWithMonopolarChannelsWithError
CL_DLL clCSession clCClient_CreateSessionWithMonopolarChannelsWithError(clCClient client, clCDevice device, clCError *error) NOEXCEPT
clCSession_GetSessionState
CL_DLL clCSessionState clCSession_GetSessionState(clCSession session) NOEXCEPT
Get session state.
clCSessionDelegateSessionEEGData_Set
CL_DLL void clCSessionDelegateSessionEEGData_Set(clCSessionDelegateSessionEEGData delegate, clCSessionHandlerSessionEEGData callback) NOEXCEPT
clCSession_Start
CL_DLL void clCSession_Start(clCSession session) NOEXCEPT
Start the session.
clCSession_SetConfig
CL_DLL void clCSession_SetConfig(clCSession session, bool bipolarMode, bool filterEEG) NOEXCEPT
Configure whether channels in the session should work in bipolar mode.
clCSession_Destroy
CL_DLL void clCSession_Destroy(clCSession session) NOEXCEPT
Destroy Capsule session. Release the handle.
clCSessionDelegateSessionError_Set
CL_DLL void clCSessionDelegateSessionError_Set(clCSessionDelegateSessionError delegate, clCSessionHandlerSessionError callback) NOEXCEPT
clCSession_SetExtra
CL_DLL void clCSession_SetExtra(clCSession session, const char *json) NOEXCEPT
Set extra data to send to platform.
clCSession_GetOnSessionEEGDataEvent
CL_DLL clCSessionDelegateSessionEEGData clCSession_GetOnSessionEEGDataEvent(clCSession device) NOEXCEPT
Get delegate for session EEG data event. Session EEG data may be filtered and in bipolar mode dependi...
clCUserActivity
clCUserActivity
Definition CSession.h:65
clCUserActivity1
@ clCUserActivity1
Definition CSession.h:66
clCUserActivity5
@ clCUserActivity5
Definition CSession.h:70
clCUserActivity4
@ clCUserActivity4
Definition CSession.h:69
clCUserActivity3
@ clCUserActivity3
Definition CSession.h:68
clCUserActivity2
@ clCUserActivity2
Definition CSession.h:67
clCUserActivityNone
@ clCUserActivityNone
Definition CSession.h:71
clCSession_MarkActivity
CL_DLL void clCSession_MarkActivity(clCSession session, clCUserActivity marker) NOEXCEPT
Mark user activity start/stop.
clCSession_GetOnErrorEvent
CL_DLL clCSessionDelegateSessionError clCSession_GetOnErrorEvent(clCSession session) NOEXCEPT
Get session delegate for error event.
clCSession_GetOnSessionStartedEvent
CL_DLL clCSessionDelegate clCSession_GetOnSessionStartedEvent(clCSession session) NOEXCEPT
Get session delegate for started event.
clCSession_GetOnSessionStoppedEvent
CL_DLL clCSessionDelegate clCSession_GetOnSessionStoppedEvent(clCSession session) NOEXCEPT
Get session delegate for stopped event.
clCSessionHandler
void(* clCSessionHandler)(clCSession)
Definition CSession.h:152
clCSession_IsFilterEEG
CL_DLL bool clCSession_IsFilterEEG(clCSession session) NOEXCEPT
Check if EEG in the session is filtered.
clCSession_Stop
CL_DLL void clCSession_Stop(clCSession session) NOEXCEPT
Stop the session.
clCSessionDelegate_Set
CL_DLL void clCSessionDelegate_Set(clCSessionDelegate delegate, clCSessionHandler callback) NOEXCEPT
clCSession_GetSessionUUID
CL_DLL clCString clCSession_GetSessionUUID(clCSession session) NOEXCEPT
Get UUID of the session.
clCSessionError
clCSessionError
Session error.
Definition CSession.h:30
clC_SE_Unknown
@ clC_SE_Unknown
Definition CSession.h:31
clC_SE_LostConnection
@ clC_SE_LostConnection
Definition CSession.h:34
clC_SE_FailedToStart
@ clC_SE_FailedToStart
Definition CSession.h:32
clC_SE_FailedToStop
@ clC_SE_FailedToStop
Definition CSession.h:33
clCSessionState
clCSessionState
Session state.
Definition CSession.h:17
clC_SS_Active
@ clC_SS_Active
Definition CSession.h:20
clC_SS_Paused
@ clC_SS_Paused
Definition CSession.h:23
clC_SS_Unknown
@ clC_SS_Unknown
Definition CSession.h:18
clC_SS_Pausing
@ clC_SS_Pausing
Definition CSession.h:22
clC_SS_Stopping
@ clC_SS_Stopping
Definition CSession.h:24
clC_SS_Starting
@ clC_SS_Starting
Definition CSession.h:19
clC_SS_Inactive
@ clC_SS_Inactive
Definition CSession.h:21
clCSessionHandlerSessionEEGData
void(* clCSessionHandlerSessionEEGData)(clCSession, clCEEGTimedData)
Definition CSession.h:183
clCSession_GetSessionID
CL_DLL int64_t clCSession_GetSessionID(clCSession session) NOEXCEPT
Get numeric ID of the session.
clCSession_IsBipolarMode
CL_DLL bool clCSession_IsBipolarMode(clCSession session) NOEXCEPT
Check if bipolar mode is enabled for the session.
clCClient_CreateSessionWithError
CL_DLL clCSession clCClient_CreateSessionWithError(clCClient client, clCDevice device, clCError *error) NOEXCEPT
Create a Capsule session. Requires a device.