################################################################################
# Trimble Device Type definitions
#
# See README.md in this directory
######################################
TrimbleGPS:
  category: "device_type"
  description: "Generic Trimble GPS"

  format:
    GPZDA: '${:.2}ZDA,{GPSTime:g},{GPSDay:d},{GPSMonth:d},{GPSYear:d},{LocalHours:od},{LocalZone:od}*{CheckSum:x}'
    GPGLL: '${:.2}GLL,{Latitude:nlat_dir},{Longitude:nlat_dir},{FixTime:g},{DataValid:w},{Mode:w}*{CheckSum:x}'
    GPGGA: '${:.2}GGA,{GPSTime:g},{Latitude:nlat_dir},{Longitude:nlat_dir},{FixQuality:d},{NumSats:d},{HDOP:of},{AntennaHeight:of},M,{GeoidHeight:of},M,{LastDGPSUpdate:of},{DGPSStationID:od}*{CheckSum:x}'
    GPRMC: '${:.2}RMC,{GPSTime:f},{DataValid:w},{Latitude:nlat_dir},{Longitude:nlat_dir},{SpeedKt:f},{CourseTrue:f},{GPSDate:w},{MagneticVar:of},{MagneticVarEorW:ow},{Mode:w}*{Checksum:x}'
    GPVTG: '${:.2}VTG,{CourseTrue:of},T,{CourseMag:of},M,{SpeedKt:of},N,{SpeedKm:of},K,{Mode:w}*{CheckSum:x}'
    # $GPGSV,3,3,10,03,10,172,40,14,09,213,37,,,,,,,,*72
    GPGSV: '${:.2}GSV,{:og},{:og},{:og},{:og},{:og},{:og},{:og},{:og},{:og},{:og},{:og},{:og},{:og},{:og},{:og},{:og},{:og},{:og},{:og}*{Checksum:x}'
    GPGST: '${:.2}GST,{GPSTime:g},{ResidualRMS:g},{ErrorEllipseSemiMajor:g},{ErrorEllipseSemiMinor:g},{ErrorEllipseOrientation:g},{LatitudeError:g},{LongitudeError:g},{HeightError:g}*{CheckSum:x}'
    GPHDT: '${:.2}HDT,{HeadingTrue:og},T*{CheckSum:x}'
    # "$GPHBT,50,A,8*19"
    GPHBT: '${:.2}HBT,{:g},{:w},{:g}*{Checksum:x}'
    PASHR_VEL: '$PASHR,VEL,1,{GPSTime:g},{EastingVelocity:g},{NorthingVelocity:g},{VerticalVelocity:g},{EastingRMS:g},{NorthingRMS:g},{VerticalRMS:g},{SmoothingInterval:og}*{Checksum:x}'
    PASHR_ATT: '$PASHR,ATT,{GPSTime:g},{HeadingTrue:g},{Pitch:g},{Roll:g},{CarrierRMSMeters:og},{BaselineRMS:og},{AttitudeReset:d}*{Checksum:x}'

  ########
  # Optional metadata to help make sense of the parsed values.
  fields:
    # GPZDA
    GPSTime:
      units: ""
      description: "UTC of position fix in hhmmss.ss"
    GPSDay:
      units: ""
      description: ""
    GPSMonth:
      units: ""
      description: ""
    GPSYear:
      units: ""
      description: ""
    LocalHours:
      units: ""
      description: ""
    LocalZone:
      description: "Local time zone"

    # GPGLL
    Latitude:
      units: "degrees"
      description: "Latitude in degrees north; negative for south latitude"
    Longitude:
      units: "degrees"
      description: "Longitude in degrees east; negative for west longitude"
    FixTime:
      description: "UTC of position fix in hhmmss.ss format"
    DataValid:
      description: "A = data valid V = data invalid"
    Mode:
      description: "Mode Indicator: A-Autonomous, M-Manual, D-Differential, S-Simulator, E-Dead Reckoning, N-Data Not Valid"

    # $GPGGA
    FixQuality:
      Description: "GPS quality indicator: 0 = fix not available or invalid, 1 = GPS SPS mode, fix valid, 2 = differential GPS, SPS mode, fix valid, 3 = GPS PPS mode, fix valid, 4 = Real Time Kinematic. Satellite system used in RTK mode with fixed integers, 5 = Float RTK. Satellite system used in RTK mode with floating integers, 6 = Estimated (dead reckoning) mode, 7 = Manual input mode"
    NumSats:
      description: "Number of satellites in use (00-12)"
    HDOP:
      description: "Horizontal DOP"
    AntennaHeight:
      units: "Meters"
      description: "Antenna height above/below MSL (mean sea level) reference"
    GeoidHeight:
      units: "Meters"
      description: "Geoidal separation (e.g. -33.81 m)"
    LastDGPSUpdate:
      description: "Age of differential GPS data record"
    DGPSStationID:
      description: "Differential Reference Station ID (0000-1023)"

    # GPRMC
    SpeedKt:
      units: "Knots"
      description: "Speed over ground in knots"
    CourseTrue:
      units: "Degrees"
      description: "Course over ground, True"
    MagneticVar:
      units: "Degrees"
      description: "Magnetic variation"
    MagneticVarEorW:
      description: "Direction of magnetic variation (E - East, W - West)"

    # GPVTG
    CourseMag:
      units: "Degrees"
      description: "Course over ground, Magnetic"
    SpeedKm:
      units: "Km/hour"
      description: "Speed over ground in Km/hour"

    # GNGST
    ResidualRMS:
      units: ""
      description: "RMS of pseudo-range residuals"
    ErrorEllipseSemiMajor:
      units: "Meters"
      description: "Error ellipse semi-major axis 1 sigma error"
    ErrorEllipseSemiMinor:
      units: "Meters"
      description: "Error ellipse semi-minor axis 1 sigma error"
    ErrorEllipseOrientation:
      units: "Degrees"
      description: "Error ellipse orientation"
    LatitudeError:
      units: "Meters"
      description: "Latitude 1 sigma error"
    LongitudeError:
      units: "Meters"
      description: "Longitude 1 sigma error"
    HeightError:
      units: "Meters"
      description: "Height 1 sigma error"

    # GPHDT
    HeadingTrue:
      units: "Degrees"
      description: "Heading, True"

    # PASHR_VEL
    EastingVelocity:
      units: "Meters/sec"
      description: "Easting velocity"
    EastingVelocity:
      units: "Meters/sec"
      description: "Easting velocity"
    NorthingVelocity:
      units: "Meters/sec"
      description: "Northing velocity"
    VerticalVelocity:
      units: "Meters/sec"
      description: "Vertical velocity"
    EastingVelocityRMS:
      units: "MM/sec"
      description: "Easting velocity RMS"
    NorthingVelocityRMS:
      units: "MM/sec"
      description: "Northing velocity RMS"
    VerticalVelocityRMS:
      units: "MM/sec"
      description: "Vertical velocityRMS"
