Skip to content

Commit a76fbca

Browse files
committed
Add support for TD links. Fix schema examples.
Signed-off-by: Zoltan Kis <[email protected]>
1 parent c67f89e commit a76fbca

File tree

1 file changed

+44
-3
lines changed

1 file changed

+44
-3
lines changed

index.html

Lines changed: 44 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,8 @@
173173
<li>Invoke an <a>Action</a>.</li>
174174
<li>Observe <a>Events</a> emitted by the <a>Thing</a>.</li>
175175
<li>Observe changes to the <a>Thing Description</a> of the <a>Thing</a>.</li>
176+
<li>Get the <a>Thing Description</a>.</li>
177+
<li>Get the list of linked resources based on the <a>Thing Description</a>.</li>
176178
</ul>
177179
</li>
178180
</ul>
@@ -509,6 +511,7 @@ <h2>The <dfn>ConsumedThing</dfn> interface</h2>
509511
readonly attribute DOMString name;
510512
void setName(DOMString name);
511513
ThingDescription getThingDescription();
514+
sequence&lt;TDLink&gt; getLinks();
512515
Promise&lt;any&gt; invokeAction(DOMString name, any parameters);
513516
Promise&lt;void&gt; writeProperty(DOMString name, any value);
514517
Promise&lt;any&gt; readProperty(DOMString name);
@@ -541,6 +544,41 @@ <h2>The <dfn>ConsumedThing</dfn> interface</h2>
541544
</p>
542545
</section>
543546

547+
<section> <h3>The <dfn>getLinks()</dfn> method</h3>
548+
<p>
549+
Returns the list of linked resources in <a>Thing Description</a> of the <a>Thing</a> in the form of a list of <a>TDLink</a> objects.
550+
</p>
551+
<section data-dfn-for="TDLink" >
552+
<h4>The <dfn>TDLink</dfn> dictionary</h4>
553+
<p>
554+
Contains a hyperlink reference, a relation type and a media type.
555+
</p>
556+
<pre class="idl">
557+
dictionary TDLink {
558+
required USVString href;
559+
USVString mediaType;
560+
DOMString rel;
561+
};
562+
</pre>
563+
<p>The <a>TDLink</a> dictionary contains the following properties:
564+
<ul>
565+
<li>
566+
The <dfn>href</dfn> attribute represents a <a>hyperlink reference</a>.
567+
</li>
568+
<li>
569+
The <dfn>rel</dfn> attribute represents a <a>relation type</a>.
570+
</li>
571+
<li>
572+
The <dfn>mediaType</dfn> attribute represents a <a>IANA media type</a>.
573+
</li>
574+
</ul>
575+
</p>
576+
</section> <!-- TDLink -->
577+
</section>
578+
579+
580+
581+
544582
<section> <h3>The <dfn>invokeAction()</dfn> method</h3>
545583
<p>
546584
Takes the <a>Action</a> name from the <var>name</var> argument and the list of parameters, then requests from the underlying platform and the <a>Protocol Bindings</a> to invoke the <a>Action</a> on the remote <a>Thing</a> and return the result. Returns a <code><a>Promise</a></code> that resolves with the return value or rejects with an <a>Error</a>.
@@ -685,7 +723,7 @@ <h4>The <dfn>DataSchema</dfn> type</h4>
685723
The <a>DataSchema</a> type represents a data type <a href="https://w3c.github.io/wot-thing-description/#dataschema">specified</a> in the <a>Thing Description</a> in a serialized form.
686724
</p>
687725
<p class="ednote">
688-
<a>DataSchema</a> is under development, currently it can denote any type supported by the <a>Thing Description</a> and the <a>WoT Runtime</a>, such as simple type like <code>"boolean"</code>, <code>"number"</code>, <code>"string"</code>, or <code>"array"</code>, or <code>"object"</code> that may specify value range etc.
726+
<a>DataSchema</a> is under development, currently it can denote any type supported by the <a>Thing Description</a> and the <a>WoT Runtime</a>.
689727
</p>
690728
</section>
691729

@@ -854,13 +892,13 @@ <h2>Examples</h2>
854892
thing.addProperty({
855893
name: "temperature",
856894
value: "0",
857-
schema: "number",
895+
schema: '{ \"type\": \"number\" }',
858896
writable: false
859897
// use default values for the rest
860898
});
861899
thing.addEvent({
862900
name: "onchange",
863-
schema: "number"
901+
schema: '{ \"type\": \"number\" }'
864902
});
865903
thing.addAction({
866904
name: "reset",
@@ -1125,6 +1163,9 @@ <h3>The <dfn data-dfn-for="">Observable</dfn> interface</h3>
11251163
<dfn>IANA media type</dfn>s (formerly known as MIME types) are defined in
11261164
<a href="http://tools.ietf.org/html/rfc2046">RFC2046</a>.
11271165
</p>
1166+
<p>
1167+
The terms <dfn>hyperlink reference</dfn> and <dfn>relation type</dfn> are defined in [[!HTML5]] and <a href="https://tools.ietf.org/html/rfc8288">RFC8288</a>.
1168+
</p>
11281169
</section>
11291170

11301171
<section id="conformance">

0 commit comments

Comments
 (0)