Capsule API Example

Loading...
Searching...
No Matches
CDevice.h
Go to the documentation of this file.
1// Copyright. 2019 - 2024 PSBD. All rights reserved.
2
3#pragma once
4
5#include "CDefinesPrivate.h"
6#include "CDeviceLocator.h"
7#include "CEEGArtifacts.h"
8#include "CEEGTimedData.h"
9#include "CError.h"
10#include "CPSDData.h"
11#include "CResistances.h"
12
13#include <stdbool.h>
14
15#ifdef __cplusplus
16 extern "C" {
17#endif
18
24 CLC_CLASS_WN(DevicePrivate, clCDevice);
25
26 typedef enum clCDevice_Mode {
27 clCDevice_Mode_Resistance = 0,
28 clCDevice_Mode_Signal,
29 clCDevice_Mode_SignalAndResist,
30 clCDevice_Mode_StartMEMS,
31 clCDevice_Mode_StopMEMS,
32 clCDevice_Mode_StartPPG,
33 clCDevice_Mode_StopPPG,
34} clCDevice_Mode;
35
39 typedef enum clCDevice_ConnectionStatus {
40 clCDevice_ConnectionState_Disconnected = 0,
41 clCDevice_ConnectionState_Connected = 1,
42 clCDevice_ConnectionState_UnsupportedConnection = 2,
43} clCDevice_ConnectionStatus;
44
45 CLC_STRUCT_WNN(DeviceChannelNames, clCDevice_ChannelNames, device);
46
55 CL_DLL clCDevice clCDeviceLocator_CreateDevice(clCDeviceLocator locator, const char* deviceSerial, clCError* error) NOEXCEPT;
56
57 typedef void (*clCDevice_ConnectionStatusChangedHandler)(clCDevice, clCDevice_ConnectionStatus) NOEXCEPT;
58 CL_DLL void clCDevice_SetOnConnectionStatusChangedEvent(clCDevice device, clCDevice_ConnectionStatusChangedHandler handler) NOEXCEPT;
59
60 typedef void (*clCDevice_OnResistanceUpdateHandler)(clCDevice, clCResistance) NOEXCEPT;
61 CL_DLL void clCDevice_SetOnResistanceUpdateEvent(clCDevice device, clCDevice_OnResistanceUpdateHandler handler) NOEXCEPT;
62
63 typedef void (*clCDevice_OnBatteryChargeUpdateHandler)(clCDevice, uint8_t) NOEXCEPT;
64 CL_DLL void clCDevice_SetOnBatteryChargeUpdateEvent(clCDevice device, clCDevice_OnBatteryChargeUpdateHandler) NOEXCEPT;
65
66 typedef void (*clCDevice_ModeSwitchedHandler)(clCDevice, clCDevice_Mode) NOEXCEPT;
67 CL_DLL void clCDevice_SetOnModeSwitchedEvent(clCDevice device, clCDevice_ModeSwitchedHandler handler) NOEXCEPT;
68
69 typedef void (*clCDevice_EEGDataHandler)(clCDevice, clCEEGTimedData) NOEXCEPT;
70 CL_DLL void clCDevice_SetOnEEGDataEvent(clCDevice device, clCDevice_EEGDataHandler handler) NOEXCEPT;
71
72 typedef void (*clCDevice_PSDDataHandler)(clCDevice, clCPSDData) NOEXCEPT;
73 CL_DLL void clCDevice_SetOnPSDDataEvent(clCDevice device, clCDevice_PSDDataHandler handler) NOEXCEPT;
74
75 typedef void (*clCDevice_EEGArtifactsHandler)(clCDevice, clCEEGArtifacts) NOEXCEPT;
76 CL_DLL void clCDevice_SetOnEEGArtifactsEvent(clCDevice device, clCDevice_EEGArtifactsHandler handler) NOEXCEPT;
77
78 typedef void (*clCDevice_ErrorHandler)(clCDevice, const char*) NOEXCEPT;
79 CL_DLL void clCDevice_SetOnErrorEvent(clCDevice device, clCDevice_ErrorHandler handler) NOEXCEPT;
80
90 CL_DLL void clCDevice_Connect(clCDevice device, bool bipolarChannels, clCError* error) NOEXCEPT;
98 CL_DLL void clCDevice_Disconnect(clCDevice device, clCError* error) NOEXCEPT;
106 CL_DLL uint8_t clCDevice_GetBatteryCharge(clCDevice device, clCError* error) NOEXCEPT;
107
114 CL_DLL void clCDevice_Start(clCDevice device, clCError* error) NOEXCEPT;
121 CL_DLL void clCDevice_Stop(clCDevice device, clCError* error) NOEXCEPT;
122
128 CL_DLL clCDevice_Mode clCDevice_GetMode(clCDevice device) NOEXCEPT;
129
136 CL_DLL bool clCDevice_IsConnected(clCDevice device, clCError* error) NOEXCEPT;
137
145 CL_DLL clCDeviceInfo clCDevice_GetInfo(clCDevice device, clCError* error) NOEXCEPT;
146
154 CL_DLL float clCDevice_GetEEGSampleRate(clCDevice device, clCError* error) NOEXCEPT;
155
163 CL_DLL float clCDevice_GetPPGSampleRate(clCDevice device, clCError* error) NOEXCEPT;
171 CL_DLL float clCDevice_GetMEMSSampleRate(clCDevice device, clCError* error) NOEXCEPT;
179 CL_DLL int32_t clCDevice_GetPPGIrAmplitude(clCDevice device, clCError* error) NOEXCEPT;
187 CL_DLL int32_t clCDevice_GetPPGRedAmplitude(clCDevice device, clCError* error) NOEXCEPT;
188
196 CL_DLL clCDevice_ChannelNames clCDevice_GetChannelNames(clCDevice device, clCError* error) NOEXCEPT;
197
198 CL_DLL int32_t clCDevice_ChannelNames_GetChannelsCount(clCDevice_ChannelNames deviceChannels, clCError* error) NOEXCEPT;
199
200 CL_DLL int32_t clCDevice_ChannelNames_GetChannelIndexByName(clCDevice_ChannelNames deviceChannels, const char* channelName, clCError* error) NOEXCEPT;
201
202 CL_DLL const char* clCDevice_ChannelNames_GetChannelNameByIndex(clCDevice_ChannelNames deviceChannels, int32_t channelIndex, clCError* error) NOEXCEPT;
203
209 CL_DLL void clCDevice_Release(clCDevice device) NOEXCEPT;
210
211#ifdef __cplusplus
212}
213#endif
CDefinesPrivate.h
NOEXCEPT
#define NOEXCEPT
Definition CDefinesPrivate.h:82
CL_DLL
#define CL_DLL
Definition CDefinesPrivate.h:51
CLC_CLASS_WN
#define CLC_CLASS_WN(Wrapped, Name)
Definition CDefinesPrivate.h:84
clCDevice_Disconnect
CL_DLL void clCDevice_Disconnect(clCDevice device, clCError *error) NOEXCEPT
clCDevice_SetOnEEGDataEvent
CL_DLL void clCDevice_SetOnEEGDataEvent(clCDevice device, clCDevice_EEGDataHandler handler) NOEXCEPT
clCDevice_Release
CL_DLL void clCDevice_Release(clCDevice device) NOEXCEPT
clCDevice_GetMode
CL_DLL clCDevice_Mode clCDevice_GetMode(clCDevice device) NOEXCEPT
clCDevice_Start
CL_DLL void clCDevice_Start(clCDevice device, clCError *error) NOEXCEPT
Start device.
clCDevice_OnResistanceUpdateHandler
void(* clCDevice_OnResistanceUpdateHandler)(clCDevice, clCResistance) NOEXCEPT
Definition CDevice.h:60
clCDevice_Mode
clCDevice_Mode
Definition CDevice.h:26
clCDevice_Mode_StartPPG
@ clCDevice_Mode_StartPPG
Definition CDevice.h:32
clCDevice_Mode_StartMEMS
@ clCDevice_Mode_StartMEMS
Definition CDevice.h:30
clCDevice_Mode_Signal
@ clCDevice_Mode_Signal
Definition CDevice.h:28
clCDevice_Mode_Resistance
@ clCDevice_Mode_Resistance
Definition CDevice.h:27
clCDevice_Mode_SignalAndResist
@ clCDevice_Mode_SignalAndResist
Definition CDevice.h:29
clCDevice_Mode_StopPPG
@ clCDevice_Mode_StopPPG
Definition CDevice.h:33
clCDevice_Mode_StopMEMS
@ clCDevice_Mode_StopMEMS
Definition CDevice.h:31
clCDevice_EEGArtifactsHandler
void(* clCDevice_EEGArtifactsHandler)(clCDevice, clCEEGArtifacts) NOEXCEPT
Definition CDevice.h:75
clCDeviceLocator_CreateDevice
CL_DLL clCDevice clCDeviceLocator_CreateDevice(clCDeviceLocator locator, const char *deviceSerial, clCError *error) NOEXCEPT
clCDevice_SetOnConnectionStatusChangedEvent
CL_DLL void clCDevice_SetOnConnectionStatusChangedEvent(clCDevice device, clCDevice_ConnectionStatusChangedHandler handler) NOEXCEPT
clCDevice_OnBatteryChargeUpdateHandler
void(* clCDevice_OnBatteryChargeUpdateHandler)(clCDevice, uint8_t) NOEXCEPT
Definition CDevice.h:63
clCDevice_IsConnected
CL_DLL bool clCDevice_IsConnected(clCDevice device, clCError *error) NOEXCEPT
clCDevice_SetOnBatteryChargeUpdateEvent
CL_DLL void clCDevice_SetOnBatteryChargeUpdateEvent(clCDevice device, clCDevice_OnBatteryChargeUpdateHandler) NOEXCEPT
clCDevice_SetOnPSDDataEvent
CL_DLL void clCDevice_SetOnPSDDataEvent(clCDevice device, clCDevice_PSDDataHandler handler) NOEXCEPT
clCDevice_Connect
CL_DLL void clCDevice_Connect(clCDevice device, bool bipolarChannels, clCError *error) NOEXCEPT
clCDevice_ChannelNames_GetChannelsCount
CL_DLL int32_t clCDevice_ChannelNames_GetChannelsCount(clCDevice_ChannelNames deviceChannels, clCError *error) NOEXCEPT
clCDevice_ConnectionStatusChangedHandler
void(* clCDevice_ConnectionStatusChangedHandler)(clCDevice, clCDevice_ConnectionStatus) NOEXCEPT
Definition CDevice.h:57
clCDevice_ChannelNames_GetChannelNameByIndex
CL_DLL const char * clCDevice_ChannelNames_GetChannelNameByIndex(clCDevice_ChannelNames deviceChannels, int32_t channelIndex, clCError *error) NOEXCEPT
clCDevice_SetOnErrorEvent
CL_DLL void clCDevice_SetOnErrorEvent(clCDevice device, clCDevice_ErrorHandler handler) NOEXCEPT
clCDevice_ConnectionStatus
clCDevice_ConnectionStatus
Device connection status.
Definition CDevice.h:39
clCDevice_ConnectionState_Connected
@ clCDevice_ConnectionState_Connected
Definition CDevice.h:41
clCDevice_ConnectionState_Disconnected
@ clCDevice_ConnectionState_Disconnected
Definition CDevice.h:40
clCDevice_ConnectionState_UnsupportedConnection
@ clCDevice_ConnectionState_UnsupportedConnection
Definition CDevice.h:42
clCDevice_GetPPGIrAmplitude
CL_DLL int32_t clCDevice_GetPPGIrAmplitude(clCDevice device, clCError *error) NOEXCEPT
clCDevice_ChannelNames_GetChannelIndexByName
CL_DLL int32_t clCDevice_ChannelNames_GetChannelIndexByName(clCDevice_ChannelNames deviceChannels, const char *channelName, clCError *error) NOEXCEPT
clCDevice_GetEEGSampleRate
CL_DLL float clCDevice_GetEEGSampleRate(clCDevice device, clCError *error) NOEXCEPT
clCDevice_GetPPGRedAmplitude
CL_DLL int32_t clCDevice_GetPPGRedAmplitude(clCDevice device, clCError *error) NOEXCEPT
clCDevice_EEGDataHandler
void(* clCDevice_EEGDataHandler)(clCDevice, clCEEGTimedData) NOEXCEPT
Definition CDevice.h:69
clCDevice_PSDDataHandler
void(* clCDevice_PSDDataHandler)(clCDevice, clCPSDData) NOEXCEPT
Definition CDevice.h:72
CLC_STRUCT_WNN
CLC_STRUCT_WNN(DeviceChannelNames, clCDevice_ChannelNames, device)
clCDevice_GetChannelNames
CL_DLL clCDevice_ChannelNames clCDevice_GetChannelNames(clCDevice device, clCError *error) NOEXCEPT
clCDevice_GetBatteryCharge
CL_DLL uint8_t clCDevice_GetBatteryCharge(clCDevice device, clCError *error) NOEXCEPT
Get device battery charge.
clCDevice_GetPPGSampleRate
CL_DLL float clCDevice_GetPPGSampleRate(clCDevice device, clCError *error) NOEXCEPT
clCDevice_GetInfo
CL_DLL clCDeviceInfo clCDevice_GetInfo(clCDevice device, clCError *error) NOEXCEPT
clCDevice_Stop
CL_DLL void clCDevice_Stop(clCDevice device, clCError *error) NOEXCEPT
Stop device.
clCDevice_ModeSwitchedHandler
void(* clCDevice_ModeSwitchedHandler)(clCDevice, clCDevice_Mode) NOEXCEPT
Definition CDevice.h:66
clCDevice_ErrorHandler
void(* clCDevice_ErrorHandler)(clCDevice, const char *) NOEXCEPT
Definition CDevice.h:78
clCDevice_SetOnResistanceUpdateEvent
CL_DLL void clCDevice_SetOnResistanceUpdateEvent(clCDevice device, clCDevice_OnResistanceUpdateHandler handler) NOEXCEPT
clCDevice_SetOnEEGArtifactsEvent
CL_DLL void clCDevice_SetOnEEGArtifactsEvent(clCDevice device, clCDevice_EEGArtifactsHandler handler) NOEXCEPT
clCDevice_GetMEMSSampleRate
CL_DLL float clCDevice_GetMEMSSampleRate(clCDevice device, clCError *error) NOEXCEPT
clCDevice_SetOnModeSwitchedEvent
CL_DLL void clCDevice_SetOnModeSwitchedEvent(clCDevice device, clCDevice_ModeSwitchedHandler handler) NOEXCEPT
CDeviceLocator.h
CEEGArtifacts.h
CEEGTimedData.h
CError.h
CPSDData.h
CResistances.h
clCError
Definition CError.h:28