Sequenceablepublic class DeviceInfo extends Object implements Sequenceable
| 限定符和类型 | 类 | 说明 |
|---|---|---|
static class |
DeviceInfo.DeviceState |
Enumerates online and offline states of a device on the distributed network.
|
static class |
DeviceInfo.DeviceType |
Enumerates types of a device on the distributed network.
|
Sequenceable.Producer<T>| 限定符和类型 | 字段 | 说明 |
|---|---|---|
static int |
FLAG_GET_ALL_DEVICE |
Queries information about all online and offline devices (excluding the local device)
on the distributed network.
|
static int |
FLAG_GET_OFFLINE_DEVICE |
Queries information about all offline devices (excluding the local device)
on the distributed network.
|
static int |
FLAG_GET_ONLINE_DEVICE |
Queries information about all online devices (excluding the local device)
on the distributed network.
|
| 构造器 | 说明 |
|---|---|
DeviceInfo() |
Default constructor used to create a
DeviceInfo instance with an offline device of an unknown type. |
| 限定符和类型 | 方法 | 说明 |
|---|---|---|
String |
getDeviceId() |
Obtains the network ID of this device.
|
String |
getDeviceName() |
Obtains the name of this device.
|
DeviceInfo.DeviceState |
getDeviceState() |
Obtains the state of this device.
|
DeviceInfo.DeviceType |
getDeviceType() |
Obtains the type of this device.
|
boolean |
isDeviceOnline() |
Checks whether this device is online.
|
boolean |
marshalling(Parcel out) |
Marshals this
Sequenceable object into a Parcel. |
void |
setDeviceInfo(String deviceId,
String deviceName) |
Sets the network ID and device name for this device.
|
void |
setDeviceState(DeviceInfo.DeviceState deviceState) |
Sets the state for this device.
|
void |
setDeviceType(DeviceInfo.DeviceType deviceType) |
Sets the device type for this device.
|
boolean |
unmarshalling(Parcel in) |
Unmarshals this
Sequenceable object from a Parcel. |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waithasFileDescriptorpublic static final int FLAG_GET_ALL_DEVICE
DeviceManager#getDeviceList(int).public static final int FLAG_GET_OFFLINE_DEVICE
DeviceManager#getDeviceList(int).public static final int FLAG_GET_ONLINE_DEVICE
DeviceManager#getDeviceList(int).public DeviceInfo()
DeviceInfo instance with an offline device of an unknown type.public void setDeviceInfo(String deviceId, String deviceName)
deviceId - Indicates the network ID to set.deviceName - Indicates the device name to set.public void setDeviceType(DeviceInfo.DeviceType deviceType)
deviceType - Indicates the device type to set. For details about available values, see DeviceType.public void setDeviceState(DeviceInfo.DeviceState deviceState)
deviceState - Indicates the device state to set. For details about available values,
see DeviceState.public String getDeviceId()
setDeviceInfo(java.lang.String,java.lang.String).public String getDeviceName()
setDeviceInfo(java.lang.String,java.lang.String).public DeviceInfo.DeviceType getDeviceType()
setDeviceType(ohos.distributedschedule.interwork.DeviceInfo.DeviceType).public DeviceInfo.DeviceState getDeviceState()
setDeviceState(ohos.distributedschedule.interwork.DeviceInfo.DeviceState).DeviceState.public boolean isDeviceOnline()
true if this device is online; returns false otherwise.public boolean marshalling(Parcel out)
SequenceableSequenceable object into a Parcel.marshalling 在接口中 Sequenceableout - Indicates the Parcel object to which the Sequenceable
object will be marshaled..true if the marshalling is successful; returns false otherwise.public boolean unmarshalling(Parcel in)
SequenceableSequenceable object from a Parcel.unmarshalling 在接口中 Sequenceablein - Indicates the Parcel object into which the Sequenceable
object has been marshaled.true if the unmarshalling is successful; returns false otherwise.