/**
 * @license
 * Copyright 2022-2025 Matter.js Authors
 * SPDX-License-Identifier: Apache-2.0
 */
import { TlvField, TlvObject } from "../tlv/TlvObject.js";
import { TlvEnum, TlvInt64 } from "../tlv/TlvNumber.js";
import { TlvBoolean } from "../tlv/TlvBoolean.js";
import { TlvArray } from "../tlv/TlvArray.js";
import { TlvMeasurementAccuracyRange } from "./MeasurementAccuracyRange.js";
const TlvMeasurementAccuracy = TlvObject({
  /**
   * This field shall indicate the type of measurement for the accuracy provided.
   *
   * @see {@link MatterSpecification.v142.Cluster} § 2.1.3.3.1
   */
  measurementType: TlvField(0, TlvEnum()),
  /**
   * This field shall indicate whether the associated measurement was directly measured. If this field is not set to
   * true, then the associated measurement was estimated.
   *
   * @see {@link MatterSpecification.v142.Cluster} § 2.1.3.3.2
   */
  measured: TlvField(1, TlvBoolean),
  minMeasuredValue: TlvField(2, TlvInt64),
  maxMeasuredValue: TlvField(3, TlvInt64),
  /**
   * This field shall indicate a list of measurement ranges and their associated accuracies.
   *
   * The value of the RangeMin field on the first MeasurementAccuracyRangeStruct in this list shall be equal to the
   * value of the MinMeasuredValue field.
   *
   * The value of the RangeMax field on the last MeasurementAccuracyRangeStruct in this list shall be less than or
   * equal to the value of the MaxMeasuredValue field.
   *
   * The value of the RangeMin field on each MeasurementAccuracyRangeStruct in this list other than the first shall be
   * one more the value of the RangeMax field on the previous MeasurementAccuracyRangeStruct in this list (i.e. there
   * shall be no gaps in the accuracy ranges, and the ranges shall be in increasing order).
   *
   * @see {@link MatterSpecification.v142.Cluster} § 2.1.3.3.5
   */
  accuracyRanges: TlvField(4, TlvArray(TlvMeasurementAccuracyRange, { minLength: 1 }))
});
export {
  TlvMeasurementAccuracy
};
//# sourceMappingURL=MeasurementAccuracy.js.map
