Difference between revisions of "Device (Java)"
NateColeman (talk | contribs) |
NateColeman (talk | contribs) (→Methods Summary) |
||
Line 39: | Line 39: | ||
|'''Modifier and Type''' | |'''Modifier and Type''' | ||
|'''Method and Description''' | |'''Method and Description''' | ||
− | |||
− | |||
− | |||
− | |||
|- valign="top" | |- valign="top" | ||
|style="color:#0066FF;" |'''void''' | |style="color:#0066FF;" |'''void''' | ||
Line 52: | Line 48: | ||
Disconnects from device | Disconnects from device | ||
|- valign="top" | |- valign="top" | ||
− | + | |[[ChannelInfo (java)|ChannelInfo]][] | |
− | |[[ | + | |[[#channels|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 with it |
− | Returns | ||
|- valign="top" | |- valign="top" | ||
|style="color:#0066FF;" |'''int''' | |style="color:#0066FF;" |'''int''' |
Revision as of 07:12, 28 April 2018
ru.neuromd.neurosdk
Class Device
Contents
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 with it |
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 classjava.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
- 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()