Difference between revisions of "Device (Java)"

From Neurotech Software Development Kit
Jump to: navigation, search
Line 1: Line 1:
 +
ru.neurotech.neurodevices
 +
 +
<span style="font-size: 150%;">'''Class NeuroDevice'''</span>
 +
 +
==Related Classes==
 +
 +
ru.neurotech.neurodevices.[[NeuroConnection Class|NeuroConnection]]
 +
 +
ru.neurotech.neurodevices.[[DeviceFeature Enumeration|DeviceFeature]]
 +
 +
ru.neurotech.neurodevices.state.[[NeuroDeviceError Enumeration|NeuroDeviceError]]
 +
 +
ru.neurotech.neurodevices.state.[[NeuroDeviceState Enumeration|NeuroDeviceState]]
 +
 +
==Classes hierarchy==
 +
<ul>
 +
<li>java.lang.Object</li>
 +
 +
<ul>
 +
<li>ru.neurotech.common.[[VisualizableDevice Class|VisualizableDevice]]</li>
 +
 +
<ul>
 +
<li>ru.neurotech.neurodevices.'''NeuroDevice'''</li>
 +
</ul>
 +
</ul>
 +
</ul>
 +
 +
==Class definition==
 +
<code><span style="color:#0066FF;">'''public class'''</span> NeuroDevice <span style="color:#0066FF;">'''extends'''</span> [[VisualizableDevice Class|VisualizableDevice]]</code>
 +
 +
Represents Neurotech™ device on a layer of algorithmic functionality
 +
 +
Provides signal and misc channels and methods for signal processing and viewing</div>
 +
 +
 +
==Fields Summary==
 +
{| class="wikitable"
 +
|- style="background-color: #dee3e9;"
 +
|'''Modifier and Type'''
 +
|'''Field and Description'''
 +
|- valign="top"
 +
|[[SubscribersNotifier Class|SubscribersNotifier]]&lt;'''[[NeuroDeviceState Enumeration|NeuroDeviceState]]'''&gt;
 +
|[[#deviceStateChanged|'''deviceStateChanged''']]
 +
Subscribe this event to get notifications about device state
 +
|}
 +
 +
==Constructor Summary==
 +
{| class="wikitable"
 +
|- style="background-color: #dee3e9;"
 +
|'''Constructor and Description'''
 +
|-
 +
|[[#NeuroDevice|NeuroDevice]](<span style="color:#0066FF;">'''long'''</span> nativeObjPtr)
 +
|}
 +
 +
==Methods Summary==
 +
{| class="wikitable"
 +
|- style="background-color: #dee3e9;"
 +
|'''Modifier and Type'''
 +
|'''Method and Description'''
 +
|- valign="top"
 +
|style="color:#0066FF;" |'''void'''
 +
|[[#close|close]]()
 +
Close device and free all resources
 +
|- valign="top"
 +
|style="color:#0066FF;" |'''void'''
 +
|[[#connect|connect]]()
 +
Establishes connection with device services
 +
|- valign="top"
 +
|style="color:#0066FF;" |'''void'''
 +
|[[#disconnect|disconnect]]()
 +
Disconnects from device
 +
|- valign="top"
 +
|style="color:#0066FF;" |'''void'''
 +
|[[#finalize|finalize]]()
 +
|- valign="top"
 +
|java.lang.String
 +
|[[#getAddress|getAddress]]()
 +
Returns Bluetooth LE MAC address
 +
|- valign="top"
 +
|style="color:#0066FF;" |'''int'''
 +
|[[#getBatteryLevel|getBatteryLevel]]()
 +
Returns battery charge level in percents
 +
|- valign="top"
 +
|[[NeuroDeviceError Enumeration|NeuroDeviceError]]
 +
|[[#getError|getError]]()
 +
Returns device error state information
 +
|- valign="top"
 +
|[[DeviceFeature Enumeration|DeviceFeature]][]
 +
|[[#getFeature|getFeature]]()
 +
Returns supported device features
 +
|- valign="top"
 +
|java.lang.String
 +
|[[#getName|getName]]()
 +
Returns name of BLE device
 +
|- valign="top"
 +
|style="color:#0066FF;" |[[NeuroDevice Class#Android|NeuroDevice]]
 +
|[[#getNeuroDevice|getNeuroDevice]]()
 +
Returns this object
 +
|- valign="top"
 +
|style="color:#0066FF;" |[[SignalSubsystem Class#Android|SignalSubsystem]]
 +
|[[#getSignalSubsystem|getSignalSubsystem]]()
 +
Returns subsystem for SIGNAL device feature
 +
|- valign="top"
 +
|style="color:#0066FF;" |[[NeuroDeviceState Enumeration#Android|NeuroDeviceState]]
 +
|[[#getState|getState]]()
 +
Returns common device state
 +
|- valign="top"
 +
|style="color:#0066FF;" |[[StimulationSubsystem Class#Android|StimulationSubsystem]]
 +
|[[#getStimulationSubsystem|getStimulationSubsystem]]()
 +
Returns subsystem for STIMUL device feature
 +
|}
 +
 +
==Field Detail==
 +
<h3>deviceStateChanged</h3>
 +
<code><span style="color:#0066FF;">'''public final'''</span> [[SubscribersNotifier Class|SubscribersNotifier]]&lt;[[NeuroDeviceState Enumeration|NeuroDeviceState]]&gt; deviceStateChanged</code>
 +
 +
Subscribe this event to get notifications about device state
 +
 +
==Constructor Detail==
 +
 +
<h3>NeuroDevice</h3>
 +
<code><span style="color:#0066FF;">'''public'''</span> NeuroDevice(<span style="color:#0066FF;">'''long'''</span> nativeObjPtr)</code>
 +
 +
==Method Detail==
 +
 +
<h3>finalize</h3>
 +
<code><span style="color:#0066FF;">'''public void'''</span> finalize() <span style="color:#0066FF;">throws</span> java.lang.Throwable</code>
 +
<dl>
 +
<dt>Overrides:</dt>
 +
<dd><code>finalize</code>&nbsp;in class&nbsp;<code>java.lang.Object</code></dd>
 +
<dt>Throws:</dt>
 +
<dd><code>java.lang.Throwable</code></dd>
 +
</dl>
 +
 +
 +
<h3>close</h3>
 +
<code><span style="color:#0066FF;">'''public void'''</span> close()</code>
 +
 +
 +
<h3>getState</h3>
 +
<code><span style="color:#0066FF;">'''public'''</span> [[NeuroDeviceState Enumeration|NeuroDeviceState]] getState()</code>
 +
 +
Returns NeuroDevice state
 +
<dl>
 +
<dt><span>Returns:</span></dt>
 +
<dd>Device state</dd>
 +
</dl>
 +
 +
<h3>getError</h3>
 +
<code><span style="color:#0066FF;">'''public'''</span> [[NeuroDeviceError Enumeration|NeuroDeviceError]] getError()</code>
 +
 +
Returns error type if device is in error state
 +
<dl>
 +
<dt><span>Returns:</span></dt>
 +
<dd>Error type for device error state</dd>
 +
</dl>
 +
 +
<h3>getName</h3>
 +
<code><span style="color:#0066FF;">'''public'''</span> java.lang.String getName()</code>
 +
 +
<span>'''Description copied from class: '''</span>[[VisualizableDevice Class#getName|VisualizableDevice]]
 +
 +
Returns name of BLE device
 +
<dl>
 +
<dt><span class="overrideSpecifyLabel">Specified by:</span></dt>
 +
<dd><code>[[VisualizableDevice Class#getName|VisualizableDevice.getName()]]</code> in class VisualizableDevice</dd>
 +
<dt><span>Returns:</span></dt>
 +
<dd>BLE device name</dd>
 +
</dl>
 +
 +
<h3>getAddress</h3>
 +
<code><span style="color:#0066FF;">'''public'''</span>&nbsp;java.lang.String&nbsp;getAddress()</code>
 +
 +
<span>'''Description copied from class:''' [[VisualizableDevice Class|VisualizableDevice]]</span>
 +
 +
<div class="block">Returns Bluetooth LE MAC address
 +
<dl>
 +
<dt><span class="overrideSpecifyLabel">Specified by:</span></dt>
 +
<dd><code>[[VisualizableDevice Class#getDeviceAddress|VisualizableDevice.getAddress()]]</code> in class VisualizableDevice</dd>
 +
<dt><span>Returns:</span></dt>
 +
<dd>device unique address</dd>
 +
</dl>
 +
 +
<h3>getBatteryLevel</h3>
 +
<code><span style="color:#0066FF;">'''public int'''</span> getBatteryLevel()</code>
 +
 +
<span>'''Description copied from class:''' [[VisualizableDevice Class|VisualizableDevice]]</span>
 +
 +
Returns battery state
 +
 +
<dl>
 +
<dt><span class="overrideSpecifyLabel">Specified by:</span></dt>
 +
<dd><code>[[VisualizableDevice Class#getBatteryLevel|VisualizableDevice.getBatteryLevel()]]</code>&nbsp;in class&nbsp;VisualizableDevice</dd>
 +
<dt><span class="returnLabel">Returns:</span></dt>
 +
<dd>battery charge level in percents</dd>
 +
</dl>
 +
 +
<h3>getNeuroDevice</h3>
 +
<code><span style="color:#0066FF;">'''public'''</span> [[NeuroDevice Class|NeuroDevice]]&nbsp;getNeuroDevice()</code>
 +
 +
<span>'''Description copied from class:'''&nbsp;[[VisualizableDevice Class|VisualizableDevice]]</span>
 +
Returns this object. This method is for comapatability with VisualizableDevice class interface, inherited to use NeuroDevice in scopes where VisualizableDevice is needed
 +
<dl>
 +
<dt><span class="overrideSpecifyLabel">Specified by:</span></dt>
 +
<dd><code>[[VisualizableDevice Class#getNeuroDevice|VisualizableDevice.getNeuroDevice()]]</code>&nbsp;in class&nbsp;VisualizableDevice</dd>
 +
<dt><span class="returnLabel">Returns:</span></dt>
 +
<dd>This NeuroDevice object</dd>
 +
</dl>
 +
 +
 +
<h3>getSignalSubsystem</h3>
 +
<code><span style="color:#0066FF;">'''public'''</span> [[SignalSubsystem Class|SignalSubsystem]]&nbsp;getSignalSubsystem()</code>
 +
 +
Returns subsystem for SIGNAL device feature
 +
 +
<dl>
 +
<dt><span class="returnLabel">Returns:</span></dt>
 +
<dd>Signal subsystem of device. Null if is not supported</dd>
 +
</dl>
 +
 +
<h3>getStimulationSubsystem</h3>
 +
<code><span style="color:#0066FF;">'''public'''</span> [[StimulationSubsystem Class|StimulationSubsystem]]&nbsp;getStimulationSubsystem()</code>
 +
 +
Returns subsystem for STIMUL device feature
 +
 +
<dl>
 +
<dt><span class="returnLabel">Returns:</span></dt>
 +
<dd>Stimulation subsystem of device. Null if is not supported</dd>
 +
</dl>
 +
 +
<h3>getFeatures</h3>
 +
<code><span style="color:#0066FF;">'''public'''</span> [[DeviceFeature Enumeration|DeviceFeature]][]&nbsp;getFeatures()</code>
 +
 +
Returns supported device features
 +
 +
<dl>
 +
<dt><span class="returnLabel">Returns:</span></dt>
 +
<dd>Device features</dd>
 +
</dl>
 +
 +
<h3>connect</h3>
 +
<code><span style="color:#0066FF;">'''public void'''</span> connect()</code>
 +
 +
Establishes connection with device services
 +
 +
<h3>disconnect</h3>
 +
<code><span style="color:#0066FF;">'''public void'''</span> disconnect()</code>
 +
 +
Disconnects from device
 +
 +
 
<div class="header">
 
<div class="header">
 
<div class="subTitle">ru.neurotech.neurosdk</div>
 
<div class="subTitle">ru.neurotech.neurosdk</div>

Revision as of 06:28, 28 April 2018

ru.neurotech.neurodevices

Class NeuroDevice

Related Classes

ru.neurotech.neurodevices.NeuroConnection

ru.neurotech.neurodevices.DeviceFeature

ru.neurotech.neurodevices.state.NeuroDeviceError

ru.neurotech.neurodevices.state.NeuroDeviceState

Classes hierarchy

  • java.lang.Object

Class definition

public class NeuroDevice extends VisualizableDevice

Represents Neurotech™ device on a layer of algorithmic functionality

Provides signal and misc channels and methods for signal processing and viewing</div>


Fields Summary

Modifier and Type Field and Description
SubscribersNotifier<NeuroDeviceState> deviceStateChanged

Subscribe this event to get notifications about device state

Constructor Summary

Constructor and Description
NeuroDevice(long nativeObjPtr)

Methods Summary

Modifier and Type Method and Description
void close()

Close device and free all resources

void connect()

Establishes connection with device services

void disconnect()

Disconnects from device

void finalize()
java.lang.String getAddress()

Returns Bluetooth LE MAC address

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

deviceStateChanged

public final SubscribersNotifier<NeuroDeviceState> deviceStateChanged

Subscribe this event to get notifications about device state

Constructor Detail

NeuroDevice

public NeuroDevice(long nativeObjPtr)

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


ru.neurotech.neurosdk

Class Device

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


  • public class <span class="typeNameLabel">Device</span>
    extends java.lang.Object
    • <a name="field.summary"> </a>

      Field Summary

      Fields 
      Modifier and Type Field and Description
      <a href="../../../ru/neurotech/common/SubscribersNotifier.html" title="class in ru.neurotech.common">SubscribersNotifier</a><<a href="../../../ru/neurotech/neurosdk/parameters/ParameterName.html" title="enum in ru.neurotech.neurosdk.parameters">ParameterName</a>> <a href="../../../ru/neurotech/neurosdk/Device.html#parameterChanged">parameterChanged</a>
      Subscribe this event to receive notifications about changes of device parameters
    • <a name="method.summary"> </a>

      Method Summary

      All Methods <a href="javascript:show(2);">Instance Methods</a> <a href="javascript:show(8);">Concrete Methods</a> 
      Modifier and Type Method and Description
      <a href="../../../ru/neurotech/neurosdk/channels/ChannelInfo.html" title="interface in ru.neurotech.neurosdk.channels">ChannelInfo</a>[] <a href="../../../ru/neurotech/neurosdk/Device.html#channels--">channels</a>()
      Returns information about supported channels Check this information before creation of channel.
      <a href="../../../ru/neurotech/neurosdk/parameters/Command.html" title="enum in ru.neurotech.neurosdk.parameters">Command</a>[] <a href="../../../ru/neurotech/neurosdk/Device.html#commands--">commands</a>()
      Returns supported commands of device
      void <a href="../../../ru/neurotech/neurosdk/Device.html#connect--">connect</a>()
      Tries to establish connection with device Check DeviceState parameter or subscribe parameterChanged event for operation result
      void <a href="../../../ru/neurotech/neurosdk/Device.html#disconnect--">disconnect</a>()
      Disconnects from device Check DeviceState parameter or subscribe parameterChanged event for operation result
      boolean <a href="../../../ru/neurotech/neurosdk/Device.html#execute-ru.neurotech.neurosdk.parameters.Command-">execute</a>(<a href="../../../ru/neurotech/neurosdk/parameters/Command.html" title="enum in ru.neurotech.neurosdk.parameters">Command</a> cmd)
      Tries to execute command and returns value indicating operations success.
      void <a href="../../../ru/neurotech/neurosdk/Device.html#finalize--">finalize</a>() 
      <a href="../../../ru/neurotech/neurosdk/parameters/Parameter.html" title="class in ru.neurotech.neurosdk.parameters">Parameter</a>[] <a href="../../../ru/neurotech/neurosdk/Device.html#parameters--">parameters</a>()
      Returns all available parameters of device, their types and access rights
      <ParamType>
      ParamType
      <a href="../../../ru/neurotech/neurosdk/Device.html#readParam-ru.neurotech.neurosdk.parameters.ParameterName-">readParam</a>(<a href="../../../ru/neurotech/neurosdk/parameters/ParameterName.html" title="enum in ru.neurotech.neurosdk.parameters">ParameterName</a> param)
      Return value of specified parameter of device.
      boolean <a href="../../../ru/neurotech/neurosdk/Device.html#setParam-ru.neurotech.neurosdk.parameters.ParameterName-java.lang.Object-">setParam</a>(<a href="../../../ru/neurotech/neurosdk/parameters/ParameterName.html" title="enum in ru.neurotech.neurosdk.parameters">ParameterName</a> param,
             java.lang.Object value)
      
      Sets value for specified parameter and returns value indicating success of operation.
      • <a name="methods.inherited.from.class.java.lang.Object"> </a>

        Methods inherited from class java.lang.Object

        clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • <a name="field.detail"> </a>

      Field Detail

      <a name="parameterChanged"> </a>

      • parameterChanged

        public final <a href="../../../ru/neurotech/common/SubscribersNotifier.html" title="class in ru.neurotech.common">SubscribersNotifier</a><<a href="../../../ru/neurotech/neurosdk/parameters/ParameterName.html" title="enum in ru.neurotech.neurosdk.parameters">ParameterName</a>> parameterChanged
        Subscribe this event to receive notifications about changes of device parameters
    • <a name="method.detail"> </a>

      Method Detail

      <a name="finalize--"> </a>

      • finalize

        public void finalize()
                      throws java.lang.Throwable
        Overrides:
        finalize in class java.lang.Object
        Throws:
        java.lang.Throwable

      <a name="connect--"> </a>

      • connect

        public void connect()
        Tries to establish connection with device Check DeviceState parameter or subscribe parameterChanged event for operation result

      <a name="disconnect--"> </a>

      • disconnect

        public void disconnect()
        Disconnects from device Check DeviceState parameter or subscribe parameterChanged event for operation result

      <a name="channels--"> </a>

      • channels

        public <a href="../../../ru/neurotech/neurosdk/channels/ChannelInfo.html" title="interface in ru.neurotech.neurosdk.channels">ChannelInfo</a>[] 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:
        Array of channel info objects

      <a name="commands--"> </a>

      • commands

        public <a href="../../../ru/neurotech/neurosdk/parameters/Command.html" title="enum in ru.neurotech.neurosdk.parameters">Command</a>[] commands()
        Returns supported commands of device
        Returns:
        Array of supported commands

      <a name="parameters--"> </a>

      • parameters

        public <a href="../../../ru/neurotech/neurosdk/parameters/Parameter.html" title="class in ru.neurotech.neurosdk.parameters">Parameter</a>[] parameters()
        Returns all available parameters of device, their types and access rights
        Returns:
        Array of available parameters

      <a name="execute-ru.neurotech.neurosdk.parameters.Command-"> </a>

      • execute

        public boolean execute(<a href="../../../ru/neurotech/neurosdk/parameters/Command.html" title="enum in ru.neurotech.neurosdk.parameters">Command</a> cmd)
        Tries to execute command and returns value indicating operations success. Will throw if device does not support specified command. To get supported commands call commands() method
        Parameters:
        cmd - Command to execute
        Returns:
        Operation success indicator
        Throws:
        java.lang.UnsupportedOperationException

      <a name="readParam-ru.neurotech.neurosdk.parameters.ParameterName-"> </a>

      • readParam

        public <ParamType> ParamType readParam(<a href="../../../ru/neurotech/neurosdk/parameters/ParameterName.html" title="enum in ru.neurotech.neurosdk.parameters">ParameterName</a> param)
        Return value of specified parameter of device. Will throw if parameter does not present in
        device. To get supported parameters and type information for parameter call parameters()
        
        method. It returns Parameter object which consists of parameter name, type and access mode
        Parameters:
        param - ParameterName to read
        Returns:
        Parameter value
        Throws:
        java.lang.UnsupportedOperationException

      <a name="setParam-ru.neurotech.neurosdk.parameters.ParameterName-java.lang.Object-"> </a>

      • setParam

        public boolean setParam(<a href="../../../ru/neurotech/neurosdk/parameters/ParameterName.html" title="enum in ru.neurotech.neurosdk.parameters">ParameterName</a> param,
                                java.lang.Object value)
        Sets value for specified parameter and returns value indicating success of operation. Will
        throw if parameter does not present in device or has only Read access mode. To get supported
        parameters and type information for parameter call parameters() method. It returns Parameter
        
        object which consists of parameter name, type and access mode
        Parameters:
        param - Name of parameter to set
        value - Parameter value
        Returns:
        Operation success
        Throws:
        java.lang.UnsupportedOperationException
<a name="navbar.bottom">

</a>

<a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a>

<a name="navbar.bottom.firstrow"> </a>

</body>

</html>