OIC/IoTivity Base Framework Sashi Penta Senior Software Engineer - - PowerPoint PPT Presentation

oic iotivity base framework
SMART_READER_LITE
LIVE PREVIEW

OIC/IoTivity Base Framework Sashi Penta Senior Software Engineer - - PowerPoint PPT Presentation

OIC/IoTivity Base Framework Sashi Penta Senior Software Engineer IoTivity & OIC Open Source Open Standard OIC Architecture Discovery and Connectivity Interoperability Security and Identification Different device


slide-1
SLIDE 1

OIC/IoTivity Base Framework

Sashi Penta Senior Software Engineer

slide-2
SLIDE 2

IoTivity & OIC

 Open Source  Open Standard

slide-3
SLIDE 3

OIC Architecture

  • Discovery and Connectivity
  • Interoperability
  • Security and Identification
  • Different device capabilities

IP CoAP

slide-4
SLIDE 4

IoTivity Structure

iotivity/ ├── android ├── service │ ├── notification-manager │ ├── protocol-plugin │ │ ├── plugin-manager │ │ ├── plugins │ ├── soft-sensor-manager │ └── things-manager iotivity/ ├── resource │ ├── csdk │ │ ├── connectivity │ │ ├── security │ │ └── stack │ │ ├── include │ │ ├── samples │ │ │ ├── arduino │ │ │ └── linux │ │ ├── src │ │ └── test │ ├── src │ ├── include │ ├── examples │ └── unittests

slide-5
SLIDE 5

OIC Resource Model

  • Server hosts resources

– Entity

  • Light bulb, Actuator, Sensor
  • Plugin – to operate non OIC devices

– Entity Handler – Resource Attribute

  • State, Color, Brightness

– Resource Interface – Resource Type – Resource Property

slide-6
SLIDE 6

OIC Resource Model

  • Client can access resources

– Discovery – RESTful API

  • GET/PUT/POST/DELETE
  • OBSERVE
  • PRESENCE (Active Discovery)
slide-7
SLIDE 7

Modes

  • SERVER

– Provides resource state information. – Allows remote control of its resources.

  • CLIENT

– Accesses a resource provided by an OIC Server.

  • BOTH

– Acts both like both Server and Client.

slide-8
SLIDE 8

Proxy Resources / Plugins

IoTivity Server IoTivity Client Hue Plugin

slide-9
SLIDE 9

Collection

  • OCBindResource

Room Fan Light AC

slide-10
SLIDE 10

C Stack API (0.9 Release)

slide-11
SLIDE 11

Create Resource

  • OCCreateResource

– In

  • Resource Type : “core.light”
  • Resource Interface : “def”
  • Resource URI : “/a/light”
  • Entity handler (like callback)
  • ResourceProperties: OC_DISCOVERABLE | OC_OBSERVABLE

– Out

  • Resource handle
slide-12
SLIDE 12

Entity Handler

Function that handles the client requests EntityHandler() { if(method == GET) { // Process Get Request & prepare response } else if(method == PUT) { // Process Put Request & prepare response } . . . OCDoResponse(response); }

slide-13
SLIDE 13

Discover Resources

  • OCDoResource

– In

  • Method : GET
  • Query:

– “/oc/core” <- Search on all adapters & Multicast search for IP – “192.168.1.36:port/oc/core” <- Unicast

  • Payload: NULL
  • Callback Data:

– Out

  • handle
slide-14
SLIDE 14

DISCOVERY Flow

Client App Client Stack Server Stack Server App OCCreateResource OCDoResource Discovery Response Callback provided in OCDoResource will be called with the response GET “/oc/core”

slide-15
SLIDE 15

GET

  • OCDoResource

– In

  • Method : GET
  • Query: “192.168.1.5:29389/a/light”
  • Payload: NULL
  • Callback Data:

– Out

  • handle
slide-16
SLIDE 16

GET Flow

Client App Client Stack Server Stack Server App OCCreateResource OCDoResource GET Response CallBack Entity Handler OCDoResponse GET “/a/light”

slide-17
SLIDE 17

PUT

  • OCDoResource

– In

  • Method : PUT
  • Query: “192.168.1.5:29389/a/light”
  • Payload: {"oc":[{"rep":{“bri":100,"state":true}}]}
  • Callback Data:

– Out

  • handle
slide-18
SLIDE 18

OBSERVE

  • OCDoResource

– In

  • Method : OBSERVE
  • Query: “192.168.1.5:29389/a/light”
  • Payload: NULL
  • Callback Data:

– Out

  • handle
slide-19
SLIDE 19

OBSERVE Flow

Client App Client Stack Server Stack Server App OCNotify*Observers OCDoResource Observe Response Callback OBSERVE “/a/light” Entity Handler GET with Obs Flag

slide-20
SLIDE 20

PRESENCE

  • OCDoResource

– In

  • Method : PRESENCE
  • Query: “192.168.1.5/oc/presence”
  • Payload: NULL
  • Callback Data:

– Out

  • handle
slide-21
SLIDE 21

PRESENCE Flow

Client App Client Stack Server Stack Server App OCCreateResource OCDoResource Presence Notification Callback PRESENCE “/oc/presence” OCStartPresence Presence Notification

slide-22
SLIDE 22

Observe Vs Presence

  • Observe:

– At Resource level – Server Application decides when to send the observe notification

  • E.g. Temperature change in the room.
  • Presence:

– At Device / Server level – Stack sends the notification (Although application triggers) – Any kind of resources changes

slide-23
SLIDE 23

C++ API

  • Richer API
  • Object Oriented Design
  • JSON Parsing
  • Multi threading
slide-24
SLIDE 24

OIC Resource Model

  • Server hosts resources

– Entity

  • Actuator, Sensor

– Entity Handler

  • Client accesses the resources

– RESTful API – GET/PUT/PRESENCE/..

slide-25
SLIDE 25

References

  • http://openinterconnect.org/
  • https://www.iotivity.org/
  • iotivity-dev@lists.iotivity.org
  • http://www.intel.com/content/www/us/en/in

ternet-of-things/overview.html

slide-26
SLIDE 26

Thank you

slide-27
SLIDE 27

Back up slides

slide-28
SLIDE 28

C++ : Flow

C++ Client Stack Client Stack Server Stack C++ Server Stack OCCreateResource OCDoResource GET Response Call Back Wrapper Entity Handler Wrapper OCDoResponse GET “/a/light” C++ Server App C++ Client App findResource registerResource Call Back Entity Handler sendResponse