Skip to content

Commit

Permalink
Fixed parameters handling. Changed NFCDataType to NFCRecordType to be…
Browse files Browse the repository at this point in the history
… consistent with the web-nfc.idl.
  • Loading branch information
zolkis committed Sep 7, 2015
1 parent 1babe6b commit 43eac44
Showing 1 changed file with 18 additions and 10 deletions.
28 changes: 18 additions & 10 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -1010,13 +1010,13 @@ <h4>The <strong>NFCRecord</strong> dictionary and
dictionary:
</p>
<dl title="dictionary NFCRecord" class="idl">
<dt>NFCDataType kind</dt>
<dt>NFCRecordType kind</dt>
<dt>USVString type</dt>
<dt>any data</dt>
</dl>
<p>
The <code><dfn id="widl-NFCRecord-kind">kind</dfn></code>
property MUST return the <a><code>NFCDataType</code></a> of the
property MUST return the <a><code>NFCRecordType</code></a> of the
<a>NDEF record</a>.
</p>
<p>
Expand All @@ -1032,13 +1032,13 @@ <h4>The <strong>NFCRecord</strong> dictionary and
</p>
</section> <!-- NFCRecord dictionary -->

<section><h4>The <strong>NFCDataType</strong> enum</h4>
<section><h4>The <strong>NFCRecordType</strong> enum</h4>
<p>
<dfn>NFCDataType</dfn> denotes the data types
<dfn>NFCRecordType</dfn> denotes the data types
supported as <a>NDEF record</a> payload in read and send operations in
this API.
</p>
<dl title="enum NFCDataType" class="idl">
<dl title="enum NFCRecordType" class="idl">
<dt>empty</dt>
<dt>text</dt>
<dt>url</dt>
Expand All @@ -1051,7 +1051,7 @@ <h4>The <strong>NFCRecord</strong> dictionary and
the data, i.e. the <a href="#steps-receiving">receiving NFC content</a>
algorithm and <a>sending NFC content</a> algorithm.
</p>
</section> <!-- NFCDataType interface -->
</section> <!-- NFCRecordType interface -->

<section><h3>Data mapping</h3>
<p>
Expand Down Expand Up @@ -1417,6 +1417,9 @@ <h3>The <strong>pushMessage</strong> algorithm</h3>
</li>
</ul>
</li>
<li>
Let <var>options</var> be the second argument.
</li>
<li>
Let <var>timeout</var> be the value of <var>options.timeout</var> if
it is defined, or otherwise 10000 (milliseconds).
Expand Down Expand Up @@ -1790,19 +1793,19 @@ <h3>The <strong>pushMessage</strong> algorithm</h3>
When an <a>NFC device</a> comes in communication range,
<ul>
<li>
If <var>options.target</var> has the value <code>"tag"</code>,
If <var>target</var> has the value <code>"tag"</code>,
then the sending should only happen if an <a>NFC tag</a> is
tapped, otherwise reject <var>promise</var>
<code>"InvalidAccessError"</code> and terminate this algorithm.
</li>
<li>
If <var>options.target</var> has the value <code>"peer"</code>,
If <var>target</var> has the value <code>"peer"</code>,
then the sending should only happen if an <a>NFC peer</a> is
tapped, otherwise reject <var>promise</var> with
<code>"InvalidAccessError"</code> and terminate this algorithm.
</li>
<li>
If <var>options.target</var> has the value <code>"any"</code>
If <var>target</var> has the value <code>"any"</code>
(which is the default value), then the sending should happen if
either an <a>NFC peer</a> or an <a>NFC tag</a> is tapped within
the specified timeout.
Expand Down Expand Up @@ -2101,10 +2104,15 @@ <h3>The <strong>pushMessage</strong> algorithm</h3>
</p>
</li>
<li>
If the argument <var>options</var> contains invalid values,
If the first argument <var>options</var> contains invalid values,
reject <var>promise</var> with a <code>"<a>SyntaxError</a>"</code>,
and terminate this algorithm.
</li>
<li>
If the second argument <var>callback</var> is not an instance of
Function, then reject <var>promise</var> with a
<code>"<a>SyntaxError</a>"</code>, and terminate this algorithm.
</li>
<li>
If this is the first watch being set up for the current
<a>NFC adapter</a>, make a request to the underlying platform to
Expand Down

0 comments on commit 43eac44

Please sign in to comment.