{
  "$schema": "https://apidocs.iqrf.org/iqrf-gateway-daemon/latest/com.iqrftech.self-desc/schema/jsonschema/1-0-0#",
  "title": "GetDevice response",
  "description": "Retrieves information about device in database.",
  "type": "object",
  "required": [
    "mType",
    "data"
  ],
  "additionalProperties": false,
  "properties": {
    "mType": {
      "$id": "#/properties/mType",
      "title": "Message type",
      "description": "IQRF DB - GetDevice response.",
      "type": "string",
      "enum": [
        "iqrfDb_GetDevice"
      ]
    },
    "data": {
      "$id": "#/properties/data",
      "title": "Response data",
      "description": "Response data.",
      "type": "object",
      "required": [
        "msgId",
        "rsp"
      ],
      "additionalProperties": false,
      "properties": {
        "msgId": {
          "$id": "#/properties/data/properties/msgId",
          "title": "Message ID",
          "description": "Message ID used for pairing requests and responses.",
          "type": "string"
        },
        "rsp": {
          "$id": "#/properties/data/properties/rsp",
          "title": "Response parameters",
          "description": "Response parameters.",
          "type": "object",
          "required": [
            "device"
          ],
          "additionalProperties": false,
          "properties": {
            "device": {
              "$id": "#/properties/data/properties/rsp/device",
              "title": "Device information",
              "oneOf": [
                {
                  "type": "object",
                  "required": [
                    "address",
                    "hwpid"
                  ],
                  "additionalProperties": false,
                  "properties": {
                    "address": {
                      "title": "Device address",
                      "type": "integer",
                      "minimum": 0,
                      "maximum": 255
                    },
                    "hwpid": {
                      "title": "Hardware profile ID",
                      "type": "integer",
                      "minimum": 0,
                      "maximum": 65535
                    },
                    "manufacturer": {
                      "title": "Manufacturer name",
                      "oneOf": [
                        {"type": "string"},
                        {"type": "null"}
                      ]
                    },
                    "product": {
                      "title": "Product name",
                      "oneOf": [
                        {"type": "string"},
                        {"type": "null"}
                      ]
                    },
                    "discovered": {
                      "title": "Discovery status",
                      "type": "boolean"
                    },
                    "vrn": {
                      "title": "Virtual routing number",
                      "type": "integer",
                      "minimum": 0,
                      "maximum": 255
                    },
                    "zone": {
                      "title": "Zone",
                      "type": "integer",
                      "minimum": 0,
                      "maximum": 255
                    },
                    "parent": {
                      "title": "Parent device",
                      "oneOf": [
                        {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 255
                        },
                        {"type": "null"}
                      ]
                    },
                    "mid": {
                      "title": "Module ID",
                      "type": "integer",
                      "minimum": 0
                    },
                    "hwpidVersion": {
                      "title": "Hardware profile ID version",
                      "type": "integer",
                      "minimum": 0,
                      "maximum": 65535
                    },
                    "osBuild": {
                      "title": "OS build",
                      "type": "integer",
                      "minimum": 0,
                      "maximum": 65535
                    },
                    "osVersion": {
                      "title": "OS version",
                      "type": "string"
                    },
                    "dpa": {
                      "title": "DPA version",
                      "type": "integer",
                      "minimum": 0,
                      "maximum": 65535
                    },
                    "sensors": {
                      "title": "Sensors implemented",
                      "type": "array",
                      "additionalItems": false,
                      "items": {
                        "title": "Sensor information",
                        "type": "object",
                        "required": [
                          "index",
                          "type",
                          "name",
                          "shortname",
                          "unit",
                          "decimalPlaces",
                          "frcs"
                        ],
                        "additionalProperties": false,
                        "properties": {
                          "index": {
                            "title": "Sensor index",
                            "type": "integer",
                            "minimum": 0,
                            "maximum": 31
                          },
                          "type": {
                            "title": "Sensor type",
                            "type": "integer",
                            "minimum": 1,
                            "maximum": 255
                          },
                          "name": {
                            "title": "Quantity name",
                            "type": "string"
                          },
                          "shortname": {
                            "title": "Quantity shortname",
                            "type": "string"
                          },
                          "unit": {
                            "title": "Unit of measurement",
                            "oneOf": [
                              {"type": "string"},
                              {"type": "null"}
                            ]
                          },
                          "decimalPlaces": {
                            "title": "Precision",
                            "type": "integer",
                            "minimum": 0
                          },
                          "frcs": {
                            "title": "Supported FRC commands",
                            "type": "array",
                            "additionalItems": false,
                            "items": {
                              "title": "FRC command",
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 255
                            }
                          }
                        }
                      }
                    },
                    "binouts": {
                      "title": "Implemented binouts",
                      "description": "Information about implemented binary outputs",
                      "type": "object",
                      "required": [
                        "count"
                      ],
                      "additionalProperties": false,
                      "properties": {
                        "count": {
                          "title": "Binout count",
                          "description": "Number of implemented binary outputs"
                        }
                      }
                    },
                    "light": {
                      "title": "Implemented light",
                      "description": "Device implements light standard",
                      "type": "boolean"
                    },
                    "metadata": {
                      "title": "User metadata",
                      "oneOf": [
                        { "type": "object" },
                        { "type": "null" }
                      ]
                    }
                  }
                },
                {
                  "type": "null"
                }
              ]
            }
          }
        },
        "insId": {
          "$id": "#/properties/data/properties/insId",
          "title": "Instance ID",
          "description": "Daemon insteance ID.",
          "type": "string"
        },
        "status": {
          "$id": "#/properties/data/properties/status",
          "title": "Status code",
          "description": "Status code.",
          "type": "integer"
        },
        "statusStr": {
          "$id": "#/properties/data/properties/statusStr",
          "title": "Status string",
          "description": "Verbose status string",
          "type": "string"
        }
      }
    }
  }
}
