Example
|
#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>
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 enum clCDeviceConnectionState clCDeviceConnectionState |
Device connection state.
typedef void(* clCDeviceHandler) (clCDevice) |
typedef void(* clCDeviceHandlerConnectionState) (clCDevice, clCDeviceConnectionState) |
typedef void(* clCDeviceHandlerDeviceConnectionState) (clCDevice, clCDeviceConnectionState) |
typedef void(* clCDeviceHandlerEEGData) (clCDevice, clCEEGTimedData) |
typedef void(* clCDeviceHandlerMEMSData) (clCDevice, clCMEMSTimedData) |
typedef void(* clCDeviceHandlerMode) (clCDevice, clCDeviceMode) |
typedef void(* clCDeviceHandlerPPGData) (clCDevice, clCPPGTimedData) |
typedef void(* clCDeviceHandlerResistances) (clCDevice, clCResistances) |
typedef void(* clCDeviceHandlerUChar) (clCDevice, clCUChar) |
typedef enum clCDeviceMode clCDeviceMode |
typedef unsigned char clCUChar |
Device delegate for battery charge.
enum clCDeviceMode |
CLC_CLASS_WN | ( | DevicePrivate | , |
clCDevice | |||
) |
Neiry Device.
Controls connection to the device
CLC_STRUCT | ( | clCDeviceDelegate | ) |
Device delegate without parameters. Not supported in the current version
CLC_STRUCT | ( | clCDeviceDelegateConnectionState | ) |
Device connection delegate.
CLC_STRUCT | ( | clCDeviceDelegateDeviceConnectionState | ) |
Get delegate for device connection state event.
device | device handle |
CLC_STRUCT | ( | clCDeviceDelegateEEGData | ) |
Device delegate for EEG data event.
CLC_STRUCT | ( | clCDeviceDelegateMEMSData | ) |
Device delegate for MEMS data event.
CLC_STRUCT | ( | clCDeviceDelegateMode | ) |
CLC_STRUCT | ( | clCDeviceDelegatePPGData | ) |
Device delegate for PPG data event.
CLC_STRUCT | ( | clCDeviceDelegateResistances | ) |
Device delegate for resistances event.
CLC_STRUCT | ( | clCDeviceDelegateUChar | ) |
CLC_STRUCT_WN | ( | DeviceChannelNames | , |
clCDeviceChannelNames | |||
) |
Get names of channels of the device
device | device handle |
CL_DLL void clCDevice_Connect | ( | clCDevice | device | ) |
Connect to Neiry device. Non-blocking - OnConnectionStateChanged event is fired when connected.
device | device handle |
CL_DLL void clCDevice_Disconnect | ( | clCDevice | device | ) |
Disconnect from Neiry device. Non-blocking - OnConnectionStateChanged event is fired when disconnected.
device | device handle |
CL_DLL bool clCDevice_FirmwareVersionReceived | ( | clCDevice | device | ) |
Check if capsule has read firmware version.
device | Device handle |
Get device battery charge.
device |
CL_DLL int32_t clCDevice_GetChannelIndexByName | ( | clCDeviceChannelNames | deviceChannels, |
const char * | channelName | ||
) |
CL_DLL clCString clCDevice_GetChannelNameByIndex | ( | clCDeviceChannelNames | deviceChannels, |
int32_t | channelIndex | ||
) |
CL_DLL clCDeviceChannelNames clCDevice_GetChannelNames | ( | clCDevice | device | ) |
CL_DLL int32_t clCDevice_GetChannelsCount | ( | clCDeviceChannelNames | deviceChannels | ) |
Get device's firmware version.
device | Device handle |
error | Pointer to int value, which sets error code (0 is a success) |
CL_DLL clCDeviceInfo clCDevice_GetInfo | ( | clCDevice | device | ) |
Get device information.
device | device handle |
CL_DLL clCDeviceMode clCDevice_GetMode | ( | clCDevice | device | ) |
CL_DLL clCDeviceDelegateUChar clCDevice_GetOnBatteryChargeEvent | ( | clCDevice | device | ) |
Get delegate for device battery charge event.
device | device handle |
CL_DLL clCDeviceDelegateDeviceConnectionState clCDevice_GetOnConnectionStateChangedEvent | ( | clCDevice | device | ) |
CL_DLL clCDeviceDelegateEEGData clCDevice_GetOnEEGDataEvent | ( | clCDevice | device | ) |
Get delegate for device EEG data event.
device | device handle |
CL_DLL clCDeviceDelegateMEMSData clCDevice_GetOnMEMSDataEvent | ( | clCDevice | device | ) |
Get delegate for device MEMS data event.
device | device handle |
CL_DLL clCDeviceDelegateMode clCDevice_GetOnModeSwitchedEvent | ( | clCDevice | device | ) |
CL_DLL clCDeviceDelegatePPGData clCDevice_GetOnPPGDataEvent | ( | clCDevice | device | ) |
Get delegate for device PPG data event.
device | device handle |
CL_DLL clCDeviceDelegateResistances clCDevice_GetOnResistancesEvent | ( | clCDevice | device | ) |
Get delegate for device resistances event.
device | device handle |
CL_DLL bool clCDevice_IsConnected | ( | clCDevice | device | ) |
Is Neiry device connected to Capsule.
device | device handle |
CL_DLL void clCDevice_Release | ( | clCDevice | device | ) |
Release the device.
device | device handle |
CL_DLL void clCDevice_SwitchMode | ( | clCDevice | device, |
clCDeviceMode | mode | ||
) |
Switch device from signal to resistance mode or switch the device off.
device | |
mode |
CL_DLL void clCDeviceDelegate_Set | ( | clCDeviceDelegate | delegate, |
clCDeviceHandler | callback | ||
) |
CL_DLL void clCDeviceDelegateBatteryCharge_Set | ( | clCDeviceDelegateUChar | delegate, |
clCDeviceHandlerUChar | callback | ||
) |
CL_DLL void clCDeviceDelegateConnectionState_Set | ( | clCDeviceDelegateDeviceConnectionState | delegate, |
clCDeviceHandlerConnectionState | callback | ||
) |
CL_DLL void clCDeviceDelegateEEGData_Set | ( | clCDeviceDelegateEEGData | delegate, |
clCDeviceHandlerEEGData | callback | ||
) |
CL_DLL void clCDeviceDelegateMEMSData_Set | ( | clCDeviceDelegateMEMSData | delegate, |
clCDeviceHandlerMEMSData | callback | ||
) |
CL_DLL void clCDeviceDelegateMode_Set | ( | clCDeviceDelegateMode | delegate, |
clCDeviceHandlerMode | callback | ||
) |
CL_DLL void clCDeviceDelegatePPGData_Set | ( | clCDeviceDelegatePPGData | delegate, |
clCDeviceHandlerPPGData | callback | ||
) |
CL_DLL void clCDeviceDelegateResistances_Set | ( | clCDeviceDelegateResistances | delegate, |
clCDeviceHandlerResistances | callback | ||
) |
CL_DLL clCDevice clCDeviceLocator_CreateDevice | ( | clCDeviceLocator | locator, |
const char * | deviceID | ||
) |
Create device for interaction.
locator | device locator handle |
deviceID | device ID string |