public interface IThing
Thing that may be an IoT sensor or an actuator. A Thing can be an actual or a virtual sensor.
To create and register Things, application must be authenticated and the related Node must be registered
before.Node,
ThingListener,
ThingType,
ThingData,
ThingDataType,
ThingConfiguration,
ThingManager| Modifier and Type | Method and Description |
|---|---|
android.hardware.Sensor |
getAndroidBuiltInSensor()
Get the wrapped
Sensor. |
boolean |
getIsActuator()
Gets
Thing's state which actuator or not. |
java.lang.String |
getNodeID()
Return NodeId thing belongs to
|
ThingCategory |
getThingCategory()
Get category of
Thing . |
ThingConfiguration |
getThingConfiguration()
Gets
Thing's configuration. |
android.content.Context |
getThingContext() |
ThingData |
getThingData()
Last data of
Thing object. |
java.lang.String |
getThingID()
Get
Thing's specified ID |
ThingListener |
getThingListener()
Return thing's listener object.
|
java.lang.String |
getThingName()
Get
Thing's human readable name. |
ThingType |
getThingType()
Get specified type of
ThingType . |
java.lang.String |
getUniqueID()
Get
Thing's unique ID |
boolean |
isConnected()
Get last connection info of
Thing. |
boolean |
isRegistered()
Checks
Thing object is registered or not. |
boolean |
register()
|
boolean |
sendData(ThingData data)
Send
ThingData to cloud. |
void |
setConnected(boolean connected,
java.lang.String description)
Set connection state of
Thing. |
void |
setIsActuator(boolean isActuator)
Sets
Thing object can/can't receive action message. |
void |
setThingCategory(ThingCategory thingCategory)
|
void |
setThingConfiguration(ThingConfiguration config)
Sets
ThingConfiguration of your Thing. |
void |
setThingContext(android.content.Context context)
Sets
Context of Thing. |
void |
setThingData(ThingData thingData)
Set or update
Thing |
void |
setThingID(java.lang.String thingID)
Set
Thing's ID. |
void |
setThingListener(ThingListener listener)
Sets
ThingListener for actuator and ThingConfiguration callbacks. |
void |
setThingName(java.lang.String thingName)
Set human readable name to specified
Thing. |
void |
setThingType(ThingType thingType)
|
void |
setUniqueID(java.lang.String uniqueID)
Set
Thing's uniqueID. |
boolean |
unregister()
|
java.lang.String getThingID()
Thing's specified IDvoid setThingID(java.lang.String thingID)
Thing's ID. Every node must has unique things.thingID - thingID of Thingvoid setUniqueID(java.lang.String uniqueID)
Thing's uniqueID. Every node must has unique Id.uniqueID - uniqueID of Thingjava.lang.String getThingName()
Thing's human readable name.void setThingName(java.lang.String thingName)
Thing.thingName - name of the thingThingData getThingData()
Thing object.void setThingData(ThingData thingData)
ThingthingData - : Specified ThingData of thing.data of the thingandroid.hardware.Sensor getAndroidBuiltInSensor()
Sensor. If you're not using built-in Sensor you can
ignore this function. NOTE: If you are not using Android Sensor this function returns NULL.Sensor object.ThingDatavoid setThingType(ThingType thingType)
thingType - type of the ThingThingTypeThingCategory getThingCategory()
ThingCategory object.ThingCategoryvoid setThingCategory(ThingCategory thingCategory)
thingCategory: - Can be ThingCategory.BUILTIN or ThingCategory.EXTERNALThingCategoryandroid.content.Context getThingContext()
Context of Thing object.void setThingContext(android.content.Context context)
Context of Thing.context - Context of the Applicationboolean getIsActuator()
Thing's state which actuator or not.true | false : Actuator state of Thing object.void setIsActuator(boolean isActuator)
ThingConfiguration getThingConfiguration()
Thing's configuration.ThingConfiguration : ThingConfiguration object.ThingConfigurationvoid setThingConfiguration(ThingConfiguration config)
ThingConfiguration of your Thing.config - : ThingConfiguration object which going to be set.ThingConfigurationThingListener getThingListener()
ThingListenervoid setThingListener(ThingListener listener)
ThingListener for actuator and ThingConfiguration callbacks.listener - : ThingListener object.ThingListenerjava.lang.String getNodeID()
Nodeboolean unregister()
true | false : Unregistration state of Thing.boolean isRegistered()
Thing object is registered or not.true | false : registration state of Thing.boolean sendData(ThingData data)
ThingData to cloud.data - data of the Thingtrue or false : send data operation state.boolean isConnected()
Thing.true or falsevoid setConnected(boolean connected,
java.lang.String description)
Thing.connected - : connection state.description - : connection state change description.