public class Device extends BaseDevice
| Modifier and Type | Field and Description |
|---|---|
protected com.microsoft.azure.sdk.iot.deps.twin.DeviceCapabilities |
capabilities |
protected DeviceStatus |
status
"Enabled", "Disabled".
|
protected String |
statusReason
A 128 char long string storing the reason of suspension.
|
protected String |
statusUpdatedTime
Datetime of last time the state was updated.
|
cloudToDeviceMessageCount, connectionState, connectionStateUpdatedTime, deviceId, eTag, generationId, lastActivityTime, OFFSET_TIME_DEFAULT, UTC_TIME_DEFAULT| Modifier | Constructor and Description |
|---|---|
protected |
Device(String deviceId,
DeviceStatus status,
SymmetricKey symmetricKey)
Create an Device instance using the given device name
|
| Modifier and Type | Method and Description |
|---|---|
static Device |
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.
|
static Device |
createFromId(String deviceId,
DeviceStatus status,
SymmetricKey symmetricKey)
Static create function
Creates device object using the given name.
|
com.microsoft.azure.sdk.iot.deps.twin.DeviceCapabilities |
getCapabilities()
Getter for capabilities
|
DeviceStatus |
getStatus()
Getter for DeviceStatus object
|
String |
getStatusReason()
Getter for status reason
|
String |
getStatusUpdatedTime()
Getter for status updated time string
|
void |
setCapabilities(com.microsoft.azure.sdk.iot.deps.twin.DeviceCapabilities capabilities)
Setter for DeviceCapabilities object
|
void |
setStatus(DeviceStatus status)
Setter for DeviceStatus object
|
getAuthenticationType, getCloudToDeviceMessageCount, getConnectionState, getConnectionStateUpdatedTime, getDeviceId, geteTag, getGenerationId, getLastActivityTime, getPrimaryKey, getPrimaryThumbprint, getSecondaryKey, getSecondaryThumbprint, getSymmetricKey, setForceUpdate, setSymmetricKey, setThumbprintprotected DeviceStatus status
protected String statusReason
protected String statusUpdatedTime
protected com.microsoft.azure.sdk.iot.deps.twin.DeviceCapabilities capabilities
protected Device(String deviceId, DeviceStatus status, SymmetricKey symmetricKey) throws IllegalArgumentException
deviceId - Name of the device (used as device id)status - - Device status. If parameter is null, then the status will be set to Enabled.symmetricKey - - Device key. If parameter is null, then the key will be auto generated.IllegalArgumentException - This exception is thrown if the encryption method is not supported by the keyGeneratorpublic static Device createFromId(String deviceId, DeviceStatus status, SymmetricKey symmetricKey) throws IllegalArgumentException
deviceId - - String containing the device namestatus - - Device status. If parameter is null, then the status will be set to Enabled.symmetricKey - - Device key. If parameter is null, then the key will be auto generated.IllegalArgumentException - This exception is thrown if deviceId is null or empty.public static Device createDevice(String deviceId, AuthenticationType authenticationType)
deviceId - - String containing the device nameauthenticationType - - The type of authentication used by this device.IllegalArgumentException - This exception is thrown if deviceId is null or empty.public DeviceStatus getStatus()
public void setStatus(DeviceStatus status)
status - status to be setpublic String getStatusReason()
public String getStatusUpdatedTime()
public com.microsoft.azure.sdk.iot.deps.twin.DeviceCapabilities getCapabilities()
public void setCapabilities(com.microsoft.azure.sdk.iot.deps.twin.DeviceCapabilities capabilities)
capabilities - capabilities to be setCopyright © 2018. All rights reserved.