+ All Categories
Home > Documents > JavaScript for IoTivity · 2017-12-14 · OIC*Client OIC*Server* Request:*DISCOVER...

JavaScript for IoTivity · 2017-12-14 · OIC*Client OIC*Server* Request:*DISCOVER...

Date post: 22-May-2020
Category:
Upload: others
View: 2 times
Download: 0 times
Share this document with a friend
16
JavaScript for IoTivity Sakari Poussa, Intel @spoussa
Transcript

JavaScript for IoTivity Sakari Poussa, Intel

@spoussa

Topics

Vision

GW

Smart Devices

REST

REST

CoAP, MQTT, 6LowPAN, BLE

JavaScriptEngine(s)

Web Server

API Server

Resources Connectivity

HTML5 Apps

Storage

Cloud

JavaScript for Everything

Applica'on  developer  can  use  only  web  technologies  to  create  end-­‐to-­‐end  solu'ons.    Not  the  only  op'on  but  focus  of  this  talk.  

Gold  

Diamond  

Pla,num  

•  Specifications •  Data models •  Certification •  Marketing

•  Open Source implementation •  QA •  API bindings

No  JavaScript  

•  JavaScript API for OIC •  Web IDL specification •  Single API – Multiple Implementations •  All open source •  Travis, sample code, demos •  IoTivity 1.0

API Highlights

Promise findResources(); Events:

resourcefound

Promise<resource> register(data); Events:

retrieverequest updaterequest observerequest

Client   Server  

Promise retrieve(); Promise update(data); Promise observe(); Events:

update

Resource  

OIC  Client   OIC  Server  

Request:  DISCOVER  

Response:  URI,  Type,  ID  

Discovery

OIC  Client   OIC  Server  

Request:  RETRIEVE  

Response:  DATA  

Retrieve, Update

Request:  UPDATE  

Response:  OK  

Cloud

OIC and Cloud

REST API

CoAP over TCP

XMPP

Cloud

API    SERVER   REST   HTTP(S)  and  JSON  

OIC  Device  Network  (local)  

Remote Access with REST APIs

Sensor    (OIC  server)  

HTTP  GET  /oic/res  Request:  DISCOVER  

Response:  URI,  Type,  ID  {"href":"/a/light,"rt":"core.light","if":"oc.mi.def"}  

HTTP  200  OK  {"href":"/a/light,"rt":"core.light","if":"oc.mi.def"}  

HTTP  GET  /a/light  Request:  RETRIEVE  (/a/light)  

Response:  DATA  {"href":"/a/light","proper'es”:{”on":false}}  

HTTP  200  OK  {"href":"/a/light","proper'es":{”on":false}}  

HTTP  PUT  /a/light  {"href":"/a/light","proper'es":{”on":true}}  

Request  UPDATE  (/a/light)  {"href":"/a/light","proper'es":{”on":true}}  

Response:  OK    

HTTP  200  OK  

Discovery  

Read  

Update  

API  Server  (REST)   Cloud/Mobile  

REST API SERVER •  All JavaScript

•  Node.js, Express, and iotivity-node

•  Open source https://github.com/01org/iot-rest-api-server

•  RAML API documentation

•  Features

•  OIC discovery (/oic/res and /oic/d)

•  OIC RETRIEVE and UPDATE

•  Observing

Cloud

REST  API    SERVER  

Next Steps Security – Sandbox

Small devices – V8 is big

JS Engine API ?

Demo

Visit Intel Booth for Demo

Iotivity-node in Action

No Native Application Code

JavaScript, HTML, WebGL and CSS

Questions ?


Recommended