iOS Device Virtualization API Reference for Oracle Internet of Things Cloud Service Client Software Library, Release 21.1.1.0.0-3 E80002-19

The device and enterprise client libraries simplify working with the Oracle IoT Cloud Service. These client libraries are a higher–level abstraction over top of messages and REST APIs. Device clients are designed to make it easy to expose device functionality to the Oracle IoT Cloud Service, while enterprise clients are designed to make it easy to inspect and control a device. The true state of a device is within the device itself (whether the light is on or off). A virtual device object is contained within the cloud and enterprise clients that represent the last–known state of that device, and allow enterprise clients to send commands and set attributes of the device model (e.g., turn the light off).

Configuration

The client must have a runtime configuration in order to communicate with the cloud service. This runtime configuration includes the IoT Cloud Service host, the identifier of the device or enterprise integration the client represents, and the shared secret of the device or enterprise integration.

The configuration is created by the unified provisioner. It creates an encrypted file that is used when running the client application.

Device Models

A device model is a predefined specification of the attributes, actions, formats and resources of a device that can be accessed by the client library. The attributes of a device model represent the basic variables that the device supports, such as temperature, humidity, flow rate, valve position, and so forth. Actions are similar to attributes, but are invocable state rather than readable state. For example, reset. An action can can have zero or one arguments. The formats of a device model define the structure of a message payload. A format describes the message attributes by specifying the attribute names, types, optionality, and default values. The resources of a device model define additional, ad-hoc REST resources which provide richer REST support than what is possible with attributes and formats.

The client library has explicit API for obtaining a device model. See Client#getDeviceModel(deviceModelUrn: String)

Prerequisites

  • Register your device and/or enterprise application with the Cloud Service.
  • Provision the device with the credentials obtained from above.
  • Optionally provision the device model.