package com.amazon.ads.ema.api.model;

import android.os.Parcel;
import android.os.Parcelable;

/**
 * Temperature information
 */
public class TemperatureInfo implements Parcelable {
    public static final Creator<TemperatureInfo> CREATOR = new Creator<>() {
        @Override
        public TemperatureInfo createFromParcel(Parcel in) {
            return new TemperatureInfo(in);
        }

        @Override
        public TemperatureInfo[] newArray(int size) {
            return new TemperatureInfo[size];
        }
    };
    public float cpuCelsius;            // CPU temperature in Celsius
    public float gpuCelsius;            // GPU temperature in Celsius
    public String thermalState;         // "NORMAL", "WARNING", "CRITICAL"

    public TemperatureInfo() {
    }

    protected TemperatureInfo(Parcel in) {
        cpuCelsius = in.readFloat();
        gpuCelsius = in.readFloat();
        thermalState = in.readString();
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeFloat(cpuCelsius);
        dest.writeFloat(gpuCelsius);
        dest.writeString(thermalState);
    }

    @Override
    public int describeContents() {
        return 0;
    }
}
