|
256 | 256 | <p>
|
257 | 257 | The following scripting use cases are covered in this specification:
|
258 | 258 | <ul>
|
| 259 | + <li>Discover all <a>Things</a> in the WoT network by sending a broadcast request.</li> |
| 260 | + <li>Discover <a>Things</a> running in the local <a>WoT Runtime</a>.</li> |
| 261 | + <li>Discover nearby <a>Things</a>, for instance by NFC or Bluetooth.</li> |
| 262 | + <li>Discover <a>Things</a> by sending a discovery request to a given registry.</li> |
259 | 263 | <li>Discover <a>Thing</a>s by filters defined on <a>Thing Description</a>s</li>
|
260 |
| - <li>Discover <a>Thing</a>s by semantic filters</li> |
| 264 | + <li>Discover <a>Thing</a>s by semantic filters.</li> |
| 265 | + <li>Stop or suppress an ongoing discovery process.</li> |
261 | 266 | <li>Fetch and <a>consume a TD</a> of a remote <a>Thing</a>.</li>
|
262 | 267 | <li>On a consumed <a>Thing</a>,
|
263 | 268 | <ul>
|
|
269 | 274 | <ul>
|
270 | 275 | <li>Add a listener to an event.</li>
|
271 | 276 | <li>Remove a listener from an event.</li>
|
| 277 | + <li>Remove all listeners.</li> |
272 | 278 | </ul>
|
273 | 279 | Default events are the following:
|
274 | 280 | <ul>
|
275 | 281 | <li>A property has changed.</li>
|
276 | 282 | <li>An action has been invoked.</li>
|
277 |
| - <li>Other Things have added an event listener.</li> |
278 | 283 | <li><a>Thing Description</a> has changed, i.e. properties, events or actions have been defined, removed, or the definition has changed.</li>
|
279 | 284 | </ul>
|
280 | 285 | </li>
|
281 | 286 | </ul>
|
282 | 287 | </li>
|
283 |
| - <li>Retrieve a thing that is exposed by the local runtime</li> |
| 288 | + <li>Retrieve a thing.</li> |
284 | 289 | <li>Create and expose a local <a>Thing</a> based on a <a>Thing Description</a>.</li>
|
285 | 290 | <li>Programmatically create and expose a local <a>Thing</a>. This may include the following use cases:
|
286 | 291 | <ul>
|
|
294 | 299 | <li>Emit an event, i.e. notify all listeners subscribed to that event.</li>
|
295 | 300 | <li>Register handlers for external requests:
|
296 | 301 | <ul>
|
297 |
| - <li>to fetch the <a>Thing Description</a>;</li> |
| 302 | + <li>to retrieve a property value;</li> |
| 303 | + <li>to update a property value;</li> |
298 | 304 | <li>to run an action: take the parameters from the request, execute the defined action, and return the result;</li>
|
299 | 305 | <li>to add a listener to an event;</li>
|
300 | 306 | <li>to remove an event listener.</li>
|
| 307 | + <li>to fetch the <a>Thing Description</a>;</li> |
301 | 308 | </ul>
|
302 | 309 | </li>
|
303 |
| - <li>Register handler for semantic translation of property values.</li> |
304 |
| - <li>Register the Thing.</li> |
305 |
| - <li>Unregister the Thing.</li> |
306 |
| - <li>Start the exposed <a>Thing</a> in order to process external requests.</li> |
307 |
| - <li>Stop the exposed <a>Thing</a>. |
308 | 310 | </ul>
|
309 | 311 | </li>
|
| 312 | + <li>Register the Thing.</li> |
| 313 | + <li>Unregister the Thing.</li> |
| 314 | + <li>Start the exposed <a>Thing</a> in order to process external requests.</li> |
| 315 | + <li>Stop the exposed <a>Thing</a>.</li> |
| 316 | + </ul> |
| 317 | + </p> |
| 318 | + <p> |
| 319 | + The following use cases are being considered for next versions: |
| 320 | + <ul> |
| 321 | + <li>Add, remove and update the definition of a property on a Thing that runs in the same the WoT Runtime.</li> |
| 322 | + <li>Add, remove and update the definition of an action on a Thing that runs in the same the WoT Runtime.</li> |
| 323 | + <li>Add, remove and update the definition of an event on a Thing that runs in the same the WoT Runtime.</li> |
310 | 324 | </ul>
|
311 | 325 | </p>
|
312 | 326 | </section>
|
|
342 | 356 | };
|
343 | 357 |
|
344 | 358 | // TBD: if extensible by applications
|
345 |
| - enum DiscoveryType { "any", "local", "nearby", "directory", "broadcast" }; |
| 359 | + enum DiscoveryType { "any", "local", "nearby", "directory", "broadcast", "other" }; |
346 | 360 |
|
347 | 361 | dictionary ThingFilter: ThingInit {
|
348 | 362 | DiscoveryType type = "any";
|
|
382 | 396 | ExposedThing addEvent(ThingEventInit event);
|
383 | 397 | ExposedThing removeEvent(DOMString name);
|
384 | 398 |
|
385 |
| - ExposedThing addSemanticTranslator(SemanticTranslator handler); |
386 |
| - |
387 | 399 | Promise<void> register(optional USVString directory);
|
388 | 400 | Promise<void> unregister();
|
389 | 401 |
|
|
393 | 405 | Promise<void> emitEvent(DOMString eventName, any payload);
|
394 | 406 |
|
395 | 407 | // define request handlers (one per request type, so no events here)
|
396 |
| - // TBD: ExposedThing onAddProperty(PropertyRequestHandler handler); |
397 |
| - // TBD: ExposedThing onRemoveProperty(PropertyRequestHandler handler); |
398 | 408 |
|
399 | 409 | ExposedThing onRetrieveProperty(PropertyRequestHandler handler);
|
400 | 410 | ExposedThing onUpdateProperty(PropertyRequestHandler handler);
|
|
409 | 419 | callback PropertyRequestHandler = void (PropertyRequest request);
|
410 | 420 | callback ActionRequestHandler = void (ActionRequest request);
|
411 | 421 | callback ObserveRequestHandler = void (ObserveRequest request);
|
412 |
| - callback SemanticTranslator = any (DOMString propertyName, SemanticType type); |
413 | 422 |
|
414 | 423 | dictionary PropertyRequest {
|
415 | 424 | USVString from;
|
416 | 425 | ThingPropertyInit property;
|
| 426 | + Dictionary options; |
417 | 427 | };
|
418 | 428 |
|
419 | 429 | dictionary ActionRequest {
|
|
430 | 440 |
|
431 | 441 | enum ObserveType { "property", "action", "event", "td" };
|
432 | 442 |
|
433 |
| - dictionary SemanticType { |
| 443 | + dictionary SemanticType { // TBD what is the use case? |
434 | 444 | DOMString name;
|
435 | 445 | DOMString context;
|
436 | 446 | };
|
|
0 commit comments