Capsule API Example

Loading...
Searching...
No Matches
Typedefs | Enumerations | Functions
CDevice.h File Reference
`#include "CDefinesPrivate.h"`
`#include "CDeviceLocator.h"`
`#include "CEEGArtifacts.h"`
`#include "CEEGTimedData.h"`
`#include "CError.h"`
`#include "CPSDData.h"`
`#include "CResistances.h"`
`#include <stdbool.h>`

Go to the source code of this file.

## Typedefs
typedef enum clCDevice_Mode | clCDevice_Mode
typedef enum clCDevice_ConnectionStatus | clCDevice_ConnectionStatus
| Device connection status.
typedef void(* | clCDevice_ConnectionStatusChangedHandler) (clCDevice, clCDevice_ConnectionStatus) NOEXCEPT
typedef void(* | clCDevice_OnResistanceUpdateHandler) (clCDevice, clCResistance) NOEXCEPT
typedef void(* | clCDevice_OnBatteryChargeUpdateHandler) (clCDevice, uint8_t) NOEXCEPT
typedef void(* | clCDevice_ModeSwitchedHandler) (clCDevice, clCDevice_Mode) NOEXCEPT
typedef void(* | clCDevice_EEGDataHandler) (clCDevice, clCEEGTimedData) NOEXCEPT
typedef void(* | clCDevice_PSDDataHandler) (clCDevice, clCPSDData) NOEXCEPT
typedef void(* | clCDevice_EEGArtifactsHandler) (clCDevice, clCEEGArtifacts) NOEXCEPT
typedef void(* | clCDevice_ErrorHandler) (clCDevice, const char *) NOEXCEPT

## Enumerations
enum | clCDevice_Mode { clCDevice_Mode_Resistance = 0 , clCDevice_Mode_Signal , clCDevice_Mode_SignalAndResist , clCDevice_Mode_StartMEMS , clCDevice_Mode_StopMEMS , clCDevice_Mode_StartPPG , clCDevice_Mode_StopPPG }
enum | clCDevice_ConnectionStatus { clCDevice_ConnectionState_Disconnected = 0 , clCDevice_ConnectionState_Connected = 1 , clCDevice_ConnectionState_UnsupportedConnection = 2 }
| Device connection status. More...

## Functions
| CLC_CLASS_WN (DevicePrivate, clCDevice)
| Device.
| CLC_STRUCT_WNN (DeviceChannelNames, clCDevice_ChannelNames, device)
CL_DLL clCDevice | clCDeviceLocator_CreateDevice (clCDeviceLocator locator, const char *deviceSerial, clCError *error) NOEXCEPT
CL_DLL void | clCDevice_SetOnConnectionStatusChangedEvent (clCDevice device, clCDevice_ConnectionStatusChangedHandler handler) NOEXCEPT
CL_DLL void | clCDevice_SetOnResistanceUpdateEvent (clCDevice device, clCDevice_OnResistanceUpdateHandler handler) NOEXCEPT
CL_DLL void | clCDevice_SetOnBatteryChargeUpdateEvent (clCDevice device, clCDevice_OnBatteryChargeUpdateHandler) NOEXCEPT
CL_DLL void | clCDevice_SetOnModeSwitchedEvent (clCDevice device, clCDevice_ModeSwitchedHandler handler) NOEXCEPT
CL_DLL void | clCDevice_SetOnEEGDataEvent (clCDevice device, clCDevice_EEGDataHandler handler) NOEXCEPT
CL_DLL void | clCDevice_SetOnPSDDataEvent (clCDevice device, clCDevice_PSDDataHandler handler) NOEXCEPT
CL_DLL void | clCDevice_SetOnEEGArtifactsEvent (clCDevice device, clCDevice_EEGArtifactsHandler handler) NOEXCEPT
CL_DLL void | clCDevice_SetOnErrorEvent (clCDevice device, clCDevice_ErrorHandler handler) NOEXCEPT
CL_DLL void | clCDevice_Connect (clCDevice device, bool bipolarChannels, clCError *error) NOEXCEPT
CL_DLL void | clCDevice_Disconnect (clCDevice device, clCError *error) NOEXCEPT
CL_DLL uint8_t | clCDevice_GetBatteryCharge (clCDevice device, clCError *error) NOEXCEPT
| Get device battery charge.
CL_DLL void | clCDevice_Start (clCDevice device, clCError *error) NOEXCEPT
| Start device.
CL_DLL void | clCDevice_Stop (clCDevice device, clCError *error) NOEXCEPT
| Stop device.
CL_DLL clCDevice_Mode | clCDevice_GetMode (clCDevice device) NOEXCEPT
CL_DLL bool | clCDevice_IsConnected (clCDevice device, clCError *error) NOEXCEPT
CL_DLL clCDeviceInfo | clCDevice_GetInfo (clCDevice device, clCError *error) NOEXCEPT
CL_DLL float | clCDevice_GetEEGSampleRate (clCDevice device, clCError *error) NOEXCEPT
CL_DLL float | clCDevice_GetPPGSampleRate (clCDevice device, clCError *error) NOEXCEPT
CL_DLL float | clCDevice_GetMEMSSampleRate (clCDevice device, clCError *error) NOEXCEPT
CL_DLL int32_t | clCDevice_GetPPGIrAmplitude (clCDevice device, clCError *error) NOEXCEPT
CL_DLL int32_t | clCDevice_GetPPGRedAmplitude (clCDevice device, clCError *error) NOEXCEPT
CL_DLL clCDevice_ChannelNames | clCDevice_GetChannelNames (clCDevice device, clCError *error) NOEXCEPT
CL_DLL int32_t | clCDevice_ChannelNames_GetChannelsCount (clCDevice_ChannelNames deviceChannels, clCError *error) NOEXCEPT
CL_DLL int32_t | clCDevice_ChannelNames_GetChannelIndexByName (clCDevice_ChannelNames deviceChannels, const char *channelName, clCError *error) NOEXCEPT
CL_DLL const char * | clCDevice_ChannelNames_GetChannelNameByIndex (clCDevice_ChannelNames deviceChannels, int32_t channelIndex, clCError *error) NOEXCEPT
CL_DLL void | clCDevice_Release (clCDevice device) NOEXCEPT

## Typedef Documentation

## ◆ clCDevice_ConnectionStatus

typedef enum clCDevice_ConnectionStatus clCDevice_ConnectionStatus

Device connection status.

## ◆ clCDevice_ConnectionStatusChangedHandler

typedef void(* clCDevice_ConnectionStatusChangedHandler) (clCDevice, clCDevice_ConnectionStatus) NOEXCEPT

## ◆ clCDevice_EEGArtifactsHandler

typedef void(* clCDevice_EEGArtifactsHandler) (clCDevice, clCEEGArtifacts) NOEXCEPT

## ◆ clCDevice_EEGDataHandler

typedef void(* clCDevice_EEGDataHandler) (clCDevice, clCEEGTimedData) NOEXCEPT

## ◆ clCDevice_ErrorHandler

typedef void(* clCDevice_ErrorHandler) (clCDevice, const char *) NOEXCEPT

## ◆ clCDevice_Mode

typedef enum clCDevice_Mode clCDevice_Mode

## ◆ clCDevice_ModeSwitchedHandler

typedef void(* clCDevice_ModeSwitchedHandler) (clCDevice, clCDevice_Mode) NOEXCEPT

## ◆ clCDevice_OnBatteryChargeUpdateHandler

typedef void(* clCDevice_OnBatteryChargeUpdateHandler) (clCDevice, uint8_t) NOEXCEPT

## ◆ clCDevice_OnResistanceUpdateHandler

typedef void(* clCDevice_OnResistanceUpdateHandler) (clCDevice, clCResistance) NOEXCEPT

## ◆ clCDevice_PSDDataHandler

typedef void(* clCDevice_PSDDataHandler) (clCDevice, clCPSDData) NOEXCEPT

## Enumeration Type Documentation

## ◆ clCDevice_ConnectionStatus

enum clCDevice_ConnectionStatus

Device connection status.

Enumerator
clCDevice_ConnectionState_Disconnected |
clCDevice_ConnectionState_Connected |
clCDevice_ConnectionState_UnsupportedConnection |

## ◆ clCDevice_Mode

enum clCDevice_Mode

Enumerator
clCDevice_Mode_Resistance |
clCDevice_Mode_Signal |
clCDevice_Mode_SignalAndResist |
clCDevice_Mode_StartMEMS |
clCDevice_Mode_StopMEMS |
clCDevice_Mode_StartPPG |
clCDevice_Mode_StopPPG |

## Function Documentation

## ◆ CLC_CLASS_WN()

CLC_CLASS_WN | ( | DevicePrivate | ,
|  | clCDevice | )

Device.

Controls connection to the device

## ◆ CLC_STRUCT_WNN()

CLC_STRUCT_WNN | ( | DeviceChannelNames | ,
|  | clCDevice_ChannelNames | ,
|  | device | )

## ◆ clCDevice_ChannelNames_GetChannelIndexByName()

CL_DLL int32_t clCDevice_ChannelNames_GetChannelIndexByName | ( | clCDevice_ChannelNames | deviceChannels,
|  | const char * | channelName,
|  | clCError * | error )

## ◆ clCDevice_ChannelNames_GetChannelNameByIndex()

CL_DLL const char * clCDevice_ChannelNames_GetChannelNameByIndex | ( | clCDevice_ChannelNames | deviceChannels,
|  | int32_t | channelIndex,
|  | clCError * | error )

## ◆ clCDevice_ChannelNames_GetChannelsCount()

CL_DLL int32_t clCDevice_ChannelNames_GetChannelsCount | ( | clCDevice_ChannelNames | deviceChannels,
|  | clCError * | error )

## ◆ clCDevice_Connect()

CL_DLL void clCDevice_Connect | ( | clCDevice | device,
|  | bool | bipolarChannels,
|  | clCError * | error )

Connect to device. Non-blocking - OnConnectionStateChanged event is fired when connected.

Parameters

  device | device handle
  bipolarChannels | true if channels should be joined pairwise to provide bipolar signal (the signal is the difference between two signals in the channel pair)
  error | out parameter for error

## ◆ clCDevice_Disconnect()

CL_DLL void clCDevice_Disconnect | ( | clCDevice | device,
|  | clCError * | error )

Disconnect from device. Non-blocking - OnConnectionStateChanged event is fired when disconnected.

Parameters

  device | device handle
  error | out parameter for error

## ◆ clCDevice_GetBatteryCharge()

CL_DLL uint8_t clCDevice_GetBatteryCharge | ( | clCDevice | device,
|  | clCError * | error )

Get device battery charge.

Parameters

  device | device handle
  error | out parameter for error

Returns
  battery charge

## ◆ clCDevice_GetChannelNames()

CL_DLL clCDevice_ChannelNames clCDevice_GetChannelNames | ( | clCDevice | device,
|  | clCError * | error )

Get names of channels of the device

Parameters

  device | device handle
  error | out parameter for error

Returns
  device channel names handle

## ◆ clCDevice_GetEEGSampleRate()

CL_DLL float clCDevice_GetEEGSampleRate | ( | clCDevice | device,
|  | clCError * | error )

Get device's EEG sample rate in Hz

Parameters

  device | device handle
  error | out parameter for error

Returns
  device EEG sample rate

## ◆ clCDevice_GetInfo()

CL_DLL clCDeviceInfo clCDevice_GetInfo | ( | clCDevice | device,
|  | clCError * | error )

Get device information.

Parameters

  device | device handle
  error | out parameter for error

Returns
  device info handle

## ◆ clCDevice_GetMEMSSampleRate()

CL_DLL float clCDevice_GetMEMSSampleRate | ( | clCDevice | device,
|  | clCError * | error )

Get device's MEMS sample rate in Hz

Parameters

  device | device handle
  error | out parameter for error

Returns
  device MEMS sample rate

## ◆ clCDevice_GetMode()

CL_DLL clCDevice_Mode clCDevice_GetMode | ( | clCDevice | device | ) |

Get current device mode

Parameters

  device | device handle

Returns
  device mode

## ◆ clCDevice_GetPPGIrAmplitude()

CL_DLL int32_t clCDevice_GetPPGIrAmplitude | ( | clCDevice | device,
|  | clCError * | error )

Get device's infrared light amplitude

Parameters

  device | device handle
  error | out parameter for error

Returns
  device infrared light amplitude

## ◆ clCDevice_GetPPGRedAmplitude()

CL_DLL int32_t clCDevice_GetPPGRedAmplitude | ( | clCDevice | device,
|  | clCError * | error )

Get device's red light amplitude

Parameters

  device | device handle
  error | out parameter for error

Returns
  device red light amplitude

## ◆ clCDevice_GetPPGSampleRate()

CL_DLL float clCDevice_GetPPGSampleRate | ( | clCDevice | device,
|  | clCError * | error )

Get device's PPG sample rate in Hz

Parameters

  device | device handle
  error | out parameter for error

Returns
  device PPG sample rate

## ◆ clCDevice_IsConnected()

CL_DLL bool clCDevice_IsConnected | ( | clCDevice | device,
|  | clCError * | error )

Is device connected to Capsule.

Parameters

  device | device handle
  error | out parameter for error

## ◆ clCDevice_Release()

CL_DLL void clCDevice_Release | ( | clCDevice | device | ) |

Release the device.

Parameters

  device | device handle

## ◆ clCDevice_SetOnBatteryChargeUpdateEvent()

CL_DLL void clCDevice_SetOnBatteryChargeUpdateEvent | ( | clCDevice | device,
|  | clCDevice_OnBatteryChargeUpdateHandler | )

## ◆ clCDevice_SetOnConnectionStatusChangedEvent()

CL_DLL void clCDevice_SetOnConnectionStatusChangedEvent | ( | clCDevice | device,
|  | clCDevice_ConnectionStatusChangedHandler | handler )

## ◆ clCDevice_SetOnEEGArtifactsEvent()

CL_DLL void clCDevice_SetOnEEGArtifactsEvent | ( | clCDevice | device,
|  | clCDevice_EEGArtifactsHandler | handler )

## ◆ clCDevice_SetOnEEGDataEvent()

CL_DLL void clCDevice_SetOnEEGDataEvent | ( | clCDevice | device,
|  | clCDevice_EEGDataHandler | handler )

## ◆ clCDevice_SetOnErrorEvent()

CL_DLL void clCDevice_SetOnErrorEvent | ( | clCDevice | device,
|  | clCDevice_ErrorHandler | handler )

## ◆ clCDevice_SetOnModeSwitchedEvent()

CL_DLL void clCDevice_SetOnModeSwitchedEvent | ( | clCDevice | device,
|  | clCDevice_ModeSwitchedHandler | handler )

## ◆ clCDevice_SetOnPSDDataEvent()

CL_DLL void clCDevice_SetOnPSDDataEvent | ( | clCDevice | device,
|  | clCDevice_PSDDataHandler | handler )

## ◆ clCDevice_SetOnResistanceUpdateEvent()

CL_DLL void clCDevice_SetOnResistanceUpdateEvent | ( | clCDevice | device,
|  | clCDevice_OnResistanceUpdateHandler | handler )

## ◆ clCDevice_Start()

CL_DLL void clCDevice_Start | ( | clCDevice | device,
|  | clCError * | error )

Start device.

Parameters

  device | device handle
  error | out parameter for error

## ◆ clCDevice_Stop()

CL_DLL void clCDevice_Stop | ( | clCDevice | device,
|  | clCError * | error )

Stop device.

Parameters

  device | device handle
  error | out parameter for error

## ◆ clCDeviceLocator_CreateDevice()

CL_DLL clCDevice clCDeviceLocator_CreateDevice | ( | clCDeviceLocator | locator,
|  | const char * | deviceSerial,
|  | clCError * | error )

Create device for interaction.

Parameters

  locator | device locator handle
  deviceSerial | device ID string
  error |

Returns
  device handle