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
11
12#include <stdbool.h>
13
14#ifdef __cplusplus
15extern "C" {
16#endif
17
23CLC_CLASS_WN(DevicePrivate, clCDevice);
24
25typedef enum clCDeviceMode {
36
45
53CL_DLL clCDevice clCDeviceLocator_CreateDevice(clCDeviceLocator locator, const char* deviceID) NOEXCEPT;
54
58CLC_STRUCT(clCDeviceDelegate);
59typedef void (*clCDeviceHandler)(clCDevice);
60CL_DLL void clCDeviceDelegate_Set(clCDeviceDelegate delegate,
61 clCDeviceHandler callback) NOEXCEPT;
62
66CLC_STRUCT(clCDeviceDelegateResistances);
67typedef void (*clCDeviceHandlerResistances)(clCDevice, clCResistances);
68CL_DLL void
69clCDeviceDelegateResistances_Set(clCDeviceDelegateResistances delegate,
74CLC_STRUCT(clCDeviceDelegateMEMSData);
75typedef void (*clCDeviceHandlerMEMSData)(clCDevice, clCMEMSTimedData);
76CL_DLL void
77clCDeviceDelegateMEMSData_Set(clCDeviceDelegateMEMSData delegate,
82CLC_STRUCT(clCDeviceDelegatePPGData);
83typedef void (*clCDeviceHandlerPPGData)(clCDevice, clCPPGTimedData);
84CL_DLL void
85clCDeviceDelegatePPGData_Set(clCDeviceDelegatePPGData delegate,
90CLC_STRUCT(clCDeviceDelegateEEGData);
91typedef void (*clCDeviceHandlerEEGData)(clCDevice, clCEEGTimedData);
92CL_DLL void
93clCDeviceDelegateEEGData_Set(clCDeviceDelegateEEGData delegate,
98typedef unsigned char clCUChar;
99CLC_STRUCT(clCDeviceDelegateUChar);
100typedef void (*clCDeviceHandlerUChar)(clCDevice, clCUChar);
101CL_DLL void clCDeviceDelegateBatteryCharge_Set(clCDeviceDelegateUChar delegate,
103
104CLC_STRUCT(clCDeviceDelegateMode);
105typedef void (*clCDeviceHandlerMode)(clCDevice, clCDeviceMode);
106CL_DLL void clCDeviceDelegateMode_Set(clCDeviceDelegateMode delegate,
113CLC_STRUCT(clCDeviceDelegateDeviceConnectionState);
115CL_DLL clCDeviceDelegateDeviceConnectionState
117
121CLC_STRUCT(clCDeviceDelegateConnectionState);
123CL_DLL void clCDeviceDelegateConnectionState_Set(clCDeviceDelegateDeviceConnectionState delegate,
125
132CL_DLL void clCDevice_Connect(clCDevice device) NOEXCEPT;
139CL_DLL void clCDevice_Disconnect(clCDevice device) NOEXCEPT;
159CL_DLL clCString clCDevice_GetFirmwareVersion(clCDevice device, clCError* error) NOEXCEPT;
168
174CL_DLL bool clCDevice_IsConnected(clCDevice device) NOEXCEPT;
181CL_DLL clCDeviceInfo clCDevice_GetInfo(clCDevice device) NOEXCEPT;
187CLC_STRUCT_WN(DeviceChannelNames, clCDeviceChannelNames);
188CL_DLL clCDeviceChannelNames clCDevice_GetChannelNames(clCDevice device) NOEXCEPT;
189
190CL_DLL int32_t clCDevice_GetChannelsCount(clCDeviceChannelNames deviceChannels) NOEXCEPT;
191
192CL_DLL int32_t clCDevice_GetChannelIndexByName(clCDeviceChannelNames deviceChannels,
193 const char* channelName) NOEXCEPT;
194
195CL_DLL clCString clCDevice_GetChannelNameByIndex(clCDeviceChannelNames deviceChannels,
196 int32_t channelIndex) NOEXCEPT;
202CL_DLL clCDeviceDelegateResistances
209CL_DLL clCDeviceDelegateMEMSData
216CL_DLL clCDeviceDelegatePPGData
218
224CL_DLL clCDeviceDelegateEEGData
226
232CL_DLL clCDeviceDelegateUChar clCDevice_GetOnBatteryChargeEvent(clCDevice device) NOEXCEPT;
233CL_DLL clCDeviceDelegateMode clCDevice_GetOnModeSwitchedEvent(clCDevice device) NOEXCEPT;
239CL_DLL void clCDevice_Release(clCDevice device) NOEXCEPT;
240
241#ifdef __cplusplus
242}
243#endif
#define CLC_STRUCT(Name)
Definition CDefinesPrivate.h:24
#define NOEXCEPT
Definition CDefinesPrivate.h:52
#define CL_DLL
Definition CDefinesPrivate.h:21
#define CLC_CLASS_WN(Wrapped, Name)
Definition CDefinesPrivate.h:54
#define CLC_STRUCT_WN(Wrapped, Name)
Definition CDefinesPrivate.h:58
CL_DLL void clCDeviceDelegateConnectionState_Set(clCDeviceDelegateDeviceConnectionState delegate, clCDeviceHandlerConnectionState callback) NOEXCEPT
CL_DLL clCUChar clCDevice_GetBatteryCharge(clCDevice device) NOEXCEPT
Get device battery charge.
void(* clCDeviceHandlerMode)(clCDevice, clCDeviceMode)
Definition CDevice.h:105
clCDeviceConnectionState
Device connection state.
Definition CDevice.h:40
@ clC_SE_Connected
Definition CDevice.h:42
@ clC_SE_UnsupportedConnection
Definition CDevice.h:43
@ clC_SE_Disconnected
Definition CDevice.h:41
void(* clCDeviceHandlerConnectionState)(clCDevice, clCDeviceConnectionState)
Definition CDevice.h:122
CL_DLL clCDeviceDelegatePPGData clCDevice_GetOnPPGDataEvent(clCDevice device) NOEXCEPT
CL_DLL void clCDevice_Release(clCDevice device) NOEXCEPT
CL_DLL void clCDeviceDelegateResistances_Set(clCDeviceDelegateResistances delegate, clCDeviceHandlerResistances callback) NOEXCEPT
CL_DLL bool clCDevice_IsConnected(clCDevice device) NOEXCEPT
void(* clCDeviceHandlerDeviceConnectionState)(clCDevice, clCDeviceConnectionState)
Definition CDevice.h:114
void(* clCDeviceHandlerPPGData)(clCDevice, clCPPGTimedData)
Definition CDevice.h:83
CL_DLL void clCDeviceDelegatePPGData_Set(clCDeviceDelegatePPGData delegate, clCDeviceHandlerPPGData callback) NOEXCEPT
void(* clCDeviceHandlerUChar)(clCDevice, clCUChar)
Definition CDevice.h:100
CL_DLL void clCDeviceDelegateMEMSData_Set(clCDeviceDelegateMEMSData delegate, clCDeviceHandlerMEMSData callback) NOEXCEPT
CL_DLL clCDeviceDelegateDeviceConnectionState clCDevice_GetOnConnectionStateChangedEvent(clCDevice device) NOEXCEPT
CL_DLL clCDevice clCDeviceLocator_CreateDevice(clCDeviceLocator locator, const char *deviceID) NOEXCEPT
unsigned char clCUChar
Definition CDevice.h:98
CL_DLL clCDeviceChannelNames clCDevice_GetChannelNames(clCDevice device) NOEXCEPT
void(* clCDeviceHandlerEEGData)(clCDevice, clCEEGTimedData)
Definition CDevice.h:91
CL_DLL void clCDevice_Connect(clCDevice device) NOEXCEPT
CL_DLL clCDeviceInfo clCDevice_GetInfo(clCDevice device) NOEXCEPT
CL_DLL clCDeviceDelegateResistances clCDevice_GetOnResistancesEvent(clCDevice device) NOEXCEPT
CL_DLL clCDeviceDelegateMode clCDevice_GetOnModeSwitchedEvent(clCDevice device) NOEXCEPT
CL_DLL clCString clCDevice_GetFirmwareVersion(clCDevice device, clCError *error) NOEXCEPT
Get device's firmware version.
CL_DLL clCString clCDevice_GetChannelNameByIndex(clCDeviceChannelNames deviceChannels, int32_t channelIndex) NOEXCEPT
CL_DLL clCDeviceDelegateUChar clCDevice_GetOnBatteryChargeEvent(clCDevice device) NOEXCEPT
clCDeviceMode
Definition CDevice.h:25
@ clC_DM_Resistance
Definition CDevice.h:26
@ clC_DM_Idle
Definition CDevice.h:27
@ clC_DM_Signal
Definition CDevice.h:29
@ clC_DM_StartMEMS
Definition CDevice.h:30
@ clC_DM_StartPPG
Definition CDevice.h:32
@ clC_DM_SignalAndResist
Definition CDevice.h:34
@ clC_DM_StopPPG
Definition CDevice.h:33
@ clC_DM_PowerDown
Definition CDevice.h:28
@ clC_DM_StopMEMS
Definition CDevice.h:31
CL_DLL void clCDevice_Disconnect(clCDevice device) NOEXCEPT
CL_DLL bool clCDevice_FirmwareVersionReceived(clCDevice device) NOEXCEPT
Check if capsule has read firmware version.
void(* clCDeviceHandlerResistances)(clCDevice, clCResistances)
Definition CDevice.h:67
CL_DLL void clCDeviceDelegateMode_Set(clCDeviceDelegateMode delegate, clCDeviceHandlerMode callback) NOEXCEPT
CL_DLL clCDeviceDelegateMEMSData clCDevice_GetOnMEMSDataEvent(clCDevice device) NOEXCEPT
CL_DLL void clCDevice_SwitchMode(clCDevice device, clCDeviceMode mode) NOEXCEPT
Switch device from signal to resistance mode or switch the device off.
CL_DLL int32_t clCDevice_GetChannelIndexByName(clCDeviceChannelNames deviceChannels, const char *channelName) NOEXCEPT
CL_DLL clCDeviceMode clCDevice_GetMode(clCDevice device) NOEXCEPT
CL_DLL clCDeviceDelegateEEGData clCDevice_GetOnEEGDataEvent(clCDevice device) NOEXCEPT
void(* clCDeviceHandlerMEMSData)(clCDevice, clCMEMSTimedData)
Definition CDevice.h:75
CL_DLL void clCDeviceDelegate_Set(clCDeviceDelegate delegate, clCDeviceHandler callback) NOEXCEPT
void(* clCDeviceHandler)(clCDevice)
Definition CDevice.h:59
CL_DLL int32_t clCDevice_GetChannelsCount(clCDeviceChannelNames deviceChannels) NOEXCEPT
CL_DLL void clCDeviceDelegateBatteryCharge_Set(clCDeviceDelegateUChar delegate, clCDeviceHandlerUChar callback) NOEXCEPT
CL_DLL void clCDeviceDelegateEEGData_Set(clCDeviceDelegateEEGData delegate, clCDeviceHandlerEEGData callback) NOEXCEPT
clCError
Capsule error.
Definition CError.h:8