scripting apis for the web of thingsscripting apis for the web of things wot client api:...

15
April 2016 Louay Bassbouss | Fraunhofer FOKUS | [email protected] WWW2016 - W3C Track: Building and Designing the Web of Things, Montréal, Canada SCRIPTING APIS FOR THE WEB OF THINGS

Upload: others

Post on 22-May-2020

16 views

Category:

Documents


0 download

TRANSCRIPT

April 2016

Louay Bassbouss | Fraunhofer FOKUS | [email protected]

WWW2016 - W3C Track: Building and Designing the Web of Things, Montréal, Canada

SCRIPTING APIS FOR THE WEB OF THINGS

April 2016

2Scripting APIs for the Web of Things

MOTIVATION

App (consume)

API

Script (expose)

API

Script (expose)

API

COAP

BLE MQTTCOAP

MQTT

COAP HTTP

BLE

+

+

April 2016

3

WoT Client API− Discover Things

− Local− Remote

− Access Things− Read/Write

properties− Call actions− Observe events

− Consider Thing Descriptions

Scripting APIs for the Web of Things

FEATURES

App

WoT Client API

BLE MQTTCOAP

Script

MQTT COAP

Physical API

BLE

WoT Server API

Physical API

XXX

XXX

WoT Server API− Advertise Things

− Local− Remote

− Serve Clients− Handle read/ write

requests− Handle action calls− Trigger events

− Consider Thing Descriptions

Physical API− Provides access to physical objects

(sensors/actuators)− Knows how to control these objects

(also using proprietary protocols)

April 2016

4

− SHOULD expose interfaces to client applications that abstract from the underlying protocols (BLE, COAP, MQTT, …)

− SHOULD offer control interfaces that consider the semantic of Thing Descriptions (name of properties, actions, events, data types, …)

− SHOULD offer discovery interfaces with capability of filtering Things based on parameters like thing types, capabilities, …

− SHOULD consider Security and Privacy by design

− Providers of the WoT Client API implement bindings to one or more protocols.

− The API could directly talk to physical objects using corresponding protocols (e.g. BLE)

Scripting APIs for the Web of Things

WOT CLIENT API: REQUIREMENTS

App

Client APIBLE MQTTCOAP

Physical API

BLE

April 2016

5

− W3C already offers an API that follow the same principles à W3C Presentation API

− The Presentation API allows web applications to:− ... request display of web content on secondary screens (e.g. TVs, )− ... communicate with and control the web content− ... identify whether at least one secondary screen is available or not

− The web content may comprise HTML documents, web media types such as images, audio, video, or application-specific media

− Presentation API abstracts from underlying protocols for discovery and communication:− Chrome implementation uses Google Cast ()− Firefox implementation uses mDNS + WebRTC

− The specification includes security and privacy considerations

Scripting APIs for the Web of Things

SIMILAR W3C APIS

April 2016

6Scripting APIs for the Web of Things

W3C PRESENTATION API

Web Page/App

Presentation API

Web Page/App

Presentation API

Web Page/App

Presentation API

Google Cast

Miracast mdnsG. Cast

WebRTC

Miracast

mdnsWebRTC

G. Cast

Control Device Presentation Devices

April 2016

7

Goal is to define an API that enables web pages to use secondary screens to display web content

W3C PRESENTATION API

Primary Screen Second Screen

Control Page

Presentation Page

PresentationRequest(url).start() .then(function(session){…})

session.send session.onmessage

session.sendsession. onmessage

Scripting APIs for the Web of Things

April 2016

8

− The work of the Second Screen Presentation API is continued in a Working Group

− The Working Group was created in October 2014 à End date: 31 October 2016

− The WG took the final report of the CG as initial working draft for the Presentation API

− Working Draft: http://www.w3.org/TR/presentation-api/

W3C SECOND SCREEN PRESENTATION WG

Scripting APIs for the Web of Things

April 2016

9

http://w3c.github.io/wot/current-practices/wot-practices.html#sec-scripting-api

Scripting APIs for the Web of Things

WOT CLIENT API PROPOSAL

April 2016

10Scripting APIs for the Web of Things

WOT CLIENT API PROPOSAL

April 2016

11

http://w3c.github.io/wot/current-practices/wot-practices.html#scripting-api-examples

Scripting APIs for the Web of Things

WOT CLIENT API EXAMPLE

April 2016

12

Thing

Thing

Thing

− The Cordova plugin provides the WoT Client API− The Cordova plugin implements BLE protocol

binding− Implemented for iOS (Android work in progress)

− Implementation as Node.js module is planned

Scripting APIs for the Web of Things

IMPLEMENTATION AS CORDOVA PLUGIN

Cordova App

Underlying Implementation

Cordova Plugin

April 2016

13Scripting APIs for the Web of Things

DEMO

April 2016

14Scripting APIs for the Web of Things

THANK YOU

April 2016

Fraunhofer Institute for Open Communication Systems

Kaiserin-Augusta-Allee 3110589 Berlin, Germany

www.fokus.fraunhofer.de

Louay BassboussSenior Project Manager R&DFuture Applications and MediaTel. +49 (30) 34 63 – [email protected]

Fraunhofer Institute for Open Communication Systems FOKUSKaiserin-Augusta-Allee 31 10589 Berlin, Germany

Tel: +49 (30) 34 63 – 7000Fax: +49 (30) 34 63 – 8000www.fokus.fraunhofer.de

Contact