{
  "name": "Verified Telemetry",
  "status": "deprecated",
  "shortId": "verifiedtelemetrysensor",
  "camelName": "verifiedTelemetry",
  "shortName": "verifiedTelemetry",
  "extends": [
    "_base"
  ],
  "notes": {
    "short": "A mixin service that exposes verified telemetry information for a sensor (see https://github.com/Azure/Verified-Telemetry/tree/main/PnPModel)."
  },
  "classIdentifier": 563381279,
  "enums": {
    "Status": {
      "name": "Status",
      "storage": 1,
      "members": {
        "Unknown": 0,
        "Working": 1,
        "Faulty": 2
      }
    },
    "FingerprintType": {
      "name": "FingerprintType",
      "storage": 1,
      "members": {
        "FallCurve": 1,
        "CurrentSense": 2,
        "Custom": 3
      }
    }
  },
  "constants": {},
  "packets": [
    {
      "kind": "report",
      "name": "command_not_implemented",
      "identifier": 3,
      "description": "This report may be emitted by a server in response to a command (action or register operation)\nthat it does not understand.\nThe `service_command` and `packet_crc` fields are copied from the command packet that was unhandled.\nNote that it's possible to get an ACK, followed by such an error report.",
      "fields": [
        {
          "name": "service_command",
          "type": "u16",
          "storage": 2,
          "isSimpleType": true
        },
        {
          "name": "packet_crc",
          "type": "u16",
          "storage": 2,
          "isSimpleType": true
        }
      ],
      "identifierName": "command_not_implemented",
      "packFormat": "u16 u16",
      "derived": "_base"
    },
    {
      "kind": "const",
      "name": "instance_name",
      "identifier": 265,
      "description": "A friendly name that describes the role of this service instance in the device.\nIt often corresponds to what's printed on the device:\nfor example, `A` for button A, or `S0` for servo channel 0.\nWords like `left` should be avoided because of localization issues (unless they are printed on the device).",
      "fields": [
        {
          "name": "_",
          "type": "string",
          "storage": 0
        }
      ],
      "optional": true,
      "identifierName": "instance_name",
      "packFormat": "s",
      "derived": "_base"
    },
    {
      "kind": "ro",
      "name": "status_code",
      "identifier": 259,
      "description": "Reports the current state or error status of the device. ``code`` is a standardized value from \nthe Jacdac status/error codes. ``vendor_code`` is any vendor specific error code describing the device\nstate. This report is typically not queried, when a device has an error, it will typically\nadd this report in frame along with the announce packet. If a service implements this register,\nit should also support the ``status_code_changed`` event defined below.",
      "fields": [
        {
          "name": "code",
          "type": "u16",
          "storage": 2,
          "isSimpleType": true
        },
        {
          "name": "vendor_code",
          "type": "u16",
          "storage": 2,
          "isSimpleType": true
        }
      ],
      "optional": true,
      "identifierName": "status_code",
      "packFormat": "u16 u16",
      "derived": "_base"
    },
    {
      "kind": "rw",
      "name": "client_variant",
      "identifier": 9,
      "description": "An optional register in the format of a URL query string where the client can provide hints how\nthe device twin should be rendered. If the register is not implemented, the client library can simulate the register client side.",
      "fields": [
        {
          "name": "_",
          "type": "string",
          "storage": 0
        }
      ],
      "optional": true,
      "identifierName": "client_variant",
      "packFormat": "s",
      "derived": "_base"
    },
    {
      "kind": "event",
      "name": "status_code_changed",
      "identifier": 4,
      "description": "Notifies that the status code of the service changed.",
      "fields": [
        {
          "name": "code",
          "type": "u16",
          "storage": 2,
          "isSimpleType": true
        },
        {
          "name": "vendor_code",
          "type": "u16",
          "storage": 2,
          "isSimpleType": true
        }
      ],
      "optional": true,
      "identifierName": "status_code_changed",
      "packFormat": "u16 u16",
      "derived": "_base"
    },
    {
      "kind": "ro",
      "name": "telemetry_status",
      "identifier": 384,
      "description": "Reads the telemetry working status, where ``true`` is working and ``false`` is faulty.",
      "fields": [
        {
          "name": "_",
          "type": "Status",
          "storage": 1
        }
      ],
      "packFormat": "u8"
    },
    {
      "kind": "rw",
      "name": "telemetry_status_interval",
      "identifier": 128,
      "description": "Specifies the interval between computing the fingerprint information.",
      "fields": [
        {
          "name": "_",
          "unit": "ms",
          "type": "u32",
          "storage": 4,
          "isSimpleType": true
        }
      ],
      "optional": true,
      "packFormat": "u32"
    },
    {
      "kind": "const",
      "name": "fingerprint_type",
      "identifier": 385,
      "description": "Type of the fingerprint.",
      "fields": [
        {
          "name": "_",
          "type": "FingerprintType",
          "storage": 1
        }
      ],
      "packFormat": "u8"
    },
    {
      "kind": "ro",
      "name": "fingerprint_template",
      "identifier": 386,
      "description": "Template Fingerprint information of a working sensor.",
      "fields": [
        {
          "name": "confidence",
          "unit": "%",
          "type": "u16",
          "storage": 2,
          "isSimpleType": true
        },
        {
          "name": "template",
          "type": "bytes",
          "storage": 0,
          "isSimpleType": true
        }
      ],
      "packFormat": "u16 b"
    },
    {
      "kind": "command",
      "name": "reset_fingerprint_template",
      "identifier": 128,
      "description": "This command will clear the template fingerprint of a sensor and collect a new template fingerprint of the attached sensor.",
      "fields": []
    },
    {
      "kind": "command",
      "name": "retrain_fingerprint_template",
      "identifier": 129,
      "description": "This command will append a new template fingerprint to the `fingerprintTemplate`. Appending more fingerprints will increase the accuracy in detecting the telemetry status.",
      "fields": [],
      "unique": true
    },
    {
      "kind": "event",
      "name": "telemetry_status_change",
      "identifier": 3,
      "description": "The telemetry status of the device was updated.",
      "fields": [
        {
          "name": "telemetry_status",
          "type": "Status",
          "storage": 1
        }
      ],
      "identifierName": "change",
      "packFormat": "u8"
    },
    {
      "kind": "event",
      "name": "fingerprint_template_change",
      "identifier": 128,
      "description": "The fingerprint template was updated",
      "fields": []
    }
  ],
  "tags": []
}