/*
********************************************************
Copyright 2000 MBARI.
MBARI Proprietary Information. All rights reserved.
NOTE: This file is automatically generated.
DO NOT MODIFY.
********************************************************
*/

#ifndef __GpsIF_H
#define __GpsIF_H

#include "TaskInterface.h"

#include "InstrumentIF.h"
#include "TimeIF.h"

#define GpsIFServerName "GpsIFServer"

class GpsIF : public InstrumentIF {

  friend class GpsIF_SK;

  public:

  // Forward declarations of public structures
  struct Fix;
  
  /////////////////////////////////////////////////////////
  // "Quality" as defined by NMEA standard.
  enum Quality {
    Invalid,
    NonDifferential,
    Differential
  };

  enum Hemisphere {
    Northern,
    Southern,
    Eastern,
    Western
  };

  
  
  /////////////////////////////////////////////////////////
  // Data structure contains items specified by the
  // NMEA GPS data standard.
  struct Fix {
    TimeIF::TimeSpec sampleTime;
    /////////////////////////////////////////////////////////
    // Latitude (radians)
    double latitude;
    GpsIF::Hemisphere nsHemisphere;
    /////////////////////////////////////////////////////////
    // Longitude (radians)
    double longitude;
    GpsIF::Hemisphere ewHemisphere;
    /////////////////////////////////////////////////////////
    // Data quality (see above)
    GpsIF::Quality quality;
    /////////////////////////////////////////////////////////
    // Number of satellites used in fix
    short nSatellites;
    /////////////////////////////////////////////////////////
    // Horizontal dilution of precision
    double hdop;
    /////////////////////////////////////////////////////////
    // Altitude above mean sealevel in meters
    double altitude;
    /////////////////////////////////////////////////////////
    // Geoid height above mean sealevel in meters
    double geoidHeight;
    /////////////////////////////////////////////////////////
    // DGPS fix age in seconds
    short dgpsDataAge;
    /////////////////////////////////////////////////////////
    // DGPS reference station id
    short dgpsStationId;
  };
  GpsIF(const char *name, int timeout = 10);

  GpsIF(const char *name, const char *serverName, int timeout = 10);

  ~GpsIF();

  /////////////////////////////////////////////////////////
  // Get data from instrument
  // [output] Data: Gps data
  DeviceIF::Status getFix(GpsIF::Fix *fix);

  
  protected:

  // Message codes for each method
  enum GpsIFMsgCode {
    GetFixMsgCode = 8
  };

  // Define message structure for each method
  struct GetFixMsg : Request, Reply {
    DeviceIF::Status returnVal;
    GpsIF::Fix fix;
  
  } _getFixMsg;

};

#endif

