Device (Java)

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

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>