@@ -790,33 +790,36 @@
Validating an ExposedThingInit
790
790
Set |discovery|.{{ThingDiscoveryProcess/[[filter]]}} to |filter:ThingFilter|.
791
791
li >
792
792
< li >
793
- Request the underlying platform to start the directory discovery process.
794
793
< p class ="note ">
795
- This is a placeholder for more details in the discovery algorithm.
796
- Implementations should follow the procedures described in the
797
- [[WOT-DISCOVERY]] and [WOT-PROTOCOL-BINDINGS] specifications.
798
- Some normative steps are indicated below.
794
+ The following steps of the algorithm are currently Work in Progress.
799
795
p >
800
- < ol >
801
- < li >
802
- If |url| is not a < a > TD Directorya > or if the underlying
803
- implementation cannot support the < a > Protocol Bindinga >
804
- indicated by |url|, [=reject=] |promise|
805
- with {{NotSupportedError}} and terminate these steps.
806
- li >
807
- < li >
808
- If filters in general are not supported by the implementation and
809
- |filter| is not `undefined` or `null`, [=reject=] |promise|
810
- with {{NotSupportedError}} and stop.
811
- li >
812
- < li >
813
- Run the < a > discovery processa > given |discovery|.
814
- < p class ="note ">
815
- From this point on, errors are recorded only on
816
- {{ThingDiscoveryProcess/error}}, but don't affect |promise| any longer.
817
- p >
818
- li >
819
- ol >
796
+
797
+ If the underlying implementation cannot support the
798
+ < a > Protocol Bindinga > indicated by |url|, [=reject=] |promise| with
799
+ {{NotSupportedError}} and stop.
800
+ li >
801
+ < li >
802
+ Request the underlying platform to retrieve the TD available under
803
+ |discovery|.{{ThingDiscoveryProcess/[[url]]}}.
804
+ If that does not return a valid TDD Thing Description, [=reject=]
805
+ |promise| with {{TypeError}} and stop.
806
+
807
+ Otherwise, let |directoryTd| be the retrieved TD.
808
+ li >
809
+ < li >
810
+ Let |consumedTddThing| be the result of
811
+ < a href ="#creating-consumedthing "> creating a < dfn > ConsumedThingdfn > a >
812
+ from |directoryTd|.
813
+ If that fails, resolve |promise| with {{SyntaxError}} and stop.
814
+ li >
815
+ < li >
816
+ Run the < a > discovery processa > given |discovery| by
817
+ either invoking one of the actions associated with the Search API
818
+ – if the {{ThingDiscoveryProcess/[[filter]]}} argument is not
819
+ `undefined` or `null` – or reading the `things` property.
820
+ li >
821
+ < li >
822
+
820
823
li >
821
824
< li >
822
825
[=Resolve=] |promise| with |discovery|.
0 commit comments