Using IoTivity

Caution
This document is obsolete. IoTivity is no longer supported in webOS OSE.

webOS IoT includes IoTivity and iotivity-node for developers to implement JS services that are needed to support IoT connectivity based on Open Connectivity Foundation (OCF) standard specification.

  • IoTivity: The open source reference implementation of the OCF standard specifications.
  • iotivity-node: The node module implemented as a native add-on using IoTivity to provide a JavaScript API for OCF functionality.

The platform adapter for webOS IoT enables IoTivity to interact with webOS connectivity components through webOS Bus system (Luna Bus). With the adapter, you can monitor connectivity status.

Using iotivity-node for JavaScript Service

You can develop Node.js-based JavaScript (JS) services communicating with the other OCF IoT devices by using the built-in iotivity-node module, as follows:

Using low-level interface
var iotivity = require("iotivity-node/lowlevel");
...
iotivity.OCInit(...);
...
Using high-level interface
var device = require("iotivity-node");
...
device.server.oncreate(...);
...

JS services provide access to platform features such as low-level networking, file system access, and binary data processing.

For details of JS service development for webOS IoT, refer the the following guide.

Contents