{
  "asyncapi": "3.0.0",
  "info": {
    "title": "WebSocket V1 Server",
    "version": "1.0.0"
  },
  "servers": {
    "websocket-v1-friendly": {
      "host": "tmm-api-local.fieldsystems.trimble.com:9635",
      "protocol": "ws"
    },
    "websocket-v1-localhost": {
      "host": "localhost:9635",
      "protocol": "ws"
    },
    "websocket-v1-loopback": {
      "host": "127.0.0.1:9635",
      "protocol": "ws"
    }
  },
  "channels": {
    "locationV1": {
      "address": "/",
      "servers": [
        {
          "$ref": "#/servers/websocket-v1-friendly"
        },
        {
          "$ref": "#/servers/websocket-v1-localhost"
        },
        {
          "$ref": "#/servers/websocket-v1-loopback"
        }
      ],
      "messages": {
        "LocationV1DataMessage": {
          "$ref": "#/components/messages/LocationV1DataMessage"
        }
      }
    }
  },
  "operations": {
    "sendlocationV1": {
      "action": "send",
      "channel": {
        "$ref": "#/channels/locationV1"
      },
      "messages": [
        {
          "$ref": "#/channels/locationV1/messages/LocationV1DataMessage"
        }
      ]
    }
  },
  "components": {
    "messages": {
      "LocationV1DataMessage": {
        "payload": {
          "$ref": "#/components/schemas/LocationV1Data"
        }
      }
    },
    "schemas": {
      "LocationV1Data": {
        "type": "object",
        "properties": {
          "latitude": {
            "type": "number",
            "format": "double",
            "description": "Latitude in decimal degrees North positive, south negative"
          },
          "longitude": {
            "type": "number",
            "format": "double",
            "description": "Longitude in decimal degrees East positive, west negative"
          },
          "altitude": {
            "type": "number",
            "format": "double",
            "description": "Altitude in meters"
          },
          "speed": {
            "type": "number",
            "format": "float",
            "description": "Speed in meters per second"
          },
          "bearing": {
            "type": "number",
            "format": "float",
            "description": "Bearing in decimal degrees Measured clockwise from north for North Azimuth projections, or clockwise from south for South Azimuth projections."
          },
          "accuracy": {
            "type": "number",
            "format": "float",
            "description": "Accuracy in meters"
          },
          "verticalAccuracyMeters": {
            "type": "number",
            "format": "float",
            "description": "Vertical accuracy in meters"
          },
          "satellites": {
            "type": "integer",
            "description": "Number of satellites observed"
          },
          "totalSatInView": {
            "type": "integer",
            "description": "Number of satellites in view, identical to satellites"
          },
          "pdop": {
            "type": "number",
            "format": "float",
            "description": "Position Dilution of Precision"
          },
          "hdop": {
            "type": "number",
            "format": "float",
            "description": "Horizontal Dilution of Precision"
          },
          "vdop": {
            "type": "number",
            "format": "float",
            "description": "Vertical Dilution of Precision"
          },
          "diffAge": {
            "type": "number",
            "format": "float",
            "description": "Message age of any RTK message in seconds"
          },
          "diffStatus": {
            "type": "integer",
            "description": "Position solution status: 1=Autonomous, 2=DGPS, 4=Fixed, 5=Float"
          },
          "diffID": {
            "type": "string",
            "description": "ID of the RTK base station -1 if unknown, otherwise 4-digit ID"
          },
          "vrms": {
            "type": "number",
            "format": "float",
            "description": "Vertical Root Mean Square in meters"
          },
          "hrms": {
            "type": "number",
            "format": "float",
            "description": "Horizontal Root Mean Square in meters"
          },
          "receiverModel": {
            "type": "string",
            "description": "Receiver model type"
          },
          "mockProvider": {
            "type": "string",
            "description": "Mock provider name “Trimble Mobile Manager”"
          },
          "appVersion": {
            "type": "string",
            "description": "TMM build version semantic versioning Major.Minor.Patch (0.0.0)"
          },
          "battery": {
            "type": ["integer", "null"],
            "description": "Battery percentage if the receiver has an internal battery"
          },
          "geoidModel": {
            "type": "string",
            "description": "Geoid model used for height calculations"
          },
          "mslHeight": {
            "type": ["number", "null"],
            "format": "float",
            "description": "Height above mean sea level in meters Includes geoid undulation if geoid is available"
          },
          "undulation": {
            "type": ["number", "null"],
            "format": "float",
            "description": "Height difference between ellipsoid and geoid"
          },
          "utcTime": {
            "type": "number",
            "format": "float",
            "description": "UTC time as a float"
          },
          "gpsTimeStamp": {
            "type": "string",
            "description": "GPS time formatted as ISO string"
          },
          "utcTimeStamp": {
            "type": "string",
            "description": "UTC time formatted as ISO string"
          },
          "satelliteView": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SatelliteInfo"
            },
            "description": "List of satellites in view"
          },
          "subscriptionType": {
            "type": "integer",
            "description": "The type of the currently used subscription 0 == Catalyst Free; 1 == Catalyst 60; 2 == Catalyst 30; 3 == Catalayst 10; 4 == Catalyst 1; 5 == Catalyst On Demand; 100 == GNSS receiver"
          }
        }
      },
      "SatelliteInfo": {
        "type": "object",
        "properties": {
          "Id": {
            "type": "integer",
            "description": "ID of the satellite"
          },
          "Elv": {
            "type": "integer",
            "description": "Elevation angles of the satellite above the horizon in degrees."
          },
          "Azm": {
            "type": "integer",
            "description": "Azimuth angle of the satellite in degrees."
          },
          "Snr": {
            "type": "integer",
            "description": "Signal-to-noise ratio (SNR) for the satellite."
          },
          "Use": {
            "type": "boolean",
            "description": "Satellite is is use true/false"
          },
          "Type": {
            "type": "integer",
            "description": "Type of GNSS system of the satellite."
          }
        }
      }
    }
  }
}
