Device (Java)

From Neurotech Software Development Kit
Revision as of 07:34, 28 April 2018 by NateColeman (talk | contribs) (Methods Summary)
Jump to: navigation, search

ru.neuromd.neurosdk

Class Device

Related Classes

ru.neuromd.neurosdk.DeviceScanner

Classes hierarchy

  • java.lang.Object
    • ru.neuromd.neurosdk.Device

Class definition

public class Device

The Device class is an abstraction for NeuroMD BLE devices. This abstraction provides functions for changing of device state by executing commands and setting parameters. Each device have different sets of supported commands and parameters, Device class has functions designed to get information about these sets. Callibri and Braibit devices has different parameters sets and provides different ways to access them. Device class hides all differences behind its interface and provides universal way to read and write parameters, execute commands and receive biopotential signals.

Fields Summary

Modifier and Type Field and Description
SubscribersNotifier<ParameterName> parameterChanged

Subscribe this event to receive notifications about changes of device parameters

Constructor Summary

You are not able to create Device directly. Use DeviceScanner to find and create devices

Methods Summary

Modifier and Type Method and Description
void connect()

Establishes connection with device services

void disconnect()

Disconnects from device

ChannelInfo[] channels()

Returns information about supported channels. Check this information before creation of channel. If device does not support channel, channel object won't be initialized.

int getBatteryLevel()

Returns battery charge level in percents

NeuroDeviceError getError()

Returns device error state information

DeviceFeature[] getFeature()

Returns supported device features

java.lang.String getName()

Returns name of BLE device

NeuroDevice getNeuroDevice()

Returns this object

SignalSubsystem getSignalSubsystem()

Returns subsystem for SIGNAL device feature

NeuroDeviceState getState()

Returns common device state

StimulationSubsystem getStimulationSubsystem()

Returns subsystem for STIMUL device feature

Field Detail

parameterChanged

public final SubscribersNotifier<ParameterName> parameterChanged

Subscribe this event to receive notifications about changes of device parameters

Method Detail

finalize

public void finalize() throws java.lang.Throwable

Overrides:
finalize in class java.lang.Object
Throws:
java.lang.Throwable


close

public void close()


getState

public NeuroDeviceState getState()

Returns NeuroDevice state

Returns:
Device state

getError

public NeuroDeviceError getError()

Returns error type if device is in error state

Returns:
Error type for device error state

getName

public java.lang.String getName()

Description copied from class: VisualizableDevice

Returns name of BLE device

Specified by:
VisualizableDevice.getName() in class VisualizableDevice
Returns:
BLE device name

getAddress

public java.lang.String getAddress()

Description copied from class: VisualizableDevice

Returns Bluetooth LE MAC address
Specified by:
VisualizableDevice.getAddress() in class VisualizableDevice
Returns:
device unique address

getBatteryLevel

public int getBatteryLevel()

Description copied from class: VisualizableDevice

Returns battery state

Specified by:
VisualizableDevice.getBatteryLevel() in class VisualizableDevice
Returns:
battery charge level in percents

getNeuroDevice

public NeuroDevice getNeuroDevice()

Description copied from class: VisualizableDevice Returns this object. This method is for comapatability with VisualizableDevice class interface, inherited to use NeuroDevice in scopes where VisualizableDevice is needed

Specified by:
VisualizableDevice.getNeuroDevice() in class VisualizableDevice
Returns:
This NeuroDevice object


getSignalSubsystem

public SignalSubsystem getSignalSubsystem()

Returns subsystem for SIGNAL device feature

Returns:
Signal subsystem of device. Null if is not supported

getStimulationSubsystem

public StimulationSubsystem getStimulationSubsystem()

Returns subsystem for STIMUL device feature

Returns:
Stimulation subsystem of device. Null if is not supported

getFeatures

public DeviceFeature[] getFeatures()

Returns supported device features

Returns:
Device features

connect

public void connect()

Establishes connection with device services

disconnect

public void disconnect()

Disconnects from device