{
  "asyncapi": "3.0.0",
  "info": {
    "title": "WebSocket V2 Server",
    "version": "1.0.0"
  },
  "servers": {
    "websocket-v2-friendly": {
      "host": "tmm-api-local.fieldsystems.trimble.com:9639",
      "protocol": "ws"
    },
    "websocket-v2-localhost": {
      "host": "localhost:9639",
      "protocol": "ws"
    },
    "websocket-v2-loopback": {
      "host": "127.0.0.1:9639",
      "protocol": "ws"
    }
  },
  "channels": {
    "root": {
      "address": "/",
      "servers": [
        {
          "$ref": "#/servers/websocket-v2-friendly"
        },
        {
          "$ref": "#/servers/websocket-v2-localhost"
        },
        {
          "$ref": "#/servers/websocket-v2-loopback"
        }
      ],
      "messages": {
        "LocationV2DataMessage": {
          "$ref": "#/components/messages/LocationV2DataMessage"
        }
      }
    },
    "locationV2": {
      "address": "/locationV2",
      "servers": [
        {
          "$ref": "#/servers/websocket-v2-friendly"
        },
        {
          "$ref": "#/servers/websocket-v2-localhost"
        },
        {
          "$ref": "#/servers/websocket-v2-loopback"
        }
      ],
      "messages": {
        "LocationV2DataMessage": {
          "$ref": "#/components/messages/LocationV2DataMessage"
        }
      }
    },
    "events": {
      "address": "/events",
      "servers": [
        {
          "$ref": "#/servers/websocket-v2-friendly"
        },
        {
          "$ref": "#/servers/websocket-v2-localhost"
        },
        {
          "$ref": "#/servers/websocket-v2-loopback"
        }
      ],
      "messages": {
        "AntennaChangedMessage": {
          "$ref": "#/components/messages/AntennaChangedMessage"
        },
        "AppExitMessage": {
          "$ref": "#/components/messages/AppExitMessage"
        },
        "ConnectionStateChangedMessage": {
          "$ref": "#/components/messages/ConnectionStateChangedMessage"
        },
        "CorrectionSourceChangedMessage": {
          "$ref": "#/components/messages/CorrectionSourceChangedMessage"
        },
        "HeartbeatMessage": {
          "$ref": "#/components/messages/HeartbeatMessage"
        },
        "LocationsAvailableMessage": {
          "$ref": "#/components/messages/LocationsAvailableMessage"
        },
        "OnDemandChangedMessage": {
          "$ref": "#/components/messages/OnDemandChangedMessage"
        },
        "UserChangedMessage": {
          "$ref": "#/components/messages/UserChangedMessage"
        }
      }
    }
  },
  "operations": {
    "sendroot": {
      "action": "send",
      "channel": {
        "$ref": "#/channels/root"
      },
      "messages": [
        {
          "$ref": "#/channels/root/messages/LocationV2DataMessage"
        }
      ]
    },
    "sendlocationV2": {
      "action": "send",
      "channel": {
        "$ref": "#/channels/locationV2"
      },
      "messages": [
        {
          "$ref": "#/channels/locationV2/messages/LocationV2DataMessage"
        }
      ]
    },
    "sendevents": {
      "action": "send",
      "channel": {
        "$ref": "#/channels/events"
      },
      "messages": [
        {
          "$ref": "#/channels/events/messages/AntennaChangedMessage"
        },
        {
          "$ref": "#/channels/events/messages/AppExitMessage"
        },
        {
          "$ref": "#/channels/events/messages/ConnectionStateChangedMessage"
        },
        {
          "$ref": "#/channels/events/messages/CorrectionSourceChangedMessage"
        },
        {
          "$ref": "#/channels/events/messages/HeartbeatMessage"
        },
        {
          "$ref": "#/channels/events/messages/LocationsAvailableMessage"
        },
        {
          "$ref": "#/channels/events/messages/OnDemandChangedMessage"
        },
        {
          "$ref": "#/channels/events/messages/UserChangedMessage"
        }
      ]
    }
  },
  "components": {
    "messages": {
      "LocationV2DataMessage": {
        "payload": {
          "$ref": "#/components/schemas/LocationV2Data"
        }
      },
      "AntennaChangedMessage": {
        "payload": {
          "$ref": "#/components/schemas/AntennaChanged"
        }
      },
      "AppExitMessage": {
        "payload": {
          "$ref": "#/components/schemas/AppExit"
        }
      },
      "ConnectionStateChangedMessage": {
        "payload": {
          "$ref": "#/components/schemas/ConnectionStateChanged"
        }
      },
      "CorrectionSourceChangedMessage": {
        "payload": {
          "$ref": "#/components/schemas/CorrectionSourceChanged"
        }
      },
      "HeartbeatMessage": {
        "payload": {
          "$ref": "#/components/schemas/Heartbeat"
        }
      },
      "LocationsAvailableMessage": {
        "payload": {
          "$ref": "#/components/schemas/LocationsAvailable"
        }
      },
      "OnDemandChangedMessage": {
        "payload": {
          "$ref": "#/components/schemas/OnDemandChanged"
        }
      },
      "UserChangedMessage": {
        "payload": {
          "$ref": "#/components/schemas/UserChanged"
        }
      }
    },
    "schemas": {
      "LocationV2Data": {
        "type": "object",
        "properties": {
          "latitude": {
            "type": ["number", "null"],
            "format": "double",
            "description": "Latitude in decimal degrees (or null if unavailable) North positive, south negative"
          },
          "longitude": {
            "type": ["number", "null"],
            "format": "double",
            "description": "Longitude in decimal degrees (or null if unavailable) East positive, west negative"
          },
          "altitude": {
            "type": ["number", "null"],
            "format": "double",
            "description": "Altitude in meters (or null if unavailable)"
          },
          "speed": {
            "type": ["number", "null"],
            "format": "double",
            "description": "Speed in meters per second (or null if unavailable)"
          },
          "bearing": {
            "type": ["number", "null"],
            "format": "double",
            "description": "Bearing in decimal degrees (or null if unavailable) Measured clockwise from north for North Azimuth projections, or clockwise from south for South Azimuth projections."
          },
          "geoidModel": {
            "type": ["string", "null"],
            "description": "Geoid model used for height calculations (or null if unavailable)"
          },
          "hrms": {
            "type": ["number", "null"],
            "format": "double",
            "description": "Horizontal Root Mean Square in meters (or null if unavailable)"
          },
          "vrms": {
            "type": ["number", "null"],
            "format": "double",
            "description": "Vertical Root Mean Square in meters (or null if unavailable)"
          },
          "satellites": {
            "type": "integer",
            "description": "Number of satellites observed"
          },
          "totalSatInUse": {
            "type": "integer",
            "description": "Number of satellites that are used for the position solution"
          },
          "totalSatInView": {
            "type": "integer",
            "description": "Number of satellites in view, identical to satellites"
          },
          "pdop": {
            "type": ["number", "null"],
            "format": "double",
            "description": "Position Dilution of Precision (or null if unavailable)"
          },
          "hdop": {
            "type": ["number", "null"],
            "format": "double",
            "description": "Horizontal Dilution of Precision (or null if unavailable)"
          },
          "vdop": {
            "type": ["number", "null"],
            "format": "double",
            "description": "Vertical Dilution of Precision (or null if unavailable)"
          },
          "diffAge": {
            "type": ["number", "null"],
            "format": "double",
            "description": "Message age of any RTK message in seconds (or null if unavailable)"
          },
          "diffStatus": {
            "type": ["integer", "null"],
            "description": "Position solution status: 1=Autonomous, 2=DGPS, 4=Fixed, 5=Float, null=unavailable"
          },
          "diffID": {
            "type": "string",
            "description": "ID of the RTK base station -1 if unknown, otherwise 4-digit ID"
          },
          "receiverModel": {
            "type": "string",
            "description": "Receiver model type"
          },
          "receiverSerialNumber": {
            "type": "string",
            "description": "Receiver serial number"
          },
          "mockProvider": {
            "type": "string",
            "description": "Location 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 (or null if unavailable)"
          },
          "mslHeight": {
            "type": ["number", "null"],
            "format": "float",
            "description": "Height above mean sea level in meters (or null if unavailable) Includes geoid undulation if geoid is available"
          },
          "undulation": {
            "type": ["number", "null"],
            "format": "float",
            "description": "Height difference between ellipsoid and geoid (or null if unavailable)"
          },
          "utcTimeStamp": {
            "type": ["string", "null"],
            "description": "UTC time formatted as ISO string (or null if unavailable)"
          },
          "gpsTimeStamp": {
            "type": ["string", "null"],
            "description": "GPS time formatted as ISO string (or null if unavailable)"
          },
          "satelliteView": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SatelliteInfo"
            },
            "description": "List of satellites in view (or null if unavailable)"
          },
          "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"
          },
          "sourceReferenceFrameName": {
            "type": ["string", "null"],
            "description": "Name of the source reference frame used for the GNSS (or null if unavailable)"
          },
          "sourceReferenceFrameEpoch": {
            "type": ["number", "null"],
            "format": "double",
            "description": "Epoch of the realization of the source reference frame (or null if unavailable). It's the date at which the coordinates of the reference frame are exactly as given."
          },
          "targetReferenceFrameEpoch": {
            "type": ["number", "null"],
            "format": "double",
            "description": "Specific point in time that is used as a reference for the geodetic datum (or null if unavailable)."
          },
          "targetReferenceFrameName": {
            "type": ["string", "null"],
            "description": "Name of the target reference frame used for the GNSS (or null if unavailable)."
          },
          "imuAlignmentStatus": {
            "type": "integer",
            "description": "Current IMU alignment status 0: NotAvailable, IMU is not available 1: Unaligned, IMU is not aligned, start moving the receiver to align 2: Coarse, IMU is partially aligned, keep moving the receiver to complete alignment 3: Fine, IMU is fully aligned and ready for TIP measurement"
          },
          "isTIP": {
            "type": "boolean",
            "description": "True if this is a Trimble TIP position"
          },
          "pitch": {
            "type": ["number", "null"],
            "format": "double",
            "description": "Pitch of the receiver body in degrees (or null if unavailable)"
          },
          "roll": {
            "type": ["number", "null"],
            "format": "double",
            "description": "Roll of the receiver body in degrees (or null if unavailable)"
          },
          "yaw": {
            "type": ["number", "null"],
            "format": "double",
            "description": "Yaw of the receiver body in degrees (or null if unavailable)"
          },
          "tiltAngle": {
            "type": ["number", "null"],
            "format": "double",
            "description": "Combined tilt angle of the pole (or null if unavailable)"
          },
          "tiltPrecision": {
            "type": ["number", "null"],
            "format": "double",
            "description": "Precision of the combined tilt angle in degrees (or null if unavailable)"
          },
          "pitchPrecision": {
            "type": ["number", "null"],
            "format": "double",
            "description": "Precision of the pitch in degrees (or null if unavailable)"
          },
          "rollPrecision": {
            "type": ["number", "null"],
            "format": "double",
            "description": "Precision of the roll in degrees (or null if unavailable)"
          },
          "yawPrecision": {
            "type": ["number", "null"],
            "format": "double",
            "description": "Precision of the yaw in degrees (or null if unavailable)"
          },
          "igsAntenna": {
            "type": ["string", "null"],
            "description": "IGS antenna name (or null if unavailable)"
          },
          "antennaHeight": {
            "type": ["number", "null"],
            "format": "double",
            "description": "Antenna height in meters (or null if unavailable). Measured from the ground to the Antenna Reference Point (usually Bottom of antenna mount)"
          },
          "gpsL1Offset": {
            "type": ["number", "null"],
            "format": "double",
            "description": "GPS L1 Offset (or null if unavailable)."
          },
          "solutionType": {
            "type": ["string", "null"],
            "description": "Correction Source solutionType (or null if unavailable). [\"Autonomous\", \"RTKFloat\", \"RTKFixed\", \"HDRTK\", \"Differential\", \"RTX\", \"XFill\", \"SBAS\", \"XFillRTX\", \"RTXCode\"]"
          }
        }
      },
      "AntennaChanged": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "description": "\"event\""
          },
          "name": {
            "type": "string",
            "description": "\"AntennaChanged\""
          },
          "utcTime": {
            "type": "string",
            "description": "UTC time event was generated (ISO 8601 format)"
          },
          "isAntennaHeightApplied": {
            "type": "boolean",
            "description": "true: Apply a custom antenna height, false: Apply a zero antenna height"
          },
          "measuredHeight": {
            "type": "number",
            "format": "double",
            "description": "Antenna height, measured from the ground to the selected measurement method (meters)"
          },
          "antennaType": {
            "type": "string",
            "description": "Antenna type"
          },
          "measurementMethod": {
            "type": "string",
            "description": "Measurement method (i.e. Bottom of antenna mount)"
          },
          "gpsL1Offset": {
            "type": "number",
            "format": "double",
            "description": "Vertical offset from selected measurement method to the GPS L1 phase center (meters)"
          }
        }
      },
      "AppExit": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "description": "\"event\""
          },
          "name": {
            "type": "string",
            "description": "\"AppExit\""
          },
          "utcTime": {
            "type": "string",
            "description": "UTC time event was generated (ISO 8601 format)"
          },
          "status": {
            "type": "string",
            "description": "App exit status [\"normal\", \"unhandled exception\"]"
          }
        }
      },
      "ConnectionStateChanged": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "description": "\"event\""
          },
          "name": {
            "type": "string",
            "description": "\"ConnectionStateChanged\""
          },
          "utcTime": {
            "type": "string",
            "description": "UTC time event was generated (ISO 8601 format)"
          },
          "connectionState": {
            "type": "string",
            "description": "Current connection state. [\"Connected\", \"Connecting\", \"Disconnected\", \"Disconnecting\"]"
          },
          "receiverName": {
            "type": "string",
            "description": "The receiver name"
          },
          "receiverBrand": {
            "type": ["string", "null"],
            "description": "The receiver brand, null if unavailable"
          },
          "receiverModel": {
            "type": ["string", "null"],
            "description": "The receiver model, null if unavailable"
          },
          "receiverSerialNumber": {
            "type": ["string", "null"],
            "description": "The receiver serial number, null if unavailable"
          }
        }
      },
      "CorrectionSourceChanged": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "description": "\"event\""
          },
          "name": {
            "type": "string",
            "description": "\"CorrectionSourceChanged\""
          },
          "utcTime": {
            "type": "string",
            "description": "UTC time event was generated (ISO 8601 format)"
          },
          "isValid": {
            "type": "boolean",
            "description": "true: the current correction source is valid, false: it is not valid"
          },
          "correctionSource": {
            "type": "string",
            "description": "The correction source type (Auto, NTRIP, Direct)"
          },
          "serverAddress": {
            "type": ["string", "null"],
            "description": "The IP address or domain name of the server, or null if not available"
          },
          "serverPort": {
            "type": ["integer", "null"],
            "description": "The Port number of the server, or null if not available"
          },
          "ntripMountPoint": {
            "type": ["string", "null"],
            "description": "The format of the correction messages and the reference frame that relates to a real-time data stream, or null if not available"
          },
          "ntripUserName": {
            "type": ["string", "null"],
            "description": "The user name for the NTRIP account, or null if not available."
          },
          "ntripPassword": {
            "type": ["string", "null"],
            "description": "Password for the NTRIP account (obscured), or null if not available."
          }
        }
      },
      "Heartbeat": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "description": "\"event\""
          },
          "name": {
            "type": "string",
            "description": "\"Heartbeat\""
          },
          "utcTime": {
            "type": "string",
            "description": "UTC time event was generated (ISO 8601 format)"
          }
        }
      },
      "LocationsAvailable": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "description": "\"event\""
          },
          "name": {
            "type": "string",
            "description": "\"LocationsAvailable\""
          },
          "utcTime": {
            "type": "string",
            "description": "UTC time event was generated (ISO 8601 format)"
          },
          "isStreaming": {
            "type": "boolean",
            "description": "true: locations have started streaming, false: locations are unavailable"
          }
        }
      },
      "OnDemandChanged": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "description": "\"event\""
          },
          "name": {
            "type": "string",
            "description": "\"OnDemandChanged\""
          },
          "utcTime": {
            "type": "string",
            "description": "UTC time event was generated (ISO 8601 format)"
          },
          "state": {
            "type": "string",
            "description": "The current OnDemand session state. [\"Started\", \"Extended\", \"Stopped\"]"
          },
          "utcEndTime": {
            "type": "string",
            "description": "UTC time the OnDemand session ends (ISO 8601 format)"
          }
        }
      },
      "UserChanged": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "description": "\"event\""
          },
          "name": {
            "type": "string",
            "description": "\"UserChanged\""
          },
          "utcTime": {
            "type": "string",
            "description": "UTC time event was generated (ISO 8601 format)"
          },
          "isSignedIn": {
            "type": "boolean",
            "description": "The sign-in status"
          },
          "userName": {
            "type": ["string", "null"],
            "description": "The user's email address, null if unavailable"
          },
          "tid": {
            "type": ["string", "null"],
            "description": "The user's TID UUID, null if unavailable"
          }
        }
      },
      "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."
          }
        }
      }
    }
  }
}
