#ifndef _SIO32INTERFACE_H
#define _SIO32INTERFACE_H

#include "DeviceInterface.h"
#include "DataManager.h"
#include "vxUtils.h"

extern "C"
{
# define Boolean MBool
# include "msgQLib.h"
# include "sio32.h"
# include "sio32Server.h"
# include "sio32Client.h"
# include "microDm.h"
# include "ibc_card.h"
# include "filter.h"
# include "gf_board.h"

/* ****
# include "sio32.h"
# include "sio32Server.h"
# include "sio32Client.h"
*** */
# include "microCmd.h"

};

/*
CLASS 
Sio32Interface

DESCRIPTION
Sio32Interface is a subclass of DeviceInterface. It implements the IBC
Sio32 serial protocol.

AUTHOR
Tom O'Reilly
*/
class Sio32Interface : public DeviceInterface
{
  public:

  Sio32Interface(const char *name, Nat16 channelNo); 

  ~Sio32Interface();
  
  // Read SRQ packet from device. Output buffer has bytes in 
  // device-native endian-ness.
  virtual int readSRQ(Byte *packet,       // o: buffer to hold packet
		      Int16 maxBytes,     // i: bytes in packet buffer
		      Int32 timeout       // i: timeout
		      );
  
  // Get word from buffer read device, perform any necessary byte-swapping
  virtual Word getWord(Void *packet, Int32 index);
  
  // Send enable command to device
  virtual STATUS enable();
  
  // Send reset command to micro
  virtual STATUS reset();

  // Return id string
  virtual STATUS id(Char *identString);

  // Return serial number
  virtual STATUS serialNo(Char *serialNo);

  // Return software rev
  virtual STATUS softwareRev(Char *softwareRev);

  // Return RAM test status
  virtual STATUS ramTest(MBool *ramTeststatus);
  
  // Return sio32 channel structure
  sio32Chan *channel();

  protected:
  
  //Sio32 Channel Data
  sio32Chan 	_sio32Chan;
};



#endif



