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

#ifndef __DeviceIF_H
#define __DeviceIF_H

#include "TaskInterface.h"


#define DeviceIFServerName "DeviceIFServer"

/****************************************************************************/
/* Copyright (c) 2000 MBARI                                                 */
/* MBARI Proprietary Information. All rights reserved.                      */
/****************************************************************************/
/* Summary  :                                                               */
/* Filename : WatchdogIF.idl                                                */
/* Author   :                                                               */
/* Project  :                                                               */
/* Version  : 1.0                                                           */
/* Created  : 02/07/2000                                                    */
/* Modified :                                                               */
/* Archived :                                                               */
/****************************************************************************/
/* Modification History:                                                    */
/****************************************************************************/
/*
CLASS 
WatchdogIF

DESCRIPTION
TaskInterface to Watchdog device driver

*/
/****************************************************************************/
/* Copyright (c) 2000 MBARI                                                 */
/* MBARI Proprietary Information. All rights reserved.                      */
/****************************************************************************/
/* Summary  :                                                               */
/* Filename : InstrumentIF.idl                                              */
/* Author   : Tom O'Reilly                                                  */
/* Project  :                                                               */
/* Version  : 1.0                                                           */
/* Created  : 02/07/2000                                                    */
/* Modified :                                                               */
/* Archived :                                                               */
/****************************************************************************/
/* Modification History:                                                    */
/****************************************************************************/
/****************************************************************************/
/* Copyright (c) 2000 MBARI                                                 */
/* MBARI Proprietary Information. All rights reserved.                      */
/****************************************************************************/
/* Summary  :                                                               */
/* Filename : DeviceIF.idl                                                  */
/* Author   : Tom O'Reilly                                                  */
/* Project  :                                                               */
/* Version  : 1.0                                                           */
/* Created  : 02/07/2000                                                    */
/* Modified :                                                               */
/* Archived :                                                               */
/****************************************************************************/
/* Modification History:                                                    */
/****************************************************************************/
/*
CLASS 
DeviceIF

DESCRIPTION
TaskInterface for device drivers

AUTHOR
Tom O'Reilly

*/
class DeviceIF : public TaskInterface {

  friend class DeviceIF_SK;

  public:

  
  /////////////////////////////////////////////////////////
  // Device status
  enum Status {
    Ok,
    Initializing,
    Offline,
    Error
  };

  
  typedef char Name[32];
  
  DeviceIF(const char *name, int timeout = 10);

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

  ~DeviceIF();

  /////////////////////////////////////////////////////////
  // Name
  void name(DeviceIF::Name name);

  /////////////////////////////////////////////////////////
  // Serial number
  void serialNumber(DeviceIF::Name id);

  /////////////////////////////////////////////////////////
  // Initialize
  DeviceIF::Status initialize();

  /////////////////////////////////////////////////////////
  // Turn device "on"
  DeviceIF::Status powerOn();

  /////////////////////////////////////////////////////////
  // Turn device "off"
  DeviceIF::Status powerOff();

  /////////////////////////////////////////////////////////
  // Device status
  DeviceIF::Status status();

  
  protected:

  // Message codes for each method
  enum DeviceIFMsgCode {
    NameMsgCode,
    SerialNumberMsgCode,
    InitializeMsgCode,
    PowerOnMsgCode,
    PowerOffMsgCode,
    StatusMsgCode
  };

  // Define message structure for each method
  struct NameMsg : Request, Reply {
    DeviceIF::Name name;
  
  } _nameMsg;

  struct SerialNumberMsg : Request, Reply {
    DeviceIF::Name id;
  
  } _serialNumberMsg;

  struct InitializeMsg : Request, Reply {
    DeviceIF::Status returnVal;
  
  } _initializeMsg;

  struct PowerOnMsg : Request, Reply {
    DeviceIF::Status returnVal;
  
  } _powerOnMsg;

  struct PowerOffMsg : Request, Reply {
    DeviceIF::Status returnVal;
  
  } _powerOffMsg;

  struct StatusMsg : Request, Reply {
    DeviceIF::Status returnVal;
  
  } _statusMsg;

};

#endif

