Skip to content

Commit

Permalink
Improve receive steps for handling unformatted and empty tags.
Browse files Browse the repository at this point in the history
  • Loading branch information
zolkis committed Oct 7, 2015
1 parent 155e19c commit 57026bf
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions index.html
Expand Up @@ -2415,20 +2415,24 @@ <h3>Receiving and parsing content</h3>
<section><h3>The NDEF parsing algorithm</h3>
When the <a>UA</a> is to <dfn>receive an NDEF message</dfn> it MUST run the
following algorithm:
<p class="note">
The UA SHOULD represent an unformatted <a>NFC tag</a> as an
<a>NDEF message</a> containing a single empty <a>NDEF record</a>.
</p>
<ol id ="parse-ndef">
<li>
If <var>NFCAdapter@[[\suspended]]</var> is <code>true</code>, abort
these steps.
</li>
<li>
Let <var>input</var> be the notation for the <a>NDEF message</a>
which has been received.
</li>
<li>
Let <var>message</var> be a new <code>NFCMessage</code> object, with
<var>message</var>.url set to <code>null</code> and
<var>message</var>.data set to empty sequence.
</li>
<li>
Let <var>input</var> be the notation for the <a>NDEF message</a>
which has been received.
</li>
<li>
For each <a>NDEF record</a> which is part of <var>input</var>, run the
following sub-steps for <dfn>parsing NDEF record</dfn>:
Expand All @@ -2443,9 +2447,8 @@ <h3>Receiving and parsing content</h3>
</li>
<li>
If <var>ndef.TNF</var> is 0 (NFC Empty Record), then set
<var>record</var>.kind to <code>"empty"</code>,
<var>record</var>.type to <code>""</code>,
and <var>record</var>.data to <code>null</code>.
<var>record</var>.kind to <code>"empty"</code> and set
<var>record</var>.type to <code>""</code>.
</li>
<li>
If <var>ndef.TNF</var> is 1 (NFC Well Known Type Record), and
Expand Down

1 comment on commit 57026bf

@kenchris
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lgtm

Please sign in to comment.