new DirectlyConnectedDevice(taStoreFileopt, taStorePasswordopt, gatewayopt)
The directly-connected device is able to activate itself using the direct activation capability. The data required for activation and authentication is retrieved from a TrustedAssetsStore generated using the TrustedAssetsProvisioner tool using the Default TrustedAssetsManager.
This object represents the Virtualization API (high-level API) for the directly-connected device and uses the MessageDispatcher for sending/receiving messages. Also it implements the message dispatcher, diagnostics and connectivity test capabilities. Also it can be used for creating virtual 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. |
gateway |
boolean |
<optional> |
true to indicate creation of a GatewayDevice
representation. |
- See:
-
iotcs.device.util.MessageDispatcher
Extends
Methods
(static) activate(deviceModelUrns, callback)
If the device is already activated, this method will throw an exception. The user should call the isActivated() method prior to calling activate.
Parameters:
Name | Type | Description |
---|---|---|
deviceModelUrns |
Array.<string> | An array of deviceModel URNs implemented by this directly connected device. |
callback |
function | The callback function. This function is called with this object
but in the activated state. If the activation is not successful then the object will
be null and an error object is passed in the form callback(device, error)
and the reason can be taken from error.message. |
(static) close()
(static) createVirtualDevice(endpointId, deviceModel) → {iotcs.device.VirtualDevice}
A device model can be obtained by it's afferent URN with the DirectlyConnectedDevice if it is registered on the cloud.
Parameters:
Name | Type | Description |
---|---|---|
endpointId |
string | The endpoint identifier of the device being modeled. |
deviceModel |
object | The device model object holding the full description of that device model that this device implements. |
Returns:
(static) getEndpointId() → {string}
Returns:
- Type
- string
(static) isActivated() → {boolean}
Returns:
true
if the device is activated.
- Type
- boolean