oic iotivity base framework
play

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


  1. OIC/IoTivity Base Framework Sashi Penta Senior Software Engineer

  2. IoTivity & OIC  Open Source  Open Standard

  3. OIC Architecture • Discovery and Connectivity • Interoperability • Security and Identification • Different device capabilities IP CoAP

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

  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

  6. OIC Resource Model • Client can access resources – Discovery – RESTful API • GET/PUT/POST/DELETE • OBSERVE • PRESENCE (Active Discovery)

  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.

  8. Proxy Resources / Plugins IoTivity Client IoTivity Server Hue Plugin

  9. Collection • OCBindResource Room Fan Light AC

  10. C Stack API (0.9 Release)

  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

  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); }

  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

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

  15. GET • OCDoResource – In • Method : GET • Query: “192.168.1.5:29389/a/light” • Payload: NULL • Callback Data: – Out • handle

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

  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

  18. OBSERVE • OCDoResource – In • Method : OBSERVE • Query: “ 192.168.1.5:29389/a/light ” • Payload: NULL • Callback Data: – Out • handle

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

  20. PRESENCE • OCDoResource – In • Method : PRESENCE • Query: “ 192.168.1.5/oc/presence ” • Payload: NULL • Callback Data: – Out • handle

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

  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

  23. C++ API • Richer API • Object Oriented Design • JSON Parsing • Multi threading

  24. OIC Resource Model • Server hosts resources – Entity • Actuator, Sensor – Entity Handler • Client accesses the resources – RESTful API – GET/PUT/PRESENCE/..

  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

  26. Thank you

  27. Back up slides

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

Recommend


More recommend