Difference between revisions of "EcgDeviceConnector Class"

From Neurotech Software Development Kit
Jump to: navigation, search
(Android)
(Android)
 
(9 intermediate revisions by the same user not shown)
Line 1: Line 1:
Summary
+
This class provides simplified interface for scanning, getting and preparing Callibri devices sutable for ECG test.
 
=Android=
 
=Android=
  
Line 24: Line 24:
 
<code><span style="color:#0066FF;">'''public class'''</span> EcgDeviceConnector <span style="color:#0066FF;">'''extends'''</span> java.lang.Object</code>
 
<code><span style="color:#0066FF;">'''public class'''</span> EcgDeviceConnector <span style="color:#0066FF;">'''extends'''</span> java.lang.Object</code>
  
<!-- =========== FIELD SUMMARY =========== -->
+
==Fields Summary==
<ul class="blockList">
+
{| class="wikitable"
<li class="blockList"><a name="field.summary">
+
|- style="background-color: #dee3e9;"
<!--  -->
+
|'''Modifier and Type'''
</a>
+
|'''Field and Description'''
<h3>Field Summary</h3>
+
|- valign="top"
<table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Field Summary table, listing fields, and an explanation">
+
|[[SubscribersNotifier Class|SubscribersNotifier]]&lt;[[EcgDevice Class|EcgDevice]]&gt;
<caption><span>Fields</span><span class="tabEnd">&nbsp;</span></caption>
+
|[[#deviceFound|deviceFound]]
<tr>
+
Notifies when proper Callibri ECG device been found and initialized
<th class="colFirst" scope="col">Modifier and Type</th>
+
|-  valign="top"
<th class="colLast" scope="col">Field and Description</th>
+
|[[SubscribersNotifier Class|SubscribersNotifier]]&lt;java.lang.Boolean&gt;
</tr>
+
|[[#scanStateChanged|scanStateChanged]]
<tr class="altColor">
+
Notifies about changing device scanning state
<td class="colFirst"><code><a href="../../../../ru/neurotech/common/SubscribersNotifier.html" title="class in ru.neurotech.common">SubscribersNotifier</a>&lt;<a href="../../../../ru/neurotech/neurodevices/ecg/EcgDevice.html" title="class in ru.neurotech.neurodevices.ecg">EcgDevice</a>&gt;</code></td>
+
|}
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../ru/neurotech/neurodevices/ecg/EcgDeviceConnector.html#deviceFound">deviceFound</a></span></code>
+
 
<div class="block">Notifies when proper Callibri ECG device been found and initialized</div>
+
==Constructor Summary==
</td>
+
{| class="wikitable"
</tr>
+
|- style="background-color: #dee3e9;"
<tr class="rowColor">
+
|'''Constructor and Description'''
<td class="colFirst"><code><a href="../../../../ru/neurotech/common/SubscribersNotifier.html" title="class in ru.neurotech.common">SubscribersNotifier</a>&lt;java.lang.Boolean&gt;</code></td>
+
|-
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../ru/neurotech/neurodevices/ecg/EcgDeviceConnector.html#scanStateChanged">scanStateChanged</a></span></code>
+
|[[#EcgDeviceConnector|EcgDeviceConnector]](android.content.Context context)
<div class="block">Notifies about changing device scanning state</div>
+
Creates new instance of EcgDeviceConnector class with current application context
</td>
+
|}
</tr>
+
 
</table>
+
==Methods Summary==
</li>
+
{| class="wikitable"
</ul>
+
|- style="background-color: #dee3e9;"
<!-- ======== CONSTRUCTOR SUMMARY ======== -->
+
|'''Modifier and Type'''
<ul class="blockList">
+
|'''Method and Description'''
<li class="blockList"><a name="constructor.summary">
+
|- valign="top"
<!--  -->
+
|[[EcgDevice Class|EcgDevice]]
</a>
+
|[[#getDeviceByAddress|getDeviceByAddress]](java.lang.String address)
<h3>Constructor Summary</h3>
+
Returns object, representing device with specified address
<table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Constructor Summary table, listing constructors, and an explanation">
+
It is not guaranteed, that this device is currently available
<caption><span>Constructors</span><span class="tabEnd">&nbsp;</span></caption>
+
|- valign="top"
<tr>
+
|style="color:#0066FF;" |'''void'''
<th class="colOne" scope="col">Constructor and Description</th>
+
|[[#shutdown|shutdown]]()
</tr>
+
Ends all operations with device searching and frees all resources.
<tr class="altColor">
+
|- valign="top"
<td class="colOne"><code><span class="memberNameLink"><a href="../../../../ru/neurotech/neurodevices/ecg/EcgDeviceConnector.html#EcgDeviceConnector-android.content.Context-">EcgDeviceConnector</a></span>(android.content.Context&nbsp;context)</code>
+
|style="color:#0066FF;" |'''void'''
<div class="block">Creates new instance of MotionAssistantDeviceConnector class with current application context</div>
+
|[[#startScan|startScan]](<span style="color:#0066FF;">'''int'''</span> timeout)
</td>
+
Starts searching for Callibri devices suitable for ECG tests
</tr>
+
|- valign="top"
</table>
+
|style="color:#0066FF;" |'''void'''
</li>
+
|[[#stopScan|stopScan]]
</ul>
+
Stops device searching
<!-- ========== METHOD SUMMARY =========== -->
+
|}
<ul class="blockList">
+
 
<li class="blockList"><a name="method.summary">
+
==Field Detail==
<!--  -->
+
<h3>deviceFound</h3>
</a>
+
<code><span style="color:#0066FF;">'''public final'''</span> [[SubscribersNotifier Class|SubscribersNotifier]]&lt;[[EcgDevice Class|EcgDevice]]&gt; deviceFound</code>
<h3>Method Summary</h3>
+
 
<table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Method Summary table, listing methods, and an explanation">
+
Notifies when proper Callibri ECG device been found and initialized
<caption><span id="t0" class="activeTableTab"><span>All Methods</span><span class="tabEnd">&nbsp;</span></span><span id="t2" class="tableTab"><span><a href="javascript:show(2);">Instance Methods</a></span><span class="tabEnd">&nbsp;</span></span><span id="t4" class="tableTab"><span><a href="javascript:show(8);">Concrete Methods</a></span><span class="tabEnd">&nbsp;</span></span></caption>
+
 
<tr>
+
<h3>scanStateChanged</h3>
<th class="colFirst" scope="col">Modifier and Type</th>
+
<code><span style="color:#0066FF;">'''public final'''</span> [[SubscribersNotifier Class|SubscribersNotifier]]&lt;java.lang.Boolean&gt; scanStateChanged</code>
<th class="colLast" scope="col">Method and Description</th>
+
 
</tr>
+
Notifies about changing device scanning state
<tr id="i0" class="altColor">
+
 
<td class="colFirst"><code><a href="../../../../ru/neurotech/neurodevices/ecg/EcgDevice.html" title="class in ru.neurotech.neurodevices.ecg">EcgDevice</a></code></td>
+
==Constructor Detail==
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../ru/neurotech/neurodevices/ecg/EcgDeviceConnector.html#getDeviceByAddress-java.lang.String-">getDeviceByAddress</a></span>(java.lang.String&nbsp;address)</code>
+
 
<div class="block">Returns object, representing device with specified address
+
<h3>EcgDeviceConnector</h3>
It is not guaranteed, that this device is currently available</div>
+
<code><span style="color:#0066FF;">'''public'''</span> EcgDeviceConnector(android.content.Context&nbsp;context)</code>
</td>
+
 
</tr>
+
Creates new instance of EcgDeviceConnector class with current application context
<tr id="i1" class="rowColor">
+
 
<td class="colFirst"><code>void</code></td>
+
==Method Detail==
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../ru/neurotech/neurodevices/ecg/EcgDeviceConnector.html#shutdown--">shutdown</a></span>()</code>
+
 
<div class="block">Ends all operations with device searching and frees all resources</div>
+
<h3>startScan</h3>
</td>
+
<code><span style="color:#0066FF;">'''public void'''</span> startScan(int&nbsp;timeout)</code>
</tr>
+
 
<tr id="i2" class="altColor">
+
Starts searching for Callibri devices suitable for ECG tests
<td class="colFirst"><code>void</code></td>
 
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../ru/neurotech/neurodevices/ecg/EcgDeviceConnector.html#startScan-int-">startScan</a></span>(int&nbsp;timeout)</code>
 
<div class="block">Starts searching for Callibri devices suitable for ECG tests</div>
 
</td>
 
</tr>
 
<tr id="i3" class="rowColor">
 
<td class="colFirst"><code>void</code></td>
 
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../ru/neurotech/neurodevices/ecg/EcgDeviceConnector.html#stopScan--">stopScan</a></span>()</code>
 
<div class="block">Stops device searching</div>
 
</td>
 
</tr>
 
</table>
 
<ul class="blockList">
 
<li class="blockList"><a name="methods.inherited.from.class.java.lang.Object">
 
<!--  -->
 
</a>
 
<h3>Methods inherited from class&nbsp;java.lang.Object</h3>
 
<code>clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait</code></li>
 
</ul>
 
</li>
 
</ul>
 
</li>
 
</ul>
 
</div>
 
<div class="details">
 
<ul class="blockList">
 
<li class="blockList">
 
<!-- ============ FIELD DETAIL =========== -->
 
<ul class="blockList">
 
<li class="blockList"><a name="field.detail">
 
<!--  -->
 
</a>
 
<h3>Field Detail</h3>
 
<a name="deviceFound">
 
<!--  -->
 
</a>
 
<ul class="blockList">
 
<li class="blockList">
 
<h4>deviceFound</h4>
 
<pre>public final&nbsp;<a href="../../../../ru/neurotech/common/SubscribersNotifier.html" title="class in ru.neurotech.common">SubscribersNotifier</a>&lt;<a href="../../../../ru/neurotech/neurodevices/ecg/EcgDevice.html" title="class in ru.neurotech.neurodevices.ecg">EcgDevice</a>&gt; deviceFound</pre>
 
<div class="block">Notifies when proper Callibri ECG device been found and initialized</div>
 
</li>
 
</ul>
 
<a name="scanStateChanged">
 
<!--  -->
 
</a>
 
<ul class="blockListLast">
 
<li class="blockList">
 
<h4>scanStateChanged</h4>
 
<pre>public final&nbsp;<a href="../../../../ru/neurotech/common/SubscribersNotifier.html" title="class in ru.neurotech.common">SubscribersNotifier</a>&lt;java.lang.Boolean&gt; scanStateChanged</pre>
 
<div class="block">Notifies about changing device scanning state</div>
 
</li>
 
</ul>
 
</li>
 
</ul>
 
<!-- ========= CONSTRUCTOR DETAIL ======== -->
 
<ul class="blockList">
 
<li class="blockList"><a name="constructor.detail">
 
<!--  -->
 
</a>
 
<h3>Constructor Detail</h3>
 
<a name="EcgDeviceConnector-android.content.Context-">
 
<!--  -->
 
</a>
 
<ul class="blockListLast">
 
<li class="blockList">
 
<h4>EcgDeviceConnector</h4>
 
<pre>public&nbsp;EcgDeviceConnector(android.content.Context&nbsp;context)</pre>
 
<div class="block">Creates new instance of MotionAssistantDeviceConnector class with current application context</div>
 
<dl>
 
<dt><span class="paramLabel">Parameters:</span></dt>
 
<dd><code>context</code> - Application context</dd>
 
</dl>
 
</li>
 
</ul>
 
</li>
 
</ul>
 
<!-- ============ METHOD DETAIL ========== -->
 
<ul class="blockList">
 
<li class="blockList"><a name="method.detail">
 
<!--  -->
 
</a>
 
<h3>Method Detail</h3>
 
<a name="startScan-int-">
 
<!--  -->
 
</a>
 
<ul class="blockList">
 
<li class="blockList">
 
<h4>startScan</h4>
 
<pre>public&nbsp;void&nbsp;startScan(int&nbsp;timeout)</pre>
 
<div class="block">Starts searching for Callibri devices suitable for ECG tests</div>
 
 
<dl>
 
<dl>
 
<dt><span class="paramLabel">Parameters:</span></dt>
 
<dt><span class="paramLabel">Parameters:</span></dt>
 
<dd><code>timeout</code> - Scan time. Zero for infinity</dd>
 
<dd><code>timeout</code> - Scan time. Zero for infinity</dd>
 
</dl>
 
</dl>
</li>
+
 
</ul>
+
<h3>stopScan</h3>
<a name="stopScan--">
+
<code><span style="color:#0066FF;">'''public void'''</span> stopScan()</code>
<!--  -->
+
 
</a>
+
Stops device searching
<ul class="blockList">
+
 
<li class="blockList">
+
<h3>shutdown</h3>
<h4>stopScan</h4>
+
<code><span style="color:#0066FF;">'''public void'''</span> shutdown()</code>
<pre>public&nbsp;void&nbsp;stopScan()</pre>
+
 
<div class="block">Stops device searching</div>
+
Ends all operations with device searching and frees all resources
</li>
+
 
</ul>
+
<h3>getDeviceByAddress</h3>
<a name="shutdown--">
+
<code><span style="color:#0066FF;">'''public'''</span> [[EcgDevice Class|EcgDevice]] getDeviceByAddress(java.lang.String address)</code>
<!--  -->
+
 
</a>
+
Returns object, representing device with specified address
<ul class="blockList">
+
It is not guaranteed, that this device is currently available
<li class="blockList">
 
<h4>shutdown</h4>
 
<pre>public&nbsp;void&nbsp;shutdown()</pre>
 
<div class="block">Ends all operations with device searching and frees all resources</div>
 
</li>
 
</ul>
 
<a name="getDeviceByAddress-java.lang.String-">
 
<!--  -->
 
</a>
 
<ul class="blockListLast">
 
<li class="blockList">
 
<h4>getDeviceByAddress</h4>
 
<pre>public&nbsp;<a href="../../../../ru/neurotech/neurodevices/ecg/EcgDevice.html" title="class in ru.neurotech.neurodevices.ecg">EcgDevice</a>&nbsp;getDeviceByAddress(java.lang.String&nbsp;address)</pre>
 
<div class="block">Returns object, representing device with specified address
 
It is not guaranteed, that this device is currently available</div>
 
 
<dl>
 
<dl>
 
<dt><span class="paramLabel">Parameters:</span></dt>
 
<dt><span class="paramLabel">Parameters:</span></dt>
 
<dd><code>address</code> - BTLE device address</dd>
 
<dd><code>address</code> - BTLE device address</dd>
 
<dt><span class="returnLabel">Returns:</span></dt>
 
<dt><span class="returnLabel">Returns:</span></dt>
<dd>EcgDevice object</dd>
+
<dd>[[EcgDevice Class|EcgDevice]] object</dd>
 
</dl>
 
</dl>
</li>
 
</ul>
 
</li>
 
</ul>
 
</li>
 
</ul>
 
</div>
 
</div>
 

Latest revision as of 04:25, 9 August 2017

This class provides simplified interface for scanning, getting and preparing Callibri devices sutable for ECG test.

Android

ru.neurotech.neurodevices.ecg

Class EcgDeviceConnector

Related Classes

ru.neurotech.neurodevices.ecg.EcgDevice

ru.neurotech.neurodevices.ecg.RPeak

Classes hierarchy

  • java.lang.Object
    • ru.neurotech.neurodevices.ecg.EcgDeviceConnector

Class definition

public class EcgDeviceConnector extends java.lang.Object

Fields Summary

Modifier and Type Field and Description
SubscribersNotifier<EcgDevice> deviceFound

Notifies when proper Callibri ECG device been found and initialized

SubscribersNotifier<java.lang.Boolean> scanStateChanged

Notifies about changing device scanning state

Constructor Summary

Constructor and Description
EcgDeviceConnector(android.content.Context context)

Creates new instance of EcgDeviceConnector class with current application context

Methods Summary

Modifier and Type Method and Description
EcgDevice getDeviceByAddress(java.lang.String address)

Returns object, representing device with specified address It is not guaranteed, that this device is currently available

void shutdown()

Ends all operations with device searching and frees all resources.

void startScan(int timeout)

Starts searching for Callibri devices suitable for ECG tests

void stopScan

Stops device searching

Field Detail

deviceFound

public final SubscribersNotifier<EcgDevice> deviceFound

Notifies when proper Callibri ECG device been found and initialized

scanStateChanged

public final SubscribersNotifier<java.lang.Boolean> scanStateChanged

Notifies about changing device scanning state

Constructor Detail

EcgDeviceConnector

public EcgDeviceConnector(android.content.Context context)

Creates new instance of EcgDeviceConnector class with current application context

Method Detail

startScan

public void startScan(int timeout)

Starts searching for Callibri devices suitable for ECG tests

Parameters:
timeout - Scan time. Zero for infinity

stopScan

public void stopScan()

Stops device searching

shutdown

public void shutdown()

Ends all operations with device searching and frees all resources

getDeviceByAddress

public EcgDevice getDeviceByAddress(java.lang.String address)

Returns object, representing device with specified address It is not guaranteed, that this device is currently available

Parameters:
address - BTLE device address
Returns:
EcgDevice object