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

#ifndef __AhrsIF_H
#define __AhrsIF_H

#include "TaskInterface.h"

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

#define AhrsIFServerName "AhrsIFServer"

class AhrsIF : public InstrumentIF {

  friend class AhrsIF_SK;

  public:

  // Forward declarations of public structures
  struct Attitude;
  
  
  
  struct Attitude {
    double roll;
    double pitch;
    double yaw;
    double rollRate;
    double pitchRate;
    double yawRate;
  };
  AhrsIF(const char *name, int timeout = 10);

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

  ~AhrsIF();

  ////////////////////////////////////////////////////////////
  // Get attitude
  DeviceIF::Status getAttitude(AhrsIF::Attitude *attitude, TimeIF::TimeSpec *sampleTime);

  ////////////////////////////////////////////////////////////
  // Return True if AHRS is implemented with magnetic compass.
  // (Navigation might need to make magnetic correction)
  Boolean magneticCompass();

  
  protected:

  // Message codes for each method
  enum AhrsIFMsgCode {
    GetAttitudeMsgCode = 8,
    MagneticCompassMsgCode
  };

  // Define message structure for each method
  struct GetAttitudeMsg : Request, Reply {
    DeviceIF::Status returnVal;
    AhrsIF::Attitude attitude;
    TimeIF::TimeSpec sampleTime;
  
  } _getAttitudeMsg;

  struct MagneticCompassMsg : Request, Reply {
    Boolean returnVal;
  
  } _magneticCompassMsg;

};

#endif

