You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
<code>ConsumedThing</code> represents a local proxy object of the remote <a>Thing</a>.
525
-
<ul>
526
-
<li>
527
-
The <dfn>name</dfn> read-only attribute represents the user given name of the <a>Thing</a>.
528
-
</li>
529
-
</ul>
530
522
</p>
531
523
532
-
<section><h3>The <dfn>setName()</dfn> method</h3>
533
-
<p>
534
-
Takes a <code>name</code> parameter and sets the name of the <a>Thing</a>, as used in applications. Applications can provide a maximum 128 bytes long name, but implementations may reject (by throwing a `RangeError`) or truncate the provided name, depending on the capabilities of the underlying platform. Setting <code>name</code> throws `TypeError` on other invalid (not string) input.
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>.
Adds a <a>Property</a> defined by the argument and updates the <a>Thing Description</a>. Throws on error. Returns a reference to the same object for supporting chaining.
Adds an <a>Action</a> to the <a>Thing</a> object as defined by the <code>action</code> argument of type <a>ThingActionInit</a> and updates the <a>Thing Description</a>. Throws on error. Returns a reference to the same object for supporting chaining.
723
+
Adds an <a>Action</a> to the <a>Thing</a> object as defined by the <code>action</code> argument of type <a>ThingAction</a> and updates the <a>Thing Description</a>. Throws on error. Returns a reference to the same object for supporting chaining.
The <a>ThingActionInit</a> dictionary describes the arguments and the return value.
735
+
The <a>ThingAction</a> dictionary describes the arguments and the return value.
785
736
<ul>
786
737
<li>The <dfn>name</dfn> attribute provides the <a>Action</a> name.</li>
787
738
<li>The <dfn>inputSchema</dfn> attribute provides the description of the input arguments (argument list is represented by an object). If missing, it means the action does not accept arguments.</li>
Adds an event to the <a>Thing</a> object as defined by the <code>event</code> argument of type <a>ThingEventInit</a> and updates the <a>Thing Description</a>. Throws on error. Returns a reference to the same object for supporting chaining.
753
+
Adds an event to the <a>Thing</a> object as defined by the <code>event</code> argument of type <a>ThingEvent</a> and updates the <a>Thing Description</a>. Throws on error. Returns a reference to the same object for supporting chaining.
<h2>Experimental extensions to the <strong>ConsumedThing</strong> interface</h2>
931
+
<p>
932
+
The <a>ThingDescription</a> related functionality, such as enumerating <a>Properties</a>, <a>Action</a>s, <a>Event</a>s and links (introspection) is an API extension that is out of scope for this specification. However, the draft interfaces are defined here for informative purposes.
Returns the list of <a>Properties</a> defined in the <a>Thing Description</a> of the <a>Thing</a> in the form of a list of <a>ThingProperty</a> objects.
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.
964
+
</p>
965
+
<sectiondata-dfn-for="TDLink" >
966
+
<h4>The <dfn>TDLink</dfn> dictionary</h4>
967
+
<p>
968
+
Contains a hyperlink reference, a relation type and a media type.
969
+
</p>
970
+
<preclass="idl">
971
+
dictionary TDLink {
972
+
required USVString href;
973
+
USVString mediaType;
974
+
DOMString rel;
975
+
};
976
+
</pre>
977
+
<p>The <a>TDLink</a> dictionary contains the following properties:
978
+
<ul>
979
+
<li>
980
+
The <dfn>href</dfn> attribute represents a <a>hyperlink reference</a>.
981
+
</li>
982
+
<li>
983
+
The <dfn>rel</dfn> attribute represents a <a>relation type</a>.
984
+
</li>
985
+
<li>
986
+
The <dfn>mediaType</dfn> attribute represents a <a>IANA media type</a>. For <a>TD</a>s there will be registered media types, so applications will be able to check whether an `href` link points to a <a>TD</a>, i.e. whether the link is fetcheable with this API.
0 commit comments