Device Class

Definition

The Device class extends the BaseDevice class implementing constructors and serialization functionality.

public class Device extends BaseDevice
Inheritance
java.lang.Object
Device

Inherited Members

Constructors

Device(String deviceId, DeviceStatus status, SymmetricKey symmetricKey)

Create an Device instance using the given device name

Fields

capabilities
status

"Enabled", "Disabled". If "Enabled", this device is authorized to connect. If "Disabled" this device cannot receive or send messages, and statusReason must be set.

statusReason

A 128 char long string storing the reason of suspension. (all UTF-8 chars allowed).

statusUpdatedTime

Datetime of last time the state was updated.

Methods

createDevice(String deviceId, AuthenticationType authenticationType)

Static create function Creates device object using the given name that will use a Certificate Authority signed certificate for authentication. If input device status is null then it will be auto generated.

createFromId(String deviceId, DeviceStatus status, SymmetricKey symmetricKey)

Static create function Creates device object using the given name. If input device status and symmetric key are null then they will be auto generated.

getCapabilities()

Getter for capabilities

getScope()

Get the security scope for this device

getStatus()

Getter for DeviceStatus object

getStatusReason()

Getter for status reason

getStatusUpdatedTime()

Getter for status updated time string

setCapabilities(DeviceCapabilities capabilities)

Setter for DeviceCapabilities object

setScope(String scope)

Set the security scope for this device

setStatus(DeviceStatus status)

Setter for DeviceStatus object

Applies to