com.google.android.things.iotcore
Class TelemetryEvent
- java.lang.Object
-
- com.google.android.things.iotcore.TelemetryEvent
-
public class TelemetryEvent extends Object
Represents a telemetry event to publish to Cloud IoT Core.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class and Description static interface
TelemetryEvent.Qos
Quality of service options.
-
Field Summary
Fields Modifier and Type Field and Description static int
QOS_AT_LEAST_ONCE
At least once delivery.static int
QOS_AT_MOST_ONCE
At most once delivery.
-
Constructor Summary
Constructors Constructor and Description TelemetryEvent(byte[] data, String topicSubpath, int qos)
Constructs a new TelemetryEvent with the data to publish and an optional topic subpath destination.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description byte[]
getData()
Gets this event's data.int
getQos()
Gets this event's quality of service settings.String
getTopicSubpath()
Gets this event's topic subpath.
-
-
-
Field Detail
-
QOS_AT_MOST_ONCE
public static final int QOS_AT_MOST_ONCE
At most once delivery.- See Also:
- Constant Field Values
-
QOS_AT_LEAST_ONCE
public static final int QOS_AT_LEAST_ONCE
At least once delivery.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
TelemetryEvent
public TelemetryEvent(@NonNull byte[] data, @Nullable String topicSubpath, int qos)
Constructs a new TelemetryEvent with the data to publish and an optional topic subpath destination.- Parameters:
data
- the telemetry event data to send to Cloud IoT CoretopicSubpath
- the subpath under "../device/../events/"qos
- the quality of service to use when sending the message
-
-
Method Detail
-
getData
public byte[] getData()
Gets this event's data.- Returns:
- this event's data
-
getTopicSubpath
public String getTopicSubpath()
Gets this event's topic subpath.Non-empty strings returned by this method always begin with a slash (e.g. /foo).
- Returns:
- this event's topic subpath
-
getQos
public int getQos()
Gets this event's quality of service settings.- Returns:
- this event's QOS settings
-
-