|
1383 | 1383 | The <dfn>NFCPushOptions.timeout</dfn> property
|
1384 | 1384 | denotes the timeout for the pending <code>pushMessage()</code>
|
1385 | 1385 | operation expressed in milliseconds. The default value is
|
1386 |
| - implementation-dependent. After the <var>timeout</var> expires, the |
| 1386 | + implementation-dependent. The value <code>Infinity</code> means there is |
| 1387 | + no timeout. After the <var>timeout</var> expires, the |
1387 | 1388 | message set for sending is cleared, an error is returned, and a new
|
1388 | 1389 | <a>Web NFC message</a> can be set for sending.
|
1389 | 1390 | </p>
|
|
1394 | 1395 | This section describes how to write an <a>NDEF message</a>
|
1395 | 1396 | to an <a>NFC tag</a> or how to push it to an <a>NFC peer</a>
|
1396 | 1397 | device next time when they get into proximity range, or until
|
1397 |
| - a timeout expires. At any time for there is at maximum two |
| 1398 | + a timeout expires. At any time there is at maximum two |
1398 | 1399 | <a>Web NFC message</a>s that can be set for sending for an <a>origin</a>:
|
1399 | 1400 | one targeted to <a>NFC tag</a>s and one to <a>NFC peer</a>s.
|
1400 | 1401 | When there is a <a>Web NFC message</a> set for sending
|
|
1470 | 1471 | <li>
|
1471 | 1472 | If the <var>options</var> parameter is undefined, then
|
1472 | 1473 | let <var>options</var> be a new <code><a>NFCPushOptions</a></code>
|
1473 |
| - object with the default values. |
| 1474 | + object with the default values. If any of the |
| 1475 | + <code><a>NFCPushOptions</a></code> properties are undefined, use |
| 1476 | + the default values. |
1474 | 1477 | </li>
|
1475 | 1478 | Otherwise, if the <var>options</var> parameter is defined and it is
|
1476 | 1479 | not a valid instance of <code><a>NFCPushOptions</a></code>, then
|
|
1480 | 1483 | <li>
|
1481 | 1484 | Let <var>output</var> be the notation for the <a>NDEF message</a>
|
1482 | 1485 | to be created by an API call to the underlying platform, based on
|
1483 |
| - data provided by these steps. |
| 1486 | + data provided by these steps. On any termination of this algorithm, |
| 1487 | + <var>output</var> MUST be cleared. |
1484 | 1488 | </li>
|
1485 | 1489 | <li>
|
1486 | 1490 | For each <a>NFCRecord</a> <var>record</var> in the sequence
|
|
1576 | 1580 | Add <var>web ndef</var> to <var>output</var>.
|
1577 | 1581 | </li>
|
1578 | 1582 | <li>
|
1579 |
| - Let <var>timer</var> be a new timer associated with this invocation |
1580 |
| - of <code>pushMessage()</code>. |
| 1583 | + If <var>options</var>.timeout value is not valid or not supported |
| 1584 | + in the underlying platform, reject <var>promise</var> with |
| 1585 | + <code>"SyntaxError"</code>, and abort these steps. |
| 1586 | + <li> |
| 1587 | + If <var>options</var>.timeout value is not <code>Infinity</code>, |
| 1588 | + let <var>timer</var> be a new timer associated with this invocation |
| 1589 | + of <code>pushMessage()</code>, set to <var>options</var>.timeout, |
| 1590 | + and start <var>timer</var>. On any termination of this algorithm, |
| 1591 | + <var>timer</var> MUST be cleared. |
1581 | 1592 | </li>
|
1582 | 1593 | <li>
|
1583 |
| - If <var>timer</var> expires, reject <var>promise</var> with |
1584 |
| - <code>"TimeoutError"</code> and abort these steps. |
| 1594 | + If <var>timer</var> exists and expires, reject <var>promise</var> |
| 1595 | + with <code>"TimeoutError"</code> and abort these steps. |
1585 | 1596 | </li>
|
1586 | 1597 | <li>
|
1587 | 1598 | When an <a>NFC device</a> comes within communication range,
|
|
0 commit comments