Google Cloud IoT Core is being retired on August 16, 2023. Contact your Google Cloud account team for more information.

TelemetryEvent (iotcore 1.0.0 API)

com.google.android.things.iotcore

Class TelemetryEvent



  • public class TelemetryEvent
    extends Object
    Represents a telemetry event to publish to Cloud IoT Core.
    • 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 Core
        topicSubpath - 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