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

  format:
    GPDTM: '${:.2}DTM,{LocalDatum:w},,{LatitudeOffset:nlat_dir},{LongitudeOffset:nlat_dir},,W84*{Checksum:x}'
    GPRMC: '${:.2}RMC,{GPSTime:f},{GPSStatus:w},{Latitude:nlat_dir},{Longitude:nlat_dir},{SpeedKt:f},{CourseTrue:f},{GPSDate:w},{MagneticVar:of},{MagneticVarEorW:ow}*{Checksum:x}'
    GPGLL: '${:.2}GLL,{Latitude:nlat_dir},{Longitude:nlat_dir},{FixTime:g},{DataValid: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}'
    GPVTG: '${:.2}VTG,{CourseTrue:of},T,{CourseMag:of},M,{SpeedKt:of},N,{SpeedKm:of},K*{CheckSum:x}'
    GPZDA: '${:.2}ZDA,{GPSTime:g},{GPSDay:d},{GPSMonth:d},{GPSYear:d},{LocalHours:od},{LocalZone:od}*{CheckSum:x}'
    GPGNS: '${:.2}GNS,{GPSTime:f},{Latitude:nlat_dir},{Longitude:nlat_dir},{PosMode:w},{NumSatellites:d},{HDOP:f},{Altitude:f},{GeoidSep:f},,*{Checksum:x}'
    GPHBT: '${:.2}HBT,{HeartbeatRepeatInterval:f},{Status:w},{HeartbeatSentenceID:d}*{CheckSum:x}'
    GPGSV1: '${:.2}GSV,{NumMessages:d},{MessageNum:d},{NumSatellites:d},{SatId1:d},{ElevSat1:d},{AzimuthSat1:d},{SignalStrengthSat1:d}*{CheckSum:x}'
    GPGSV2: '${:.2}GSV,{NumMessages:d},{MessageNum:d},{NumSatellites:d},{SatId1:d},{ElevSat1:d},{AzimuthSat1:d},{SignalStrengthSat1:d},{SatId2:d},{ElevSat2:d},{AzimuthSat2:d},{SignalStrengthSat2:d}*{CheckSum:x}'
    GPGSV3: '${:.2}GSV,{NumMessages:d},{MessageNum:d},{NumSatellites:d},{SatId1:d},{ElevSat1:d},{AzimuthSat1:d},{SignalStrengthSat1:d},{SatId2:d},{ElevSat2:d},{AzimuthSat2:d},{SignalStrengthSat2:d},{SatId3:d},{ElevSat3:d},{AzimuthSat3:d},{SignalStrengthSat3:d}*{CheckSum:x}'
    GPGSV4: '${:.2}GSV,{NumMessages:d},{MessageNum:d},{NumSatellites:d},{SatId1:d},{ElevSat1:d},{AzimuthSat1:d},{SignalStrengthSat1:d},{SatId2:d},{ElevSat2:d},{AzimuthSat2:d},{SignalStrengthSat2:d},{SatId3:d},{ElevSat3:d},{AzimuthSat3:d},{SignalStrengthSat3:d},{SatId4:d},{ElevSat4:d},{AzimuthSat4:d},{SignalStrengthSat4:d}*{CheckSum:x}'

  ########
  # Optional metadata to help make sense of the parsed values.
  fields:
    # GPDTM
    LocalDatum:
      description: "Local datum"
    LatitudeOffset:
      units: "Degrees"
      description: "Latitude offset"
    LongitudeOffset:
      units: "Degrees"
      description: "Longitude offset"

    # 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"
    NumSatellites:
      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"

    # GPGNS
    PosMode:
      description: "Position mode"
    GeoidSep:
      units: ""
      description: "Geoid Separation"
    Altitude:
      units: "Meters"
      description: "Altitude"

    #$GPGSV,{NumMessages:d},{MessageNum:d},{NumSatellites:d},{SatId1:d},{ElevSat1:d},{AzimuthSat1:d},{SignalStrengthSat1:d},{SatId2:d},{ElevSat2:d},{AzimuthSat2:d},{SignalStrengthSat2:d},{SatId3:d},{ElevSat3:d},{AzimuthSat3:d},{SignalStrengthSat3:d},{SatId4:d},{ElevSat4:d},{AzimuthSat4:d},{SignalStrengthSat4:d}*{CheckSum:x}'
    NumMessages:
      description: "Total number of messages in this transmission"
    MessageNum:
      description: "Sequence number of this message"
    SatId1:
      description: "ID of first satellite in  message"
    ElevSat1:
      units: "Degrees"
      description: "Elevation of first satellite in message"
    AzimuthSat1:
      units: "Degrees"
      description: "Azimuth of first satellite in message"
    SignalStrengthSat1:
      description: "Signal strength of first satellite in message"

    SatId2:
      description: "ID of second satellite in  message"
    ElevSat2:
      units: "Degrees"
      description: "Elevation of second satellite in message"
    AzimuthSat2:
      units: "Degrees"
      description: "Azimuth of second satellite in message"
    SignalStrengthSat2:
      description: "Signal strength of second satellite in message"

    SatId3:
      description: "ID of third satellite in  message"
    ElevSat3:
      units: "Degrees"
      description: "Elevation of third satellite in message"
    AzimuthSat3:
      units: "Degrees"
      description: "Azimuth of third satellite in message"
    SignalStrengthSat3:
      description: "Signal strength of third satellite in message"

    SatId4:
      description: "ID of fourth satellite in  message"
    ElevSat4:
      units: "Degrees"
      description: "Elevation of fourth satellite in message"
    AzimuthSat4:
      units: "Degrees"
      description: "Azimuth of fourth satellite in message"
    SignalStrengthSat4:
      description: "Signal strength of fourth satellite in message"
