new GatewayDevice(taStoreFileopt, taStorePasswordopt)
This represents a GatewayDevice in the Virtualization API. It has the exact same specifications
and capabilities as a directly connected device from the Virtualization API and additionally it
has the capability to register indirectly connected devices.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
taStoreFile |
string |
<optional> |
The trusted assets store file path to be used for trusted assets manager creation. This is optional. If none is given the default global library parameter is used: iotcs.oracle.iot.tam.store. |
taStorePassword |
string |
<optional> |
The trusted assets store file password to be used for trusted assets manager creation. This is optional. If none is given the default global library parameter is used: iotcs.oracle.iot.tam.storePassword. |
Extends
Classes
Methods
(static) registerDevice(restrictedopt, hardwareIdnon-null, metaData, deviceModelUrns, callback)
Register an indirectly-connected device with the cloud service and specify whether the gateway
device is required to have the appropriate credentials for activating the indirectly-connected
device.
The
restricted
parameter controls whether or not the client library is
required to supply credentials for activating the indirectly-connected device. The
client library will always supply credentials for an indirectly-connected device
whose trusted assets have been provisioned to the client. If, however, the trusted assets of
the * indirectly-connected device have not been provisioned to the client, the client library
can create credentials that attempt to restrict the indirectly connected device to this
gateway device.
The restricted
parameter could be omitted. This is the equivalent of calling
iotcs.device.util.GatewayDevice.registerDevice(false, hardwareId, metaData,
deviceModels, callback)
.
Pass true
for the restricted
parameter to ensure the
indirectly-connected device cannot be activated by this gateway device without presenting
credentials. If restricted
is true
, the client library will
provide credentials to the server. The server will reject the activation request if the
indirectly * connected device is not allowed to roam to this gateway device.
Pass false
to allow the indirectly-connected device to be activated without
presenting credentials if the trusted assets of the indirectly-connected device have not been
provisioned to the client. If restricted
is false
, the client
library * will provide credentials if, and only if, the credentials have been provisioned to
the client. The server will reject the activation if credentials are required but not
supplied, or if the provisioned credentials do not allow the indirectly connected device to
roam to this gateway * device.
The hardwareId
is a unique identifier within the cloud service instance and may
not be null
. If one is not present for the device, it should be generated based
on other metadata such as: model, manufacturer, serial number, etc.
The metaData
Object should typically contain all the standard metadata (the
constants documented in this class) along with any other vendor defined metadata.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
restricted |
boolean |
<optional> |
true if the client library is required
to supply credentials for activating the indirectly-connected device. |
hardwareId |
string | An identifier unique within the Cloud Service instance. | |
metaData |
object | The metadata of the device. | |
deviceModelUrns |
Array.<string> | An array of device model URNs supported by the indirectly connected device. | |
callback |
function | The callback function. This function is called with the
following argument: the endpoint ID of the indirectly-connected device is the
registration was successful or null and an error object as the second
parameter: callback(id, error). The reason can be retrieved from error.message and it
represents the actual response from the server or any other network or framework error
that can appear. |