Example

Loading...
Searching...
No Matches
Typedefs | Enumerations | Functions
CDevice.h File Reference
`#include "Capsule/CDefinesPrivate.h"`
`#include "Capsule/CDeviceLocator.h"`
`#include "Capsule/CEEGTimedData.h"`
`#include "Capsule/CMEMSTimedData.h"`
`#include "Capsule/CPPGTimedData.h"`
`#include "Capsule/CResistances.h"`
`#include <stdbool.h>`
Include dependency graph for CDevice.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

## Typedefs
typedef enum clCDeviceMode | clCDeviceMode
typedef enum clCDeviceConnectionState | clCDeviceConnectionState
| Device connection state.
typedef void(* | clCDeviceHandler) (clCDevice)
typedef void(* | clCDeviceHandlerResistances) (clCDevice, clCResistances)
typedef void(* | clCDeviceHandlerMEMSData) (clCDevice, clCMEMSTimedData)
typedef void(* | clCDeviceHandlerPPGData) (clCDevice, clCPPGTimedData)
typedef void(* | clCDeviceHandlerEEGData) (clCDevice, clCEEGTimedData)
typedef unsigned char | clCUChar
typedef void(* | clCDeviceHandlerUChar) (clCDevice, clCUChar)
typedef void(* | clCDeviceHandlerMode) (clCDevice, clCDeviceMode)
typedef void(* | clCDeviceHandlerDeviceConnectionState) (clCDevice, clCDeviceConnectionState)
typedef void(* | clCDeviceHandlerConnectionState) (clCDevice, clCDeviceConnectionState)

## Enumerations
enum | clCDeviceMode { clC_DM_Resistance , clC_DM_Idle , clC_DM_PowerDown , clC_DM_Signal , clC_DM_StartMEMS , clC_DM_StopMEMS , clC_DM_StartPPG , clC_DM_StopPPG , clC_DM_SignalAndResist }
enum | clCDeviceConnectionState { clC_SE_Disconnected = 0 , clC_SE_Connected = 1 , clC_SE_UnsupportedConnection = 2 }
| Device connection state. More...

## Functions
| CLC_CLASS_WN (DevicePrivate, clCDevice)
| Neiry Device.
CL_DLL clCDevice | clCDeviceLocator_CreateDevice (clCDeviceLocator locator, const char *deviceID) NOEXCEPT
| CLC_STRUCT (clCDeviceDelegate)
CL_DLL void | clCDeviceDelegate_Set (clCDeviceDelegate delegate, clCDeviceHandler callback) NOEXCEPT
| CLC_STRUCT (clCDeviceDelegateResistances)
CL_DLL void | clCDeviceDelegateResistances_Set (clCDeviceDelegateResistances delegate, clCDeviceHandlerResistances callback) NOEXCEPT
| CLC_STRUCT (clCDeviceDelegateMEMSData)
CL_DLL void | clCDeviceDelegateMEMSData_Set (clCDeviceDelegateMEMSData delegate, clCDeviceHandlerMEMSData callback) NOEXCEPT
| CLC_STRUCT (clCDeviceDelegatePPGData)
CL_DLL void | clCDeviceDelegatePPGData_Set (clCDeviceDelegatePPGData delegate, clCDeviceHandlerPPGData callback) NOEXCEPT
| CLC_STRUCT (clCDeviceDelegateEEGData)
CL_DLL void | clCDeviceDelegateEEGData_Set (clCDeviceDelegateEEGData delegate, clCDeviceHandlerEEGData callback) NOEXCEPT
| CLC_STRUCT (clCDeviceDelegateUChar)
CL_DLL void | clCDeviceDelegateBatteryCharge_Set (clCDeviceDelegateUChar delegate, clCDeviceHandlerUChar callback) NOEXCEPT
| CLC_STRUCT (clCDeviceDelegateMode)
CL_DLL void | clCDeviceDelegateMode_Set (clCDeviceDelegateMode delegate, clCDeviceHandlerMode callback) NOEXCEPT
| CLC_STRUCT (clCDeviceDelegateDeviceConnectionState)
CL_DLL clCDeviceDelegateDeviceConnectionState | clCDevice_GetOnConnectionStateChangedEvent (clCDevice device) NOEXCEPT
| CLC_STRUCT (clCDeviceDelegateConnectionState)
CL_DLL void | clCDeviceDelegateConnectionState_Set (clCDeviceDelegateDeviceConnectionState delegate, clCDeviceHandlerConnectionState callback) NOEXCEPT
CL_DLL void | clCDevice_Connect (clCDevice device) NOEXCEPT
CL_DLL void | clCDevice_Disconnect (clCDevice device) NOEXCEPT
CL_DLL clCUChar | clCDevice_GetBatteryCharge (clCDevice device) NOEXCEPT
| Get device battery charge.
CL_DLL bool | clCDevice_FirmwareVersionReceived (clCDevice device) NOEXCEPT
| Check if capsule has read firmware version.
CL_DLL clCString | clCDevice_GetFirmwareVersion (clCDevice device, clCError *error) NOEXCEPT
| Get device's firmware version.
CL_DLL void | clCDevice_SwitchMode (clCDevice device, clCDeviceMode mode) NOEXCEPT
| Switch device from signal to resistance mode or switch the device off.
CL_DLL clCDeviceMode | clCDevice_GetMode (clCDevice device) NOEXCEPT
CL_DLL bool | clCDevice_IsConnected (clCDevice device) NOEXCEPT
CL_DLL clCDeviceInfo | clCDevice_GetInfo (clCDevice device) NOEXCEPT
| CLC_STRUCT_WN (DeviceChannelNames, clCDeviceChannelNames)
CL_DLL clCDeviceChannelNames | clCDevice_GetChannelNames (clCDevice device) NOEXCEPT
CL_DLL int32_t | clCDevice_GetChannelsCount (clCDeviceChannelNames deviceChannels) NOEXCEPT
CL_DLL int32_t | clCDevice_GetChannelIndexByName (clCDeviceChannelNames deviceChannels, const char *channelName) NOEXCEPT
CL_DLL clCString | clCDevice_GetChannelNameByIndex (clCDeviceChannelNames deviceChannels, int32_t channelIndex) NOEXCEPT
CL_DLL clCDeviceDelegateResistances | clCDevice_GetOnResistancesEvent (clCDevice device) NOEXCEPT
CL_DLL clCDeviceDelegateMEMSData | clCDevice_GetOnMEMSDataEvent (clCDevice device) NOEXCEPT
CL_DLL clCDeviceDelegatePPGData | clCDevice_GetOnPPGDataEvent (clCDevice device) NOEXCEPT
CL_DLL clCDeviceDelegateEEGData | clCDevice_GetOnEEGDataEvent (clCDevice device) NOEXCEPT
CL_DLL clCDeviceDelegateUChar | clCDevice_GetOnBatteryChargeEvent (clCDevice device) NOEXCEPT
CL_DLL clCDeviceDelegateMode | clCDevice_GetOnModeSwitchedEvent (clCDevice device) NOEXCEPT
CL_DLL void | clCDevice_Release (clCDevice device) NOEXCEPT

## Typedef Documentation

## ◆ clCDeviceConnectionState

typedef enum clCDeviceConnectionState clCDeviceConnectionState

Device connection state.

## ◆ clCDeviceHandler

typedef void(* clCDeviceHandler) (clCDevice)

## ◆ clCDeviceHandlerConnectionState

typedef void(* clCDeviceHandlerConnectionState) (clCDevice, clCDeviceConnectionState)

## ◆ clCDeviceHandlerDeviceConnectionState

typedef void(* clCDeviceHandlerDeviceConnectionState) (clCDevice, clCDeviceConnectionState)

## ◆ clCDeviceHandlerEEGData

typedef void(* clCDeviceHandlerEEGData) (clCDevice, clCEEGTimedData)

## ◆ clCDeviceHandlerMEMSData

typedef void(* clCDeviceHandlerMEMSData) (clCDevice, clCMEMSTimedData)

## ◆ clCDeviceHandlerMode

typedef void(* clCDeviceHandlerMode) (clCDevice, clCDeviceMode)

## ◆ clCDeviceHandlerPPGData

typedef void(* clCDeviceHandlerPPGData) (clCDevice, clCPPGTimedData)

## ◆ clCDeviceHandlerResistances

typedef void(* clCDeviceHandlerResistances) (clCDevice, clCResistances)

## ◆ clCDeviceHandlerUChar

typedef void(* clCDeviceHandlerUChar) (clCDevice, clCUChar)

## ◆ clCDeviceMode

typedef enum clCDeviceMode clCDeviceMode

## ◆ clCUChar

typedef unsigned char clCUChar

Device delegate for battery charge.

## Enumeration Type Documentation

## ◆ clCDeviceConnectionState

enum clCDeviceConnectionState

Device connection state.

Enumerator
clC_SE_Disconnected |
clC_SE_Connected |
clC_SE_UnsupportedConnection |

## ◆ clCDeviceMode

enum clCDeviceMode

Enumerator
clC_DM_Resistance |
clC_DM_Idle |
clC_DM_PowerDown |
clC_DM_Signal |
clC_DM_StartMEMS |
clC_DM_StopMEMS |
clC_DM_StartPPG |
clC_DM_StopPPG |
clC_DM_SignalAndResist |

## Function Documentation

## ◆ CLC_CLASS_WN()

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

Neiry Device.

Controls connection to the device

## ◆ CLC_STRUCT() [1/9]

CLC_STRUCT | ( | clCDeviceDelegate |  | ) |

Device delegate without parameters. Not supported in the current version

## ◆ CLC_STRUCT() [2/9]

CLC_STRUCT | ( | clCDeviceDelegateConnectionState |  | ) |

Device connection delegate.

## ◆ CLC_STRUCT() [3/9]

CLC_STRUCT | ( | clCDeviceDelegateDeviceConnectionState |  | ) |

Get delegate for device connection state event.

Parameters

  device | device handle

## ◆ CLC_STRUCT() [4/9]

CLC_STRUCT | ( | clCDeviceDelegateEEGData |  | ) |

Device delegate for EEG data event.

## ◆ CLC_STRUCT() [5/9]

CLC_STRUCT | ( | clCDeviceDelegateMEMSData |  | ) |

Device delegate for MEMS data event.

## ◆ CLC_STRUCT() [6/9]

CLC_STRUCT | ( | clCDeviceDelegateMode |  | ) |

## ◆ CLC_STRUCT() [7/9]

CLC_STRUCT | ( | clCDeviceDelegatePPGData |  | ) |

Device delegate for PPG data event.

## ◆ CLC_STRUCT() [8/9]

CLC_STRUCT | ( | clCDeviceDelegateResistances |  | ) |

Device delegate for resistances event.

## ◆ CLC_STRUCT() [9/9]

CLC_STRUCT | ( | clCDeviceDelegateUChar |  | ) |

## ◆ CLC_STRUCT_WN()

CLC_STRUCT_WN | ( | DeviceChannelNames | ,
|  | clCDeviceChannelNames |
| ) |  |

Get names of channels of the device

Parameters

  device | device handle

## ◆ clCDevice_Connect()

CL_DLL void clCDevice_Connect | ( | clCDevice | device | ) |

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

Parameters

  device | device handle

## ◆ clCDevice_Disconnect()

CL_DLL void clCDevice_Disconnect | ( | clCDevice | device | ) |

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

Parameters

  device | device handle

## ◆ clCDevice_FirmwareVersionReceived()

CL_DLL bool clCDevice_FirmwareVersionReceived | ( | clCDevice | device | ) |

Check if capsule has read firmware version.

Parameters

  device | Device handle

Returns
  true if capsule has read firmware version, false otherwise

## ◆ clCDevice_GetBatteryCharge()

CL_DLL clCUChar clCDevice_GetBatteryCharge | ( | clCDevice | device | ) |

Get device battery charge.

Parameters

  device |

Returns
  battery charge

## ◆ clCDevice_GetChannelIndexByName()

CL_DLL int32_t clCDevice_GetChannelIndexByName | ( | clCDeviceChannelNames | deviceChannels,
|  | const char * | channelName
| ) |  |

## ◆ clCDevice_GetChannelNameByIndex()

CL_DLL clCString clCDevice_GetChannelNameByIndex | ( | clCDeviceChannelNames | deviceChannels,
|  | int32_t | channelIndex
| ) |  |

## ◆ clCDevice_GetChannelNames()

CL_DLL clCDeviceChannelNames clCDevice_GetChannelNames | ( | clCDevice | device | ) |

## ◆ clCDevice_GetChannelsCount()

CL_DLL int32_t clCDevice_GetChannelsCount | ( | clCDeviceChannelNames | deviceChannels | ) |

## ◆ clCDevice_GetFirmwareVersion()

CL_DLL clCString clCDevice_GetFirmwareVersion | ( | clCDevice | device,
|  | clCError * | error
| ) |  |

Get device's firmware version.

Parameters

  device | Device handle
  error | Pointer to int value, which sets error code (0 is a success)

Returns
  Firmware version string

## ◆ clCDevice_GetInfo()

CL_DLL clCDeviceInfo clCDevice_GetInfo | ( | clCDevice | device | ) |

Get device information.

Parameters

  device | device handle

Returns
  device info handle

## ◆ clCDevice_GetMode()

CL_DLL clCDeviceMode clCDevice_GetMode | ( | clCDevice | device | ) |

## ◆ clCDevice_GetOnBatteryChargeEvent()

CL_DLL clCDeviceDelegateUChar clCDevice_GetOnBatteryChargeEvent | ( | clCDevice | device | ) |

Get delegate for device battery charge event.

Parameters

  device | device handle

## ◆ clCDevice_GetOnConnectionStateChangedEvent()

CL_DLL clCDeviceDelegateDeviceConnectionState clCDevice_GetOnConnectionStateChangedEvent | ( | clCDevice | device | ) |

## ◆ clCDevice_GetOnEEGDataEvent()

CL_DLL clCDeviceDelegateEEGData clCDevice_GetOnEEGDataEvent | ( | clCDevice | device | ) |

Get delegate for device EEG data event.

Parameters

  device | device handle

## ◆ clCDevice_GetOnMEMSDataEvent()

CL_DLL clCDeviceDelegateMEMSData clCDevice_GetOnMEMSDataEvent | ( | clCDevice | device | ) |

Get delegate for device MEMS data event.

Parameters

  device | device handle

## ◆ clCDevice_GetOnModeSwitchedEvent()

CL_DLL clCDeviceDelegateMode clCDevice_GetOnModeSwitchedEvent | ( | clCDevice | device | ) |

## ◆ clCDevice_GetOnPPGDataEvent()

CL_DLL clCDeviceDelegatePPGData clCDevice_GetOnPPGDataEvent | ( | clCDevice | device | ) |

Get delegate for device PPG data event.

Parameters

  device | device handle

## ◆ clCDevice_GetOnResistancesEvent()

CL_DLL clCDeviceDelegateResistances clCDevice_GetOnResistancesEvent | ( | clCDevice | device | ) |

Get delegate for device resistances event.

Parameters

  device | device handle

## ◆ clCDevice_IsConnected()

CL_DLL bool clCDevice_IsConnected | ( | clCDevice | device | ) |

Is Neiry device connected to Capsule.

Parameters

  device | device handle

## ◆ clCDevice_Release()

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

Release the device.

Parameters

  device | device handle

## ◆ clCDevice_SwitchMode()

CL_DLL void clCDevice_SwitchMode | ( | clCDevice | device,
|  | clCDeviceMode | mode
| ) |  |

Switch device from signal to resistance mode or switch the device off.

Parameters

  device |
  mode |

## ◆ clCDeviceDelegate_Set()

CL_DLL void clCDeviceDelegate_Set | ( | clCDeviceDelegate | delegate,
|  | clCDeviceHandler | callback
| ) |  |

## ◆ clCDeviceDelegateBatteryCharge_Set()

CL_DLL void clCDeviceDelegateBatteryCharge_Set | ( | clCDeviceDelegateUChar | delegate,
|  | clCDeviceHandlerUChar | callback
| ) |  |

## ◆ clCDeviceDelegateConnectionState_Set()

CL_DLL void clCDeviceDelegateConnectionState_Set | ( | clCDeviceDelegateDeviceConnectionState | delegate,
|  | clCDeviceHandlerConnectionState | callback
| ) |  |

## ◆ clCDeviceDelegateEEGData_Set()

CL_DLL void clCDeviceDelegateEEGData_Set | ( | clCDeviceDelegateEEGData | delegate,
|  | clCDeviceHandlerEEGData | callback
| ) |  |

## ◆ clCDeviceDelegateMEMSData_Set()

CL_DLL void clCDeviceDelegateMEMSData_Set | ( | clCDeviceDelegateMEMSData | delegate,
|  | clCDeviceHandlerMEMSData | callback
| ) |  |

## ◆ clCDeviceDelegateMode_Set()

CL_DLL void clCDeviceDelegateMode_Set | ( | clCDeviceDelegateMode | delegate,
|  | clCDeviceHandlerMode | callback
| ) |  |

## ◆ clCDeviceDelegatePPGData_Set()

CL_DLL void clCDeviceDelegatePPGData_Set | ( | clCDeviceDelegatePPGData | delegate,
|  | clCDeviceHandlerPPGData | callback
| ) |  |

## ◆ clCDeviceDelegateResistances_Set()

CL_DLL void clCDeviceDelegateResistances_Set | ( | clCDeviceDelegateResistances | delegate,
|  | clCDeviceHandlerResistances | callback
| ) |  |

## ◆ clCDeviceLocator_CreateDevice()

CL_DLL clCDevice clCDeviceLocator_CreateDevice | ( | clCDeviceLocator | locator,
|  | const char * | deviceID
| ) |  |

Create device for interaction.

Parameters

  locator | device locator handle
  deviceID | device ID string

Returns
  device handle